fix(suspect-commits): Skip commit age filtering for demo/sandbox orgs#110935
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Redundant option duplicates existing
demo-mode.orgsoption- Removed the redundant demo-org-ids option from defaults.py and updated commit_context.py to use the existing demo-mode.orgs option instead.
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.
nora-shap
approved these changes
Mar 17, 2026
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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-modeis for very specific sandbox hacks (read-only org +sandboxpulls artifacts fromdemoorg)Testing
none
Related
https://github.com/getsentry/sentry-options-automator/pull/6804
Continuation of #110493 (reopened from
getsentrybranch instead of fork).