Skip to content

feat(github): sweep hourly for unnoticed merge conflicts - #197

Merged
justanotherariel merged 4 commits into
mainfrom
justanotherariel-conflict-sweep
Dec 1, 2026
Merged

justanotherariel merged 4 commits into
mainfrom
justanotherariel-conflict-sweep

Conversation

@justanotherariel

Copy link
Copy Markdown
Member

Deployment notes

The first runs label the roughly 330 open core PRs that already conflict, 100 per hour, and draft the ones that are still marked ready for review. Core has no merge-conflict label yet; create it beforehand if it should have a colour and description.

Proposed change

GitHub sends no webhook when a merge to the base branch leaves a PR conflicting, so the merge-conflict check only caught up on the PR's next event of its own.

This adds sweeps (src/github/sweeps/): a sweep returns the items of a repository whose state may have gone stale, and SweepService asks each one on its interval and re-evaluates what comes back on demand. A sweep runs on the repositories that enable one of its rules, at most 100 evaluations per run, and backs off on items an evaluation does not fix.

The first sweep runs hourly and compares every open PR's mergeability with a merge-conflict label, which the merge-conflict rule now sets alongside its dashboard row. That costs one GraphQL point per 100 open PRs. The timers come from a small generic SchedulerService (src/scheduler/).

Type of change

  • Dependency upgrade
  • Bugfix
  • New rule or command
  • New repository manifest (enable the bot on another repo)
  • New feature (which adds functionality to an existing engine)
  • Code quality improvement or refactor (incl. tests)

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass (mise run test). Your PR cannot be merged unless tests pass.
  • Lint and type checks pass (mise run check).
  • The code has been formatted (mise run format).
  • Tests have been added to verify that the new code works.
  • There is no commented out or debug code in this PR.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If behaviour, configuration, or environment variables changed:

  • README.md and .env.example have been updated accordingly.

@justanotherariel
justanotherariel merged commit d68fcef into main Dec 1, 2026
8 checks passed
@justanotherariel
justanotherariel deleted the justanotherariel-conflict-sweep branch December 1, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant