ci(lint): run every commit-msg hook on a pull request's commits #368

Merged
Defame1297 merged 2 commits from ci/lint-all-commit-msg-hooks into main 2026-11-25 13:26:46 +00:00
Owner

What and why

Follow-up to #272 (#365); no separate issue.

pre-commit run --all-files runs only the pre-commit stage, so Lint gives each pull request commit's message to commit-msg hooks in a separate step. That step named conventional-pre-commit only, so refuse-agent-trailers ran nowhere in CI. It was skipped unseen by --no-verify, by a clone without scripts/dev-setup.sh, and by a commit made through the forge.

  • lint.yml: the step runs pre-commit run --hook-stage commit-msg with no hook id, so every commit-msg hook in the config runs. The step is renamed from "Check Conventional Commits" to "Check commit messages". Branch protection requires the job, not the step, so the rename changes nothing there.
  • AGENTS.md and docs/contributing/ai-assistance.md: the trailer rule's Held by now says the hook is re-run by the Lint check.

The hooks come from the pull request's own .pre-commit-config.yaml. A pull request that removed a hook would therefore pass its own commits. That file is under CODEOWNERS, so it is held by review, the same as for every other hook.

No changelog fragment: CI and contributor docs only.

Verified

  • I ran the loop's command, pre-commit run --hook-stage commit-msg --commit-msg-filename <f>, locally on three messages. Both hooks ran each time:
    • feat: ok with Assisted-by: Claude Code passed, exit 0.
    • feat: bad with Co-Authored-By: Claude <[email protected]> failed on refuse-agent-trailers, exit 1.
    • not conventional failed on Conventional Commit, exit 1.
  • pre-commit run --all-files passes, including actionlint and zizmor on the changed workflow.
  • ansible-test sanity passed through the pre-push hook.
  • No file refers to the old step name.

Not verified

  • The step in CI itself, until Lint runs on this pull request. This pull request's own commit carries no agent trailer, so it only shows the passing path. The failing path was shown locally only.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Follow-up to #272 (#365); no separate issue. `pre-commit run --all-files` runs only the `pre-commit` stage, so Lint gives each pull request commit's message to `commit-msg` hooks in a separate step. That step named `conventional-pre-commit` only, so `refuse-agent-trailers` ran nowhere in CI. It was skipped unseen by `--no-verify`, by a clone without `scripts/dev-setup.sh`, and by a commit made through the forge. - `lint.yml`: the step runs `pre-commit run --hook-stage commit-msg` with no hook id, so every `commit-msg` hook in the config runs. The step is renamed from "Check Conventional Commits" to "Check commit messages". Branch protection requires the job, not the step, so the rename changes nothing there. - `AGENTS.md` and `docs/contributing/ai-assistance.md`: the trailer rule's *Held by* now says the hook is re-run by the Lint check. The hooks come from the pull request's own `.pre-commit-config.yaml`. A pull request that removed a hook would therefore pass its own commits. That file is under CODEOWNERS, so it is held by review, the same as for every other hook. No changelog fragment: CI and contributor docs only. ## Verified - I ran the loop's command, `pre-commit run --hook-stage commit-msg --commit-msg-filename <f>`, locally on three messages. Both hooks ran each time: - `feat: ok` with `Assisted-by: Claude Code` passed, exit 0. - `feat: bad` with `Co-Authored-By: Claude <[email protected]>` failed on `refuse-agent-trailers`, exit 1. - `not conventional` failed on Conventional Commit, exit 1. - `pre-commit run --all-files` passes, including actionlint and zizmor on the changed workflow. - `ansible-test sanity` passed through the pre-push hook. - No file refers to the old step name. ## Not verified - **The step in CI itself**, until Lint runs on this pull request. This pull request's own commit carries no agent trailer, so it only shows the passing path. The failing path was shown locally only. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added this to the Open to contributors milestone 2026-11-25 11:59:32 +00:00
Defame1297 was assigned by Claude 2026-11-25 11:59:32 +00:00
Claude added 1 commit 2026-11-25 11:59:32 +00:00
ci(lint): run every commit-msg hook on a pull request's commits
Build / build (pull_request) Successful in 44s
Lint / lint (pull_request) Successful in 3m18s
Molecule / molecule (pull_request) Successful in 8s
5f655cbb76
The Lint step gave each commit's message only to conventional-pre-commit,
so refuse-agent-trailers ran nowhere in CI: --no-verify, a clone without
dev-setup.sh or a commit made through the forge passed it unseen. The
step now runs every commit-msg hook, and the trailer rule's held-by
names the Lint check.

Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-11-25 11:59:32 +00:00
Defame1297 added 1 commit 2026-11-25 13:25:23 +00:00
Merge branch 'main' into ci/lint-all-commit-msg-hooks
Build / build (pull_request) Successful in 27s
Molecule / molecule (pull_request) Successful in 4s
Lint / lint (pull_request) Successful in 1m21s
f5d4793d43
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-25 13:25:33 +00:00
Defame1297 approved these changes 2026-11-25 13:25:37 +00:00
Defame1297 merged commit 4a7189c067 into main 2026-11-25 13:26:46 +00:00
Defame1297 deleted branch ci/lint-all-commit-msg-hooks 2026-11-25 13:26:46 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#368