Skip to content

Conversation

@JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Nov 14, 2025

Fixes AIML-1596

Aligns _can_use_prevent_ai_features with other AI features by checking the organizations:gen-ai-features flag before evaluating org-level settings. This ensures the global feature gate is respected consistently across all gen-ai feature checks.

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.
@JoshFerge JoshFerge requested review from a team as code owners November 14, 2025 18:09
@linear
Copy link

linear bot commented Nov 14, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 14, 2025
@JoshFerge
Copy link
Member Author

this PR was drafted via claude code with the prompt:

can we work on AIML-1596

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

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.
return {"projects": projects}


def _can_use_prevent_ai_features(org: Organization) -> bool:
Copy link
Member Author

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

@JoshFerge JoshFerge enabled auto-merge (squash) November 14, 2025 21:11
@JoshFerge JoshFerge merged commit 0149e9e into master Nov 14, 2025
67 checks passed
@JoshFerge JoshFerge deleted the joshferge/aiml-1596-check-gen-ai-feature-flag-before-org-flag-in-seer-rpc branch November 14, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants