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 flags endpoint support #524

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

crodriguesbr
Copy link

@crodriguesbr crodriguesbr commented Dec 30, 2024

Why this PR?

  • Adds endpoint filter support for feature flags in .NET 7+ applications
  • Enables declarative feature flag control at the endpoint level
  • Simplifies feature management integration with minimal code

Visible Changes

  • New WithFeatureGate extension method for endpoints
  • Returns 404 when feature is disabled

Example usage:
endpoints.MapGet("/api/feature", () => "Feature Enabled") . WithFeatureGate("MyFeature");

  • Requires .NET 7.0 or greater

@crodriguesbr
Copy link
Author

@microsoft-github-policy-service agree

@zhiyuanliang-ms
Copy link
Contributor

zhiyuanliang-ms commented Jan 3, 2025

@crodriguesbr Thank you for contributing to the feature management repo! This PR is related to #253

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@zhiyuanliang-ms
Copy link
Contributor

Hi, @crodriguesbr

My team have reviewed this PR. We generally agree with the code implementation. This is a new cool feature. Thank you so much for sending out this PR. ❤️

Except for the comment I left, there are still some nits or code style issues about this PR.

We do have linting rules in the .editorconfig file but the rule set is used by all of our C# code base. So we only keep the “greates common divisor`. There are some code style conventions which is specific to this repo. We do want our code bases to be consistent and looks like written by one person.

Would you mind if I take over this PR to address the code style issues? If no, I can left comments for those issues.

@zhiyuanliang-ms
Copy link
Contributor

BTW, could you also update the PR description as the example usage has changed. @crodriguesbr

@zhiyuanliang-ms zhiyuanliang-ms mentioned this pull request Jan 15, 2025
@crodriguesbr
Copy link
Author

BTW, could you also update the PR description as the example usage has changed. @crodriguesbr

Done!

@crodriguesbr
Copy link
Author

Hi, @crodriguesbr

My team have reviewed this PR. We generally agree with the code implementation. This is a new cool feature. Thank you so much for sending out this PR. ❤️

Except for the comment I left, there are still some nits or code style issues about this PR.

We do have linting rules in the .editorconfig file but the rule set is used by all of our C# code base. So we only keep the “greates common divisor`. There are some code style conventions which is specific to this repo. We do want our code bases to be consistent and looks like written by one person.

Would you mind if I take over this PR to address the code style issues? If no, I can left comments for those issues.

Hi, @zhiyuanliang-ms

Thank you for your kind words about this PR! I'm happy your team finds this helpful feature.

Regarding the code style issues, I completely understand the importance of keeping the codebase consistent. I'd prefer to address these issues myself, as it would help me better understand your conventions for future contributions. If you could leave comments outlining the needed changes, I'd happily adjust them.

Looking forward to your feedback!

Best regards,
@crodriguesbr

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