Skip to content

Conversation

@JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Nov 17, 2025

This PR adds a new get_seer_org_acknowledgement_for_scanner function that provides independent control over scanner behavior with respect to AI consent. We were seeing increased volume from scanner after enabling the no_ai_consent flag, and we'd like to roll this increased volume out separately to the in-UI AI changes.

We do this by adding a new option which will allow us to control the rollout rate of scanner separately to the rest of our AI features.

…t rate

- Add `get_seer_org_acknowledgement_for_scanner` function that uses deterministic rollout via `in_rollout_group` instead of random.random()
- Add `seer.scanner_no_consent.rollout_rate` option for controlling scanner rollout
- Update `is_issue_eligible_for_seer_automation` to use new function
- Add comprehensive unit tests for `get_seer_org_acknowledgement_for_scanner`
- Add unit tests for `is_issue_eligible_for_seer_automation`
- Fix duplicate return statements in `has_seer_access_with_detail`

The new function allows independent control of scanner behavior with a
deterministic rollout based on organization ID, separate from the general
Seer acknowledgement logic.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 17, 2025
@JoshFerge JoshFerge marked this pull request as ready for review November 17, 2025 23:10
@JoshFerge JoshFerge requested a review from a team as a code owner November 17, 2025 23:10
@codecov
Copy link

codecov bot commented Nov 17, 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   #103496      +/-   ##
===========================================
- Coverage   80.68%    80.68%   -0.01%     
===========================================
  Files        9246      9246              
  Lines      394964    394968       +4     
  Branches    25182     25182              
===========================================
  Hits       318686    318686              
- Misses      75847     75851       +4     
  Partials      431       431              

Comment on lines 49 to 54
if features.has("organizations:gen-ai-consent-flow-removal", organization) and in_rollout_group(
"seer.scanner_no_consent.rollout_rate", organization.id
):
return True

return False
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can replace w/ return features.has(...) and ...?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, can follow up.

- Simplify get_seer_org_acknowledgement_for_scanner to use a single return statement
- Update all test patches from get_seer_org_acknowledgement to get_seer_org_acknowledgement_for_scanner
- Fix failing tests in test_post_process.py
)

register(
"seer.scanner_no_consent.rollout_rate",
Copy link
Member

Choose a reason for hiding this comment

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

nit but i believe we prefer to use hyphens rather than underscores in options

Copy link
Member Author

Choose a reason for hiding this comment

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

really? i see both in the file.

Copy link
Member

Choose a reason for hiding this comment

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

ah yeah, that's not surprising. kind of a convention that's hard to stick to/enforce. we document it here but i couldn't tell you why 🤷‍♂️

@JoshFerge JoshFerge enabled auto-merge (squash) November 17, 2025 23:33
Copy link
Member

@shashjar shashjar left a comment

Choose a reason for hiding this comment

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

left a nit

@JoshFerge JoshFerge merged commit 167b005 into master Nov 17, 2025
65 checks passed
@JoshFerge JoshFerge deleted the jferg/scanner-option branch November 17, 2025 23:45
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.

4 participants