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

Improves Attribute filtering by project #2226

Merged
merged 13 commits into from Mar 26, 2024

Conversation

mknowlton89
Copy link
Collaborator

@mknowlton89 mknowlton89 commented Mar 13, 2024

Features and Changes

With the recently introduced feature of project-scoping attributes, we weren't properly filtering the list of attributes all the way in a few different places, based on the resource's project.

Ex:
For a feature that is in project A, when creating a rule, we should automatically filter the list of attributes to only attributes available to Project A (which would be any attribute in project A, or any attribute in "All Projects".

Previously, we were filtering based on a user's readAccess, but not also by project.

Testing

  • Attempt to add a rule (experiment, force, and rollout) to a feature that is a part of "All Projects" and ensure that every non-archived attributes is available in the dropdown.
  • Now, do the same, but for a feature in "Project A" and ensure that only attributes associated with Project A are available in the dropdown. (Attributes associated with project A are either attributes that have "Project A" in it's projects list, or attributes that are a part of "All Projects").
  • Now, select "All Projects" on the sidenav, and attempt to create a new experiment, ensure that the list of attributes available in the dropdown is the entire list of non-archived attributes.
  • Now, switch to "Project A" on the sidenav, and attempt to create a new experiment, ensure that the list of attributes is only those that are associated with Project A, or in all projects (and are not archived).
  • Now, select "All Projects" on the sidenav, and go to create a new Saved Group - ensure that the list of attributes available in the dropdown is the entire list of non-archived attributes.
  • Now, switch to "Project A" on the sidenav, and attempt to create a Saved Group, ensure that the list of attributes is only those that are associated with Project A, or in all projects (and are not archived).
  • Ensure that no new regressions where introduced around no_access roles, as a result of these changes

@mknowlton89 mknowlton89 self-assigned this Mar 13, 2024
@mknowlton89 mknowlton89 marked this pull request as ready for review March 13, 2024 18:05
Copy link

github-actions bot commented Mar 13, 2024

Your preview environment pr-2226-bttf has been deployed.

Preview environment endpoints are available at:

@jdorn
Copy link
Member

jdorn commented Mar 13, 2024

Saved groups are not project-scoped right now.

Also, should add to your list of tests to make sure editing an existing rule that references an out-of-project attribute continues to work. It may switch them to advanced mode, which is fine, as long as it's still editable.

@mknowlton89
Copy link
Collaborator Author

Saved groups are not project-scoped right now.

Also, should add to your list of tests to make sure editing an existing rule that references an out-of-project attribute continues to work. It may switch them to advanced mode, which is fine, as long as it's still editable.

Great suggestion. I've removed the filtering from saved groups until we add project scoping to saved groups. I also updated the rule modal so if a user is editing an existing rule that references an attribute no longer associated with the feature's project, it automatically switches to advanced mode. Previously, it was displaying an empty SelectField since the SelectField component was trying to select the option via value, but it was not able to find a match, so it just rendered the empty state.

@mknowlton89 mknowlton89 requested a review from jdorn March 18, 2024 12:58
@mknowlton89 mknowlton89 requested a review from jdorn March 25, 2024 19:16
@mknowlton89 mknowlton89 merged commit 16b50bd into main Mar 26, 2024
3 checks passed
@mknowlton89 mknowlton89 deleted the mk/filter-attributes-by-feature-projects branch March 26, 2024 17:13
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.

None yet

2 participants