🏗️✨:land a pull request as one good commit - #1814
Merged
Merged
Conversation
The half-step before a commit queue: the message building, under test and in version control, still driven by hand. `nps land <number>` squashes a pull request into one commit whose message is composed from the commits it contains -- every message kept whole, the trailers gathered into the paragraph git reads, and `PR-URL` added -- then holds that message to the same rules a commit answers to before merging. It earned its keep already: it refused twice while landing the last nine pull requests, once for an over-wide line and once for a `Fixes:` left stranded where git would not have read it. The composing lives apart from the rules on purpose. Keeping every commit's words and gathering its trailers is the same job whatever house style a repository writes subjects in, and the repositories in this organization do not agree on that yet. Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is> Assisted-by: Claude-Code:claude-opus-5
✅ Deploy Preview for gh-pages-openinf ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Comment on lines
+33
to
+34
| const [subject = '', ...rest] = message | ||
| .replace(/[\r\n]+$/, '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The half-step: the message building, under test and in version control, still driven by hand. No credential, no workflow, no label — those wait until the org's commit styles settle.
What it does
nps land <number>squashes a pull request into one commit whose message it composes itself, rather than letting the GitHub interface take the pull request body or nothing at all:PR-URLis added, and aRefs:duplicating aFixes:for the same issue is dropped.Then it validates that message and refuses to merge if it fails.
nps "land <number> --dry-run"prints it without landing.It has already earned its keep
This is the script that landed the last nine pull requests, and it refused twice while doing it: once for a 73-character body line, once for a
Fixes:left stranded mid-body where git would not have read it. Both were real, and both would have landed otherwise.Built for an organization that has not decided yet
You said you are unsure what the commit style across the repos will be, so the seam is explicit.
build/shared/landing.mtsknows nothing about what a subject looks like — composing a landed message is the same job whether a repository writesfeat:or🏗️🔧:. Only the caller supplies the rules.That matters because the styles genuinely differ today. Running this repository's validator over real subjects from five OpenINF repos:
So when this is extracted, the composing goes as-is and the subject rule becomes configuration. Nothing here has to be rewritten to make that true.
Verification
git interpret-trailers --parsereads exactly the trailers intendednps test— 16/16 tasks, 56/56 testsTwo defects found while writing this, both by the pipeline rather than by me:
tsccaught a comparison againstdrafttyped as a string when it is a boolean, and a closed pull request used to spin for twenty seconds before throwing, because it reportsmergeable_state: unknownfor ever.Note
Not included, deliberately: the credential, the
commit-queuelabel, and the workflow. Those are Phase 3, and the multi-repo requirement changes their shape — an App rather than a personal token, a reusable workflow inOpenINF/.github, and the rules published as a package. None of it is worth building until the subject style question is settled, and none of it is blocked by this landing here first.