-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: Add webhook guard for determining when to update/add org contribs #104371
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
base: master
Are you sure you want to change the base?
Conversation
| ENABLE_PR_REVIEW_TEST_GENERATION_DEFAULT, | ||
| ) | ||
|
|
||
| return gen_ai_features or ai_code_review_enabled |
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.
Bug: hide_ai_features option not respected for ai_code_review path
The has_seer_and_ai_features_enabled_for_repo function doesn't check hide_ai_features when evaluating the ai_code_review_enabled path. When an organization sets both sentry:hide_ai_features=True and sentry:enable_pr_review_test_generation=True, the function returns True even though AI features are supposed to be hidden. This contradicts similar logic in _can_use_prevent_ai_features which returns not hide_ai_features and pr_review_test_generation_enabled. The or logic should likely be and with hide_ai_features check, or ai_code_review_enabled needs to include the hide_ai_features check.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #104371 +/- ##
============================================
+ Coverage 65.82% 80.56% +14.74%
============================================
Files 9340 9346 +6
Lines 399248 399696 +448
Branches 25597 25597
============================================
+ Hits 262788 322014 +59226
+ Misses 136007 77229 -58778
Partials 453 453 |
| "organizations:gen-ai-features", organization | ||
| ) and not organization.get_option("sentry:hide_ai_features", HIDE_AI_FEATURES_DEFAULT) | ||
|
|
||
| ai_code_review_enabled = organization.get_option( |
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.
We can skip this toggle check for the value of the sentry:enable_pr_review_test_generation organization option for the purposes of billing here.
We're going to keep the toggle around only for legacy seer usage based plan people so they have a way to turn on/off code review until they purchase the seat based plan. They will get code review for free if they turn this toggle on. (slack convo).
The value of the option is no longer relevant for any orgs outside of above
Creates a helper function that gets instrumented in the webhook handler after we create a pull request, adding a couple RPCs to fetch seer enabled information as well as repo and setting information (lives in 4 different places). Might also need to add seer add-on enabled billing check potentially if that's a separate thing as well.
Also adds another metric so we can see how often we're entering the condition (and if at all)
Closes https://linear.app/getsentry/issue/ENG-5931/create-guard-for-webhook-logic
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.