Skip to content

feat(reusable-burndown): add rebase-stale job — auto-fix conflicting bot PRs#303

Merged
jdfalk merged 1 commit into
mainfrom
feat/burndown-rebase-stale-prs
Jun 9, 2026
Merged

feat(reusable-burndown): add rebase-stale job — auto-fix conflicting bot PRs#303
jdfalk merged 1 commit into
mainfrom
feat/burndown-rebase-stale-prs

Conversation

@jdfalk

@jdfalk jdfalk commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • New rebase-stale job runs in parallel with preflight at the start of every burndown run
  • Finds all open automation-labeled PRs where mergeable == CONFLICTING
  • Rebases each onto main and force-pushes
  • If unresolvable: labels status:conflict-unresolvable + posts a comment to close/re-dispatch
  • triage now needs: [preflight, rebase-stale] so new dispatch always sees a clean base
  • continue-on-error: true on the rebase step ensures unexpected git errors never block new task dispatch

Why

Bot PRs were piling up as CONFLICTING with no automatic recovery. The only option was manual rebase or abandoning the PR. This makes conflict resolution fully automatic.

Security notes

  • Branch names come from gh pr list output (bot-created refs), not user-controlled ${{ github.event.* }} expressions — no injection vector
  • Uses the existing burndown-bot GitHub App token (already scoped for push)
  • --force push is safe: bot is the only committer to these auto/*/draft/* branches

Test plan

  • Trigger a manual burndown run with a CONFLICTING PR open — verify it gets rebased
  • Introduce a real conflict in a bot branch — verify status:conflict-unresolvable label appears

🤖 Generated with Claude Code

… bot PRs

New `rebase-stale` job runs at the start of every burndown run (in parallel
with preflight). It finds all open `automation`-labeled PRs where GitHub
reports mergeable=CONFLICTING, rebases each onto main, and force-pushes.

If a rebase has unresolvable conflicts the PR gets labeled
`status:conflict-unresolvable` and a comment instructs closing + re-dispatch.

`triage` now waits for both `preflight` and `rebase-stale` so new dispatches
always land on a clean base. A `continue-on-error` guard on the rebase step
ensures unexpected git errors never block new task dispatch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jdfalk jdfalk added the gcommon label Jun 9, 2026
@jdfalk jdfalk merged commit c3dac07 into main Jun 9, 2026
6 of 12 checks passed
@jdfalk jdfalk deleted the feat/burndown-rebase-stale-prs branch June 9, 2026 19:29
@github-actions github-actions Bot added size/M github-actions GitHub Actions related work module:config Configuration management workflow:github-actions GitHub Actions workflows labels Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gcommon github-actions GitHub Actions related work module:config Configuration management size/M workflow:github-actions GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant