Skip to content

[SRCH-6455] - remove i14y code#2045

Merged
luisgmetzger merged 15 commits into
GSA:mainfrom
luisgmetzger:SRCH-6455/remove-i14y-code
May 22, 2026
Merged

[SRCH-6455] - remove i14y code#2045
luisgmetzger merged 15 commits into
GSA:mainfrom
luisgmetzger:SRCH-6455/remove-i14y-code

Conversation

@luisgmetzger
Copy link
Copy Markdown
Contributor

@luisgmetzger luisgmetzger commented May 20, 2026

Summary

Remove all i14y code from the codebase per SRCH-6455. The i14y integration is retired — all document search now goes through SearchElastic/OpenSearch engines directly.

Key changes:

  • Extract shared methods from I14ySearch into a DocumentSearchable concern, reparent BlendedSearch and SearchElasticEngine to inherit from FilterableSearch
  • Delete 26 pure i14y files (models, controllers, views, helpers, observer, libs)
  • Update ~35 files with i14y references (controllers, models, views, helpers, config, JS, env)
  • Add migration to migrate SearchGov affiliates → SearchElastic, drop i14y_drawers/i14y_memberships tables, remove gets_i14y_results/i14y_date_stamp_enabled columns
  • Delete 17 spec files, 5 fixtures, 3 VCR cassettes; update 25+ specs and Cucumber features
  • Remove SearchGov from SEARCH_ENGINES constant

120 files changed, ~5,100 lines removed.

Checklist

Functionality Checks

  • You have merged the latest changes from the target branch (usually main) into your branch.
  • Your primary commit message is of the format SRCH-#### matching the associated Jira ticket.
  • PR title is either of the format SRCH-#### matching the associated Jira ticket.
  • Automated checks pass.

Process Checks

  • You have specified at least one "Reviewer".

How to test

  1. Verify no i14y references remain:

    grep -ri i14y app/ lib/ config/ spec/ features/ --include='*.rb' --include='*.haml' --include='*.ts' --include='*.tsx'
    

    Should return nothing (VCR cassettes with base64 noise are expected false positives).

  2. Verify routes are clean:

    bin/rails routes | grep i14y
    

    Should return nothing.

  3. Run the migration:

    bin/rails db:migrate
    

    Confirm i14y_drawers and i14y_memberships tables are dropped, and any search_gov affiliates are migrated to search_elastic.

  4. Run specs: bundle exec rspec

  5. Run Cucumber features: bundle exec cucumber

  6. Smoke test search engines: Verify that BlendedSearch, SearchElasticEngine, OpenSearch::Engine, and LegacyOpenSearch::Engine still return results for an affiliate using each engine type.

Resolves SRCH-6455

luisgmetzger added 10 commits May 19, 2026 19:06
Extract shared search methods from I14ySearch into DocumentSearchable
concern, rename I14yPostProcessor to DocumentSearchPostProcessor,
rename I14yFormattedQuery to DomainScopedQuery. This prepares for
the full removal of i14y code (SRCH-6455).
Remove all i14y-only models, controllers, views, helpers, observer,
engine, libs, and Cucumber step definitions (SRCH-6455).
Update all files that referenced i14y code: controllers (searches,
API v2, admin affiliates, displays), models (affiliate, site_cloner,
searchgov_url, searchgov_domain), views (nav, display settings, admin
home, content), helpers (6 files), config (routes, constants, observers,
faraday, env cache durations), JavaScript (constants, SpellingSuggestion),
and .env files. Rename i14y SERP template to document (SRCH-6455).
Drop i14y_memberships and i14y_drawers tables, remove
gets_i14y_results and i14y_date_stamp_enabled columns
from affiliates (SRCH-6455).
Delete 17 spec files, 5 fixture files, 3 VCR cassettes, and update
25+ spec files to remove i14y references. Update Cucumber features
(remove i14y scenarios, update SearchGov→SearchElastic), update JS
tests, clean up .rubocop_todo.yml, .simplecov, seeds, and README
(SRCH-6455).
Update show_search_filter_settings_authorized? to use !bing_v7_engine?
since search_gov_engine? is no longer valid. Migrate existing SearchGov
affiliates to SearchElastic. Update data_generator README (SRCH-6455).
The moduleCode lookup builds the key as `web${vertical}` (capitalized),
so vertical='document' needs key 'webDocument', not 'webSRCH'.
Remove i14y_drawers and i14y_memberships tables, gets_i14y_results
and i14y_date_stamp_enabled columns from schema. Bump version to
match migration timestamp so CI doesn't report pending migration.
Replace search_engine: SearchGov with SearchElastic in three
affiliate fixtures (searchgov_affiliate, blended_affiliate,
usagov_affiliate_header_bg_color) and update react_helper_spec.
@YaritzaGarcia YaritzaGarcia self-requested a review May 20, 2026 13:33
Copy link
Copy Markdown
Contributor

@YaritzaGarcia YaritzaGarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that there are two tests failing:

Failed examples:

rspec ./spec/system/click_tracking_spec.rb:26 # A user searches a searchgov site for a best bet the search results have the expected data attributes

rspec ./spec/system/click_tracking_spec.rb:36 # A user searches a searchgov site for a best bet the user clicks a search result js sends in a click event, creating the expected log line.

Comment thread db/migrate/20260520010100_remove_i14y_tables_and_columns.rb Outdated
Comment thread config/routes.rb
The /search/i14y API endpoint is used by external customers and
api.gsa.gov routing. Keep the route and action but backed by
SearchElastic/OpenSearch engines instead of the retired i14y service.
Rename Api::I14ySearchOptions to Api::DocumentSearchOptions.
@luisgmetzger
Copy link
Copy Markdown
Contributor Author

Thanks for catching those @YaritzaGarcia. The click_tracking_spec failures were caused by the searchgov_affiliate fixture still having search_engine: SearchGov after we removed that engine type. Fixed in 8e0d7e5 by updating the fixture to SearchElastic. Should be green now.

luisgmetzger added 2 commits May 20, 2026 10:31
The second tuple element in pick_klass_vertical_template is the
vertical name used in data-vertical HTML attributes and click
tracking. Use :document (matching the template name) instead of
:SRCH (which is the module tag).
Per team review, old SearchGov affiliates should migrate to
open_search (not search_elastic). Update migration, fixtures,
Cucumber features, and specs accordingly.
@selfdanielj selfdanielj self-requested a review May 21, 2026 13:45
luisgmetzger added 2 commits May 21, 2026 11:45
The CI test environment creates a SearchElastic index but not an
OpenSearch search index, so fixtures using OpenSearch cause
index_not_found errors in system specs. Use SearchElastic for test
fixtures while the migration still targets open_search for production.
The original condition included gets_i14y_results and
search_gov_engine?, which were removed. Simplify to !bing_v7_engine?
since all non-Bing engines should show the results format options.
Comment thread app/controllers/searches_controller.rb
@luisgmetzger luisgmetzger requested a review from selfdanielj May 21, 2026 20:50
Copy link
Copy Markdown
Contributor

@selfdanielj selfdanielj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the code and ran locally, trying out searches both web and API and poking around in the admin center. Looks good to me!

@YaritzaGarcia YaritzaGarcia dismissed their stale review May 22, 2026 18:14

It got fixed.

Comment thread app/controllers/api/v2/searches_controller.rb
Comment thread app/controllers/api/v2/searches_controller.rb
@luisgmetzger luisgmetzger merged commit 3dacb54 into GSA:main May 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants