docs(stack): record what a stack push rebases away in the skill#1724
Conversation
Merge Protections🔴 3 of 7 protections blocking · waiting on 👀 reviews and ⛓️ dependency
🔴 ⛓️ Depends-On RequirementsWaiting for
This rule is failing.Requirement based on the presence of
🔴 👀 Review RequirementsWaiting for
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
Show 4 satisfied protections🟢 🤖 Continuous Integration
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
Pull request overview
Updates the mergify-stack agent skill documentation to capture rebase-related hazards and operational conventions directly at the point where agents run mergify stack commands, with added guidance on notes, Change-Ids, PR body syncing, and interpreting CI status.
Changes:
- Expanded guidance on amend notes, Change-Id targeting, and when/why to use
stack push --skip-rebase. - Clarified stack-managed PR title/body syncing behavior and draft-PR CI implications.
- Added a “Reading CI status” section and strengthened conflict-resolution guidance.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9048f25 to
92e9144
Compare
Revision history
|
jd
left a comment
There was a problem hiding this comment.
Amend notes / Amend Notes: a note is keyed to the commit SHA, so a rebasing
push orphans it with a blank Reason. Push with --skip-rebase to pin the SHA
so the note lands, and keep the durable "why" in the commit message body.
Is that something that should be fixed in the code rather than in the workflow?
92e9144 to
8896d57
Compare
|
This pull request is part of a Mergify stack:
|
8896d57 to
cee6930
Compare
A note is addressed by commit SHA, so every rewrite stranded it. The rebase `stack push` runs before it reads notes back left the reason on the pre-rebase SHA, and the revision history recorded a blank `Reason`; a plain `git commit --amend` lost it the same way. `stack setup` now adds a local `notes.rewriteRef`, which is what covers the rewrites git runs on its own — `git commit --amend`, and the `git rebase --continue` that finishes a conflicted rebase. The CLI's own rebases pass the same settings with `-c` so they stay correct in checkouts whose config predates this, and so a global `notes.rewriteMode=ignore` cannot disable the copy. Existing checkouts pick the config up on their next `mergify stack setup`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Change-Id: I0e5503e0eeddcc02c689eb78581b8c211b2dd741
At a conflict the pick being replayed has not produced a commit yet, so HEAD is the last commit the rebase applied — the trunk tip when the bottom commit conflicted, otherwise an earlier commit of the stack. `git commit --amend` there rewrites that commit and stamps the work with its message and Change-Id, mapping it to the wrong pull request. The commit-msg hook now refuses it. A `stack edit` pause records its target in `rebase-merge/amend` and stays allowed, the sequencer's own commit during `git rebase --continue` never reaches this hook, and `--no-verify` overrides. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Change-Id: Ia59c6db0b1f8e729ea2142f00c1c56db94dd51d5
Fold the rebase-hazard knowledge that was drafted into a consuming repo's AGENTS.md into the mergify-stack skill, where it travels with the CLI and surfaces at the point an agent runs the commands. Woven into the adjacent conventions rather than bolted on, and generalized (config-dependent behavior stated conditionally) since the skill is repo-agnostic. - Amend notes: a note rides along with its commit through amends and rebases, so attaching it once is enough. - Mid-stack fixes / Conflict Resolution: amend only at a `stack edit` pause (clean tree, git tells you to), with `git commit --amend --no-edit` so the message — and its Change-Id — stays verbatim; the commit-msg hook only inserts a Change-Id when one is missing, so it won't rewrite yours. At a rebase *conflict* pause the pick hasn't produced a commit yet and HEAD is the last-applied commit, so `git commit --amend` re-maps your work to the wrong PR's Change-Id — the commit-msg hook refuses it, and the resolve path is `git add` + `git rebase --continue`. - Target notes and `stack edit` by Change-Id, not SHA — it maps a commit to its PR and survives every rebase. Both forms are accepted, and they diverge once a SHA is stale: `stack edit` matches against the commits in the stack and fails loudly, while `stack note` resolves any revision and silently attaches to a commit no push will read. - PR title & body: unless `mergify-cli.stack-keep-pr-title-body` is set, every push re-syncs bodies from commit messages, and a reword at the bottom of a stack re-syncs every PR above it — so hand-edits don't stick. - New "Reading CI status" section: `gh pr checks` exit codes (0 pass, 8 pending; non-zero is not always a CI failure — 1 is also gh's generic error, 4 is auth), the stale `stack list` CI column, and CANCELLED rollup entries being superseded-run history, not failures. - Draft PRs: a stacked draft may get no CI at all, so a wall of `skipping` is "never ran", not "green". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Change-Id: If60237ab0912ee50f65b2a3571047d5b343eb94e
baa7a73 to
b361ce0
Compare
cee6930 to
21fee1a
Compare
b361ce0 to
8f8fc68
Compare
Fold the rebase-hazard knowledge that was drafted into a consuming repo's
AGENTS.md into the mergify-stack skill, where it travels with the CLI and
surfaces at the point an agent runs the commands. Woven into the adjacent
conventions rather than bolted on, and generalized (config-dependent behavior
stated conditionally) since the skill is repo-agnostic.
so attaching it once is enough.
stack editpause(clean tree, git tells you to), with
git commit --amend --no-editso themessage — and its Change-Id — stays verbatim; the commit-msg hook only inserts
a Change-Id when one is missing, so it won't rewrite yours. At a rebase
conflict pause the pick hasn't produced a commit yet and HEAD is the
last-applied commit, so
git commit --amendre-maps your work to the wrongPR's Change-Id — the commit-msg hook refuses it, and the resolve path is
git add+git rebase --continue.stack editby Change-Id, not SHA — it maps a commit to itsPR and survives every rebase. Both forms are accepted, and they diverge once a
SHA is stale:
stack editmatches against the commits in the stack and failsloudly, while
stack noteresolves any revision and silently attaches to acommit no push will read.
mergify-cli.stack-keep-pr-title-bodyis set, everypush re-syncs bodies from commit messages, and a reword at the bottom of a
stack re-syncs every PR above it — so hand-edits don't stick.
gh pr checksexit codes (0 pass, 8 pending;non-zero is not always a CI failure — 1 is also gh's generic error, 4 is auth),
the stale
stack listCI column, and CANCELLED rollup entries beingsuperseded-run history, not failures.
skippingis"never ran", not "green".
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Depends-On: #1730