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

fix(flags): Do not search orgs by group_key` #27577

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

haacked
Copy link
Contributor

@haacked haacked commented Jan 16, 2025

When adding a condition to a feature flag, the default property search can also search for groups when "Match by" is set to a group type. This search is defined by a TaxonomicFilterGroup with a searchAlias of group_key.

What this means in practice is rather than searching on a company or project name, it searches on the key, which isn't a very user-friendly thing to search by. It turns out that the default searchAlias for a TaxonomicFilterGroup is search which works very well!

So this PR is hours of work ending in a one-line deletion. It reminds me of the parable of The Old Engineer and the Hammer. 😆

For context, this feature was introduced in #9299 in a20d57a.

Problem

Closes #26825

Changes

Just removed a line where searchAlias is overwritten.

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Manually tested it. Check out the exciting video!

The default `searchAlias` is `search`. This is the search query parameter
we want as it searches orgs by name as opposed to their group_key.

Fixes #26825
@haacked haacked changed the title Do not search orgs by group_key` fix(feat): Do not search orgs by group_key` Jan 16, 2025
@haacked haacked changed the title fix(feat): Do not search orgs by group_key` fix(flags): Do not search orgs by group_key` Jan 16, 2025
Copy link
Contributor

Size Change: 0 B

Total Size: 1.13 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.13 MB

compressed-size-action

@dmarticus
Copy link
Contributor

Nice work! I think this looks fine, your logic is sound, and I'm glad you had a fun learning experience. One comment: have you also tested this on other instances of taxonomic group filters (e.g. insights, etc) on top of simply flags? I can't imagine this would regress that behavior, but it couldn't hurt to be thorough :)

@haacked
Copy link
Contributor Author

haacked commented Jan 16, 2025

have you also tested this on other instances of taxonomic group filters (e.g. insights, etc) on top of simply flags? I can't imagine this would regress that behavior, but it couldn't hurt to be thorough :)

Yup! I sanity tested in a few other places. I went through it again and took some screenshots. Everything works fine.

Screenshot 2025-01-16 at 8 54 49 AM Screenshot 2025-01-16 at 8 54 30 AM Screenshot 2025-01-16 at 8 48 51 AM Screenshot 2025-01-16 at 8 49 31 AM

As far as I can tell, the Release Conditions filter is the only place where we have this specific functionality where we have a "Match by" selector that affects the filter.

Copy link
Contributor

@dmarticus dmarticus left a comment

Choose a reason for hiding this comment

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

nice work, fire away!

@haacked haacked merged commit af2073b into master Jan 16, 2025
103 of 104 checks passed
@haacked haacked deleted the haacked/26825-search-on-name branch January 16, 2025 17:42
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.

Feature Flags on Organizations shows name but searches on ID
2 participants