Skip to content

ci: a behavior-change gate: every PR says if it changes behavior for callers - #208

Merged
groupsky merged 2 commits into
mainfrom
hq-job/nodkey-release-ci-1/r-20261117-203018-cc7d
Nov 17, 2026
Merged

groupsky merged 2 commits into
mainfrom
hq-job/nodkey-release-ci-1/r-20261117-203018-cc7d

Conversation

@groupsky

@groupsky groupsky commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Fixes #197

0.6.0 changed a default that callers depend on (#171), and the release notes listed it as a plain feature (#191). This pull request adds a gate, so that such a change is visible:

  • .github/pull_request_template.md with the line Changes behavior for existing callers: yes or no (the placeholder fails until the author answers).
  • tools/prgate: the check. It runs as more steps of the job Conventional Commits title in pr-title.yml, so it is already a required check. It fails when:
    • the line is missing, is there more than once, or has another value;
    • the answer is yes and the title has no !;
    • the answer is yes and the PR adds no ## Updating from X section to docs/updating.md;
    • the answer is no and the title has a ! (one more rule, so the two cannot disagree);
    • the PR changes, removes or moves a file under test/contract/ and the answer is no. A new *_test.go file right in test/contract/ and a change to its README.md do not count: a new test pins behavior that callers already have. (As first written, the rule would have made test: contract tests for how callers use nodkey run (pipe, parent process, signals, exit codes, fds) #198's PR, which only adds tests of today's behavior, say yes and add !.) Any other new file there counts, such as a go.mod or a file in testdata/.
  • Two kinds of PRs need no line: the release PR of release-please (App author, its branch, only CHANGELOG.md and the manifest), and a Dependabot PR with no ! that changes only dependency files.
  • docs/updating.md, starting with the feat(run): mask fetched values by default; --no-mask turns it off #171 section ("Updating from 0.5.0 or older"). docs/setup.md (section 13) links to it.
  • docs/releasing.md: the gate, and "⚠ BREAKING CHANGES". The squash commit keeps the !: the repository setting uses the PR title as the squash commit message (checked 2026-11-17).

One point beyond the issue

The issue says the check reads only the title, the body and the changed file names. To know that the PR adds an "Updating from X" section, the check also reads the diff of docs/updating.md (only that file), as text from the GitHub API. It never runs or prints it. The workflow checks out and runs only main (github.sha of pull_request_target), never code of the PR. It never prints PR text to the log.

Note: pull_request_target runs the workflow of main, so the gate does not run on this PR. It starts with the next PR after the merge.

Behavior for callers

Changes behavior for existing callers: no

Tests

  • tools/prgate/main_test.go: a test for each fail case, the pass cases, the bot exemptions and attempts to fake them, the template, the headings of docs/updating.md, and the exit codes.
  • go test -race ./..., go vet ./..., golangci-lint run --build-tags e2e, actionlint on pr-title.yml.
  • Security review (.claude/agents/security-reviewer.md): no critical, high or medium finding. Its four low findings are fixed (only the diff of docs/updating.md is kept, a tighter Dependabot exemption, no link to a missing file, only gh gets the token). A second round on the contract rule found one low point (a new non-test file could change the tests); fixed.

Progress

🤖 Generated with Claude Code

groupsky and others added 2 commits November 17, 2026 20:39
…callers

Fixes #197

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@groupsky
groupsky marked this pull request as ready for review November 17, 2026 18:46
@groupsky
groupsky merged commit 61d3e59 into main Nov 17, 2026
8 of 9 checks passed
@groupsky
groupsky deleted the hq-job/nodkey-release-ci-1/r-20261117-203018-cc7d branch November 17, 2026 18:46
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.

ci: a behavior-change gate: every PR says if it changes behavior for callers; yes needs '!' and an update note

1 participant