Skip to content

fix(suspect-commits): Skip commit age filtering for demo/sandbox orgs#110935

Merged
maxkosty merged 1 commit into
masterfrom
demo-no-suspect-commit-age-filter
Mar 17, 2026
Merged

fix(suspect-commits): Skip commit age filtering for demo/sandbox orgs#110935
maxkosty merged 1 commit into
masterfrom
demo-no-suspect-commit-age-filter

Conversation

@maxkosty
Copy link
Copy Markdown
Contributor

@maxkosty maxkosty commented Mar 17, 2026

Goal

Makes sure that Suspect Commit comes up in demo/sandbox without needing to touch the erroring line every 2 months in every one of ~ 20 and counting individual demo apps by always picking the most recent blame commit regardless of its age.

Implementation

doesn't seem like we have any existing constants for demo org ids/slugs
demo-mode is for very specific sandbox hacks (read-only org + sandbox pulls artifacts from demo org)

Testing

none

Related

https://github.com/getsentry/sentry-options-automator/pull/6804


Continuation of #110493 (reopened from getsentry branch instead of fork).

Demo and sandbox orgs use synthetic data where blame commits may fall
outside the 60-day window. Always pick the most recent blame commit
for these orgs so suspect commits still surface.

The org IDs are stored in the `demo-mode.demo-and-sandbox-org-ids`
option so they can be changed at runtime.

Made-with: Cursor
@maxkosty maxkosty requested review from a team as code owners March 17, 2026 22:47
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 17, 2026
Comment thread src/sentry/integrations/utils/commit_context.py
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Redundant option duplicates existing demo-mode.orgs option
    • Removed the redundant demo-org-ids option from defaults.py and updated commit_context.py to use the existing demo-mode.orgs option instead.

Create PR

Or push these changes by commenting:

@cursor push 7468758b13
Preview (7468758b13)
diff --git a/src/sentry/integrations/utils/commit_context.py b/src/sentry/integrations/utils/commit_context.py
--- a/src/sentry/integrations/utils/commit_context.py
+++ b/src/sentry/integrations/utils/commit_context.py
@@ -83,7 +83,7 @@
         extra=extra,
     )
 
-    if organization_id in options.get("demo-org-ids") and file_blames:
+    if organization_id in options.get("demo-mode.orgs") and file_blames:
         selected_blame = max(file_blames, key=lambda blame: blame.commit.committedDate)
         has_too_old_blames = False
         has_too_recent_blames = False

diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py
--- a/src/sentry/options/defaults.py
+++ b/src/sentry/options/defaults.py
@@ -3775,12 +3775,6 @@
     flags=FLAG_AUTOMATOR_MODIFIABLE,
 )
 
-register(
-    "demo-org-ids",
-    default=[],
-    flags=FLAG_AUTOMATOR_MODIFIABLE,
-)
-
 # option for sample size when fetching project tag keys
 register(
     "visibility.tag-key-sample-size",

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread src/sentry/integrations/utils/commit_context.py
@maxkosty maxkosty enabled auto-merge (squash) March 17, 2026 22:59
@maxkosty maxkosty merged commit a9e044e into master Mar 17, 2026
105 of 131 checks passed
@maxkosty maxkosty deleted the demo-no-suspect-commit-age-filter branch March 17, 2026 23:15
JonasBa pushed a commit that referenced this pull request Mar 18, 2026
…#110935)

# Goal

Makes sure that Suspect Commit comes up in demo/sandbox without needing
to touch the erroring line every 2 months in every one of ~ 20 and
counting individual demo apps by always picking the most recent blame
commit regardless of its age.

# Implementation
doesn't seem like we have any existing constants for demo org ids/slugs
`demo-mode` is for very specific sandbox hacks (read-only org +
`sandbox` pulls artifacts from `demo` org)

# Testing 
none

# Related
getsentry/sentry-options-automator#6804

---

Continuation of #110493 (reopened from `getsentry` branch instead of
fork).
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants