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

feat: implement apply, update, and delete feature flag #10189

Merged

Conversation

nickoferrall
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the size/m label Sep 6, 2024
"""
The deleted feature flag
"""
featureFlag: FeatureFlagNew!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once I remove the existing FeatureFlag, I'll change this from FeatureFlagNew to FeatureFlag

@nickoferrall
Copy link
Contributor Author

Hey @Dschoordsch, would you mind giving this a light PR review to double check it's on the right track?

In the next PR, I'll use these mutations and types and refactor the code in the application. In that PR, I'll clean this up, pass the tests, and request a more thorough review.

Copy link
Contributor

@Dschoordsch Dschoordsch left a comment

Choose a reason for hiding this comment

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

There is some inconsistency whether the feature flag is just a string or an enum in the mutations.

"""
The name of the feature flag to apply
"""
flagName: String!
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 Shouldn't this be also an enum like in DeleteFeatureFlagSucces?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DeleteFeatureFlagSuccess returns the type featureFlag: FeatureFlagNew! (after the refactor it'll be FeatureFlag instead of FeatureFlagNew), which is the FeatureFlag object, not an enum

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, missed this type because I only checked this PR. All good then.

"""
Delete an existing feature flag
"""
deleteFeatureFlag(
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 I'm not sure what this mutation is supposed to do. Does it remove the feature flag from all subjects or does it delete the entry from the feature flag table? What happens to the static types in this case?
I think we probably don't need static types for feature flags but rather a field on Org, Team and User: hasFeatureFlag(flagName: String!): Boolean!. But make sure first that this actually would work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It removes the flag from the featureFlag table.

It's not strictly necessary as we can just update the expiry date of the flag so that it no longer applies.

I thought it'd be helpful to include so that we can clean up flag names in the db that we're no longer using, but I can remove this if it's confusing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's fine then. It will also remove it from all owners. Maybe update the description to match it?

@nickoferrall nickoferrall requested review from Dschoordsch and removed request for Dschoordsch September 9, 2024 15:43
"""
Delete an existing feature flag
"""
deleteFeatureFlag(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's fine then. It will also remove it from all owners. Maybe update the description to match it?

@nickoferrall nickoferrall marked this pull request as ready for review October 4, 2024 15:09
@nickoferrall nickoferrall merged commit 114fe0f into feat/refactor-feature-flag Oct 4, 2024
8 checks passed
@nickoferrall nickoferrall deleted the feat/apply-new-feature-flag-mutation branch October 4, 2024 15:09
@github-actions github-actions bot added size/xl and removed size/m labels Oct 4, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR will be delayed and might be rejected due to its size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants