-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(ai): Check gen-ai feature flag before org-level flags in Prevent AI #103386
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
Merged
JoshFerge
merged 2 commits into
master
from
joshferge/aiml-1596-check-gen-ai-feature-flag-before-org-flag-in-seer-rpc
Nov 14, 2025
Merged
feat(ai): Check gen-ai feature flag before org-level flags in Prevent AI #103386
JoshFerge
merged 2 commits into
master
from
joshferge/aiml-1596-check-gen-ai-feature-flag-before-org-flag-in-seer-rpc
Nov 14, 2025
+114
−35
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Align `_can_use_prevent_ai_features` with other AI features by checking the `organizations:gen-ai-features` flag first before evaluating org-level settings. This ensures the global feature gate is respected consistently across all gen-ai feature checks. Changes: - Updated `_can_use_prevent_ai_features` in seer_rpc.py to check feature flag first - Updated duplicate function in overwatch_rpc.py with same fix - Added 4 new tests to verify feature flag checking behavior - Updated 4 existing tests to enable feature flag where needed This provides a consistent way to globally control gen-ai features at the feature flag level, matching the pattern used by other AI features like autofix and issue summaries.
Member
Author
|
this PR was drafted via claude code with the prompt:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #103386 +/- ##
===========================================
- Coverage 80.68% 80.60% -0.08%
===========================================
Files 9237 9240 +3
Lines 394583 395353 +770
Branches 25146 25146
===========================================
+ Hits 318351 318683 +332
- Misses 75785 76223 +438
Partials 447 447 |
The endpoint was updated to check for the organizations:gen-ai-features feature flag before checking org-level consent options. The tests need to enable this feature flag for organizations to have consent granted.
JoshFerge
commented
Nov 14, 2025
| return {"projects": projects} | ||
|
|
||
|
|
||
| def _can_use_prevent_ai_features(org: Organization) -> bool: |
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems not ideal that there are two copies of this function, can follow up on this
kddubey
approved these changes
Nov 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes AIML-1596
Aligns
_can_use_prevent_ai_featureswith other AI features by checking theorganizations:gen-ai-featuresflag before evaluating org-level settings. This ensures the global feature gate is respected consistently across all gen-ai feature checks.