Skip to content

Commit de5360b

Browse files
committed
fix check run billing gate
1 parent 1a69e22 commit de5360b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

fixtures/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3560,7 +3560,7 @@
35603560
"external_id": "4663713",
35613561
"html_url": "https://github.com/test/repo/runs/4"
35623562
},
3563-
"user": {
3563+
"sender": {
35643564
"id": 12345678,
35653565
"login": "test-user"
35663566
}
@@ -3574,7 +3574,7 @@
35743574
"full_name": "getsentry/sentry",
35753575
"html_url": "https://github.com/getsentry/sentry"
35763576
},
3577-
"user": {
3577+
"sender": {
35783578
"id": 12345678,
35793579
"login": "test-user"
35803580
}

src/sentry/seer/code_review/preflight.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from sentry.models.repository import Repository
1010
from sentry.models.repositorysettings import CodeReviewSettings, RepositorySettings
1111

12-
from .billing import passes_code_review_billing_check
13-
1412
DenialReason = str | None
1513

1614

@@ -91,6 +89,10 @@ def _check_repo_feature_enablement(self) -> DenialReason:
9189
return "repo_code_review_disabled"
9290

9391
def _check_billing(self) -> DenialReason:
92+
return None
93+
94+
# TODO: Once we're ready to actually gate billing (when it's time for GA), uncomment this
95+
"""
9496
if self.integration_id is None or self.pr_author_external_id is None:
9597
return "billing_missing_contributor_info"
9698
@@ -103,6 +105,7 @@ def _check_billing(self) -> DenialReason:
103105
return "billing_quota_exceeded"
104106
105107
return None
108+
"""
106109

107110
# -------------------------------------------------------------------------
108111
# Org type helpers

src/sentry/seer/code_review/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,8 @@ def get_pr_author_id(event: Mapping[str, Any]) -> str | None:
220220
if (user_id := event.get("user", {}).get("id")) is not None:
221221
return str(user_id)
222222

223+
# Check sender.id (for check_run events). Sender is the user who triggered the event
224+
if (user_id := event.get("sender", {}).get("id")) is not None:
225+
return str(user_id)
226+
223227
return None

0 commit comments

Comments
 (0)