Skip to content

A Squash Merge Drops a Pull Request Body's Closing Keywords, So Promotion Closes Nothing #1297

Closed as not planned

Description

@ptr727

Filed from ptr727/HomeAutomation-Config, where three issues shipped with their fixes and would have stayed open. The mechanism affects every fleet repository running the develop -> main promotion model with squashed feature merges, which is why it is filed here. Tracked downstream as ptr727/HomeAutomation-Config#155.

The mechanism

Two rules compose into a silent failure, and each is correct on its own.

  1. GitHub acts on a closing keyword only when a pull request merges into the default branch. On the promotion model the default branch is main, so a feature pull request merging into develop correctly closes nothing, and the keyword is expected to fire later at promotion.
  2. A squash merge composes its commit message from the pull request title and the list of squashed commit subjects. It does not carry the pull request body.

So a keyword written in a feature pull request's body is discarded at the feature merge, well before the promotion that was supposed to act on it. Nothing in the promoted history carries it, and the issue stays open with its fix shipped.

A keyword written in a commit message survives the squash and does fire at promotion. The two placements therefore behave completely differently while looking identical to an author, and the documentation does not distinguish them.

Measured

On one release of thirteen feature pull requests: ten carried the keyword in a commit message and closed automatically at promotion. Three carried it only in the pull request body and closed only because the promotion pull request happened to restate every issue by hand.

Why it is worth a rule

The failure is silent and it fails in the safe-looking direction. An issue still open after its fix has shipped reads as ordinary backlog, and the person most likely to notice is whoever filed it, months later. No gate can see it, because nothing is wrong with the tree.

It is also worst exactly where it is least visible. Issues close in a single burst at promotion, so one missing keyword sits among a dozen that worked.

Options

  1. The promotion pull request restates every issue its range closes, derived from the feature pull requests rather than from the commits. Reliable, and a step somebody has to remember.
  2. Closing keywords belong in a commit message, never only in a pull request body. Puts the burden on the feature author, who has the context, and it survives the squash without anyone reasoning about promotion.
  3. Derive it mechanically. Compare the issues referenced by the feature pull requests in a promoted range against the closing keywords present in that range's commit messages, and report the difference. Turns a remembered step into a check, and would fit alongside the existing hub-hosted review tooling.

Options 2 and 3 compose, and 2 alone is nearly free.

GOVERNANCE.md "Branching Model" and WORKFLOW.md are the surfaces this binds, and the operational-vs-release-workflow skill is where an agent would encounter it at the moment it chooses a target branch or opens a promotion.

Activity

  1. added
    prose
    duplicate
    on Sep 5, 2026
  2. ptr727 commented on Sep 9, 2026

    @ptr727
    OwnerAuthor

    Duplicate of #1471. Neither this issue nor #1265 contained the other, so #1471 states the whole mechanism once: this issue's squash-drop and the body-versus-commit-message distinction, plus #1265's separate finding that a closing keyword fires even inside a sentence that negates it.

    Detail this issue held that #1471 did not has been carried forward there as a comment, so nothing is lost. Follow #1471 for the work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateprose

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions