Skip to content

chore(daily-regen): enable auto-merge on auto-polish PRs#5955

Merged
MarkusNeusinger merged 1 commit intomainfrom
claude/auto-polish-auto-merge
May 7, 2026
Merged

chore(daily-regen): enable auto-merge on auto-polish PRs#5955
MarkusNeusinger merged 1 commit intomainfrom
claude/auto-polish-auto-merge

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

  • Auto-polish PRs (e.g. chore(spec): auto-polish area-stacked #5916, chore(spec): auto-polish count-basic #5870, chore(spec): auto-polish bar-horizontal #5860) were sitting open with all required checks green because the polish prompt explicitly forbade auto-merge — they piled up waiting for a human to click merge.
  • Patch the polish prompt to call `gh pr merge --auto --squash --delete-branch` right after `gh pr create`. Auto-merge handles the strict required-status-check rule on `main` by updating the branch automatically when behind.
  • Update the "What you must NOT do" section accordingly (remove "do not auto-merge", keep the `approved` label restriction and the no-`--admin` rule).
  • Rename the workflow step from "opens PR — no auto-merge" to "opens PR with auto-merge" so log titles match behavior.

If `gh pr merge --auto` fails for any reason it falls back to a warning — the PR is still open and can be merged manually.

Test plan

  • Next `daily-regen` cycle produces a polish PR with auto-merge enabled (visible via `gh pr view --json autoMergeRequest`).
  • After CI passes, the PR squash-merges into main without manual intervention.
  • If the polish step finds nothing (`NOOP`), no PR is created (existing behavior).

Copilot AI review requested due to automatic review settings May 7, 2026 19:56
@MarkusNeusinger MarkusNeusinger enabled auto-merge (squash) May 7, 2026 19:57
@MarkusNeusinger MarkusNeusinger merged commit 10cbc22 into main May 7, 2026
8 checks passed
@MarkusNeusinger MarkusNeusinger deleted the claude/auto-polish-auto-merge branch May 7, 2026 19:57
Polish PRs were sitting open with green CI because the prompt
explicitly forbade auto-merge. Switch to `gh pr merge --auto --squash
--delete-branch` so they squash-merge once required checks pass and
the head is in sync with main. Auto-merge handles the strict
status-check policy without needing ADMIN_TOKEN. If enabling
auto-merge fails the PR still exists for manual follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the daily-regen spec-polish automation so that auto-polish PRs enable GitHub auto-merge immediately after creation, reducing manual intervention for PRs that already satisfy required checks.

Changes:

  • Capture the created PR URL in spec-polish-claude.md and run gh pr merge --auto --squash --delete-branch to enable auto-merge.
  • Update the polish PR body text and the “What you must NOT do” rules to allow auto-merge while still forbidding approved labeling and any required-check bypass.
  • Rename the daily-regen workflow step to reflect that it opens PRs with auto-merge.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
prompts/workflow-prompts/spec-polish-claude.md Enables auto-merge for auto-polish PRs and updates the prompt’s guidance accordingly.
.github/workflows/daily-regen.yml Renames the spec polish step to match the new auto-merge behavior.

Comment on lines 71 to +102
@@ -87,10 +87,19 @@ Then open the PR. Use a HEREDOC for the body so multi-line markdown survives:
- No semantic changes (data shape, plot type, requirements identical)
- `updated` bumped to current UTC

Awaiting human review. The skip-gate in `daily-regen` will prevent
additional auto-polish PRs for this spec while this one is open.
Auto-merge enabled — will merge once required checks pass. The
skip-gate in `daily-regen` prevents stacking polish PRs for this spec.
EOF
)"
)")

# Enable auto-merge so the PR squash-merges automatically once required
# checks (Run Linting / Tests / Frontend Tests) go green and the head
# is in sync with main. Auto-merge handles the strict status-check
# policy by updating the branch on our behalf. If auto-merge cannot be
# enabled (e.g. checks already complete and branch is up-to-date), this
# is non-fatal — the PR still exists for human follow-up.
gh pr merge "$PR_URL" --auto --squash --delete-branch || \
echo "::warning::Could not enable auto-merge for $PR_URL — leaving PR open for manual handling"
Comment on lines +99 to +100
# enabled (e.g. checks already complete and branch is up-to-date), this
# is non-fatal — the PR still exists for human follow-up.
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.

2 participants