Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature flag to disable autocomplete #375

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Add feature flag to disable autocomplete #375

merged 2 commits into from
Jan 10, 2025

Conversation

csutter
Copy link
Contributor

@csutter csutter commented Jan 8, 2025

This adds a feature flag to disable autocomplete in case of unforeseen
problems by returning an empty set of completion results in the
response.

This is controlled by the env var ENABLE_AUTOCOMPLETE, and will allow
us to consolidate the logic behind disabling autocomplete in a single
place instead of having it scattered across several apps (as the
component will not render completions if no results are returned).

Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a suggestion on a flip

By moving the env var to be only needed here we'll also want to change the suggestion in the docs on how this is configured so we don't have a variable of disableSearchAutocomplete anymore - as we won't need a global one - and can instead suggest just adding an env var to the Search API V2 definition.

config/application.rb Outdated Show resolved Hide resolved
This adds a feature flag to disable autocomplete in case of unforeseen
problems by returning an empty set of completion results in the
response.

This is controlled by the env var `ENABLE_AUTOCOMPLETE`, and will allow
us to consolidate the logic behind disabling autocomplete in a single
place instead of having it scattered across several apps (as the
component will not render completions if no results are returned).
Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

Just a couple of small things in the docs.

docs/search_autocomplete.md Show resolved Hide resolved
docs/search_autocomplete.md Outdated Show resolved Hide resolved
@csutter csutter merged commit fb3c858 into main Jan 10, 2025
8 checks passed
@csutter csutter deleted the ac-feat-flag branch January 10, 2025 11:29
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.

2 participants