Skip to content

inbox: a refused merge says why, and stays on screen - #6

Merged
will-lamerton merged 1 commit into
mainfrom
merge-says-why
Oct 4, 2026
Merged

will-lamerton merged 1 commit into
mainfrom
merge-says-why

Conversation

@will-lamerton

Copy link
Copy Markdown
Member

What this changes

Merging playpip/pip-web#186 from the portal showed "merging…", then the button came back and the PR stayed open. No error appeared.

GitHub refused the merge because the required gate check was still running. The refusal did reach the page, but failed() in views/inbox.js wrote the error and then called busy(false), which cleared the status line, so the message never showed.

  • failed() now clears the status line before writing the error.
  • A refused gh pr merge now reads the PR's merge state and checks, and says why in plain words:
    • "Not merged: checks are still running (gate). Merge again once they pass."
    • "Not merged: checks failed (gate)."
    • For a branch-rules block, a branch that's behind its base, or a conflict, it says which.
    • Anything else shows gh's own first line, without its --auto/--admin advice.

Type of change

  • fix bug fix

Testing

Automated: test/act.test.ts covers the four messages, using gh's real output for a blocked PR. A new portal test checks that a refused merge leaves its reason on screen with the button enabled again. I put the old failed() back and confirmed that test fails.

Manual: pip-web#186 is BLOCKED, with required check gate in progress, which matches the first message.

Checklist

  • pnpm test:all passes (533)
  • Tests cover the change, and I broke one deliberately to check it fails
  • No generated file was edited in a tenant instead of in templates/

Breaking changes

None. The portal ships with the CLI, so this reaches tenants with the npm release, not through roster upgrade.

🤖 Generated with Claude Code

Merging pip-web#186 from the portal showed "merging…" and then nothing:
the button came back and the PR stayed open. GitHub had refused it
because the required `gate` check was still running, and the portal's
error handler cleared the status line in the same call that wrote the
error, so the refusal was never seen.

- The status line is cleared before the error is written, not after.
- A refused merge reads the PR's checks and says which are running or
  failed, or that the branch rules want something else, instead of gh's
  "the base branch policy prohibits the merge" and its flag advice.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying roster with  Cloudflare Pages  Cloudflare Pages

Latest commit: 365a8c9
Status: ✅  Deploy successful!
Preview URL: https://d0613af1.roster-7ih.pages.dev
Branch Preview URL: https://merge-says-why.roster-7ih.pages.dev

View logs

@will-lamerton
will-lamerton merged commit 91604e0 into main Oct 4, 2026
9 of 12 checks passed
@will-lamerton
will-lamerton deleted the merge-says-why branch October 4, 2026 13:22
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