feat(ci): auto-merge on lgtm label via merge queue - #555
Conversation
When a maintainer applies the `lgtm` label to a PR, a new lifecycle job fires that calls `gh pr merge --auto`, queueing the PR for merge via the merge queue ruleset. Ruleset "main — merge queue" (ID 17513003, already created): - SQUASH strategy, ALLGREEN grouping - required_status_checks: `validate` - bypass: castrojo Workflow changes: - lifecycle-caller: add `pull_request: labeled` trigger + contents:write - lifecycle: add `on-pr-lgtm` job (fires only on lgtm label) - unit-tests: add merge_group trigger so unit tests run in the queue Assisted-by: claude-sonnet-4-5 via pi
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughGitHub Actions workflows are modified to support automated PR merging when labeled with ChangesGitHub Workflow Configuration
Sequence DiagramsequenceDiagram
participant User
participant GitHub as GitHub Events
participant LifecycleCaller as lifecycle-caller
participant Lifecycle as lifecycle (on-pr-lgtm job)
User->>GitHub: Labels PR with lgtm
GitHub->>LifecycleCaller: Trigger on labeled event
LifecycleCaller->>Lifecycle: Queue on-pr-lgtm job
Lifecycle->>Lifecycle: Check for do-not-merge or status/hold
alt Blocked
Lifecycle->>Lifecycle: Skip auto-merge
else Not blocked
Lifecycle->>GitHub: Queue PR for auto-merge
Lifecycle->>GitHub: Remove pr/needs-review label
end
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related Issues
Suggested Labels
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The check required both Assisted-by: and Co-authored-by: Copilot trailers to be paired, but this is too prescriptive — it blocks pi-authored commits and any workflow that doesn't use Copilot. Attribution is a convention, not a gate. Assisted-by: claude-sonnet-4-5 via pi
Do not queue a PR for merge if it carries 'do-not-merge' or 'status/hold'. Checks labels before calling gh pr merge --auto and exits 0 (skips merge) if a blocking label is found. Fixes #560 Assisted-by: claude-sonnet-4-5 via pi
Summary
Closes the gap where
lgtmlabel description promised auto-merge but nothing actually merged the PR.What this does
When a maintainer applies the
lgtmlabel to a PR, the lifecycle workflow now callsgh pr merge --auto, which adds the PR to the merge queue. The merge queue runs the required CI checks on the merged result and squash-merges automatically.Changes
Merge queue ruleset (already created — ID 17513003)
validate(commit format + AI attribution trailer check)Workflows
lifecycle-caller.yml: addpull_request: labeledtrigger +contents: writepermissionlifecycle.yml: addon-pr-lgtmjob that queues the PR whenlgtmis appliedunit-tests.yml: addmerge_group:trigger so unit tests run in the queuePR flow after merge
lgtmlabelgh pr merge --auto→ PR enters merge queuevalidateruns on the merged commitNote on #547
PR #547 already has
lgtmand all checks green — can be manually queued today with:Summary by CodeRabbit