Skip to content

feat(seer): Skip night-shift projects that can't open a PR#118386

Merged
trevor-e merged 7 commits into
masterfrom
telkins/night-shift-pr-eligibility
Jun 24, 2026
Merged

feat(seer): Skip night-shift projects that can't open a PR#118386
trevor-e merged 7 commits into
masterfrom
telkins/night-shift-pr-eligibility

Conversation

@trevor-e

@trevor-e trevor-e commented Jun 24, 2026

Copy link
Copy Markdown
Member

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_projects so 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:

  • org-level code generation is on (sentry:enable_seer_coding) — the real runtime gate (the autofix pipeline halts before code changes, and trigger_push_changes raises, without it), and
  • the project's stopping point is open_pr.

Every dropped project logs night_shift.project_filtered.not_pr_producing with stopping_point and enable_seer_coding as extras, so misconfigured projects are observable. The filter runs after the cron tweaks.enabled gate, so logs only cover projects that would otherwise have run.

Notes

  • Test cleanup: extracted a NightShiftFixtures mixin sharing project-eligibility and event-seeding setup, removing the duplicated _make_eligible / _store_event_and_update_group helpers across the night-shift test cases.

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.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 24, 2026
trevor-e added 5 commits June 24, 2026 15:38
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.
@trevor-e

Copy link
Copy Markdown
Member Author

@sentry review

@trevor-e trevor-e marked this pull request as ready for review June 24, 2026 20:01
@trevor-e trevor-e requested a review from a team as a code owner June 24, 2026 20:01
@trevor-e trevor-e merged commit a1665db into master Jun 24, 2026
64 of 65 checks passed
@trevor-e trevor-e deleted the telkins/night-shift-pr-eligibility branch June 24, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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