feat(seer): Skip night-shift projects that can't open a PR#118386
Merged
Conversation
Night shift now treats root-cause-only triage results as skips, so its only actionable output is an opened PR. Tighten _get_eligible_projects to drop projects that can't reach that: a project is kept only when org-level code generation (sentry:enable_seer_coding) is on and its stopping point is open_pr. Each dropped project logs night_shift.project_filtered.not_pr_producing with the decision inputs so misconfigured UX is visible. Also extract a NightShiftFixtures test mixin to share project-eligibility and event-seeding setup across the night-shift test cases.
enable_seer_coding is org-scoped, so check it once per org rather than per project. Cron filters it in bulk in _get_eligible_orgs_from_batch (one query per batch, dead orgs never get a task dispatched); the manual path keeps a single guard in run_night_shift_execution. _get_eligible_projects now only applies the per-project open_pr filter.
Drop the enable_seer_coding check from run_night_shift_execution so a manual trigger runs even when org code generation is off. The cron scheduler still bulk-filters those orgs in _get_eligible_orgs_from_batch.
Member
Author
|
@sentry review |
NicoHinderling
approved these changes
Jun 24, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Night shift now treats root-cause-only triage results as skips, so a Seer run's only actionable night-shift output is an opened PR. This tightens
_get_eligible_projectsso projects that can never reach that point are dropped before their issues enter triage — saving triage + autofix compute on work we'd discard.A project is kept only when both hold:
sentry:enable_seer_coding) — the real runtime gate (the autofix pipeline halts before code changes, andtrigger_push_changesraises, without it), andopen_pr.Every dropped project logs
night_shift.project_filtered.not_pr_producingwithstopping_pointandenable_seer_codingas extras, so misconfigured projects are observable. The filter runs after the crontweaks.enabledgate, so logs only cover projects that would otherwise have run.Notes
NightShiftFixturesmixin sharing project-eligibility and event-seeding setup, removing the duplicated_make_eligible/_store_event_and_update_grouphelpers across the night-shift test cases.