Skip to content

ci(commit_checks): measure squash subjects without the PR number - #33

Merged
mrpollo merged 1 commit into
Dronecode:mainfrom
TSC21:ci/squash-subjects
Oct 28, 2026
Merged

mrpollo merged 1 commit into
Dronecode:mainfrom
TSC21:ci/squash-subjects

Conversation

@TSC21

@TSC21 TSC21 commented Oct 28, 2026

Copy link
Copy Markdown
Member

A squash merge on GitHub turns the pull request title into the commit subject and appends " (#)". The title check measures the title alone, so a title of 67 to 72 characters lands on main as a subject of 73 to 78, and every later pull request whose range holds that commit fails Commit subjects on a subject nobody can change. #24's 6080624 is 76 characters: a fork's sync branch that brings main's history fails on it today, and release_commit_checks.py would fail the first tag after the first release on it.

With this change the length check leaves the trailing " (#)" out for commits GitHub itself committed, which is how squash merges are committed, and only there: commits people make and the pull request title still count every character, and the form and scope checks see the whole subject. New tests in commit_checks/tests cover both sides, and commit_checks.yml runs them.

Wire impact: none.

Assisted-by: Claude-Code:claude-opus-5-5

Root cause: a squash merge on GitHub forms the commit subject from the
pull request title and appends " (#<number>)". The title check measures
the title alone, so a title of 67 to 72 characters passes and lands as
a subject of 73 to 78. Any pull request whose range holds such a commit
then fails the Commit subjects check on a subject its author cannot
change: 6080624 (Dronecode#24) is 76 characters, and a fork's sync branch that
brings main's history fails on it. release_commit_checks.py runs the
same script over a release's range, so the first tag after the first
release would fail on it too.

Mechanism: in range mode the script reads each commit's committer email
with its subject. For a commit GitHub itself committed
(noreply@github.com), which is how squash merges are committed, the
length check leaves out a trailing " (#<number>)". Commits people make
and the pull request title are measured in full, and the form and scope
checks see the whole subject. commit_checks.yml runs the new tests.

Validation: the five tests in commit_checks/tests pass (a squash commit
of 70 characters plus its number; the same subject committed by a
person fails; a squash subject over 72 without its number fails; a
number that is not at the end counts; the title counts every
character), and without the change one of them fails. The script passes
over 2b3ecf4..5d7d65e, which holds 6080624. actionlint 1.7.12 with
shellcheck 0.11.0, zizmor 1.31.1 and 1.30.1, the 46 workflow_lint tests
and check_ci_policy report nothing.

Assisted-by: Claude-Code:claude-opus-5-5
Signed-off-by: Nuno Marques <nmarques@riis.com>
@TSC21
TSC21 force-pushed the ci/squash-subjects branch from b8aaafa to 341e4f7 Compare October 28, 2026 02:55
@TSC21
TSC21 requested a review from mrpollo October 28, 2026 02:55
@mrpollo
mrpollo merged commit baec639 into Dronecode:main Oct 28, 2026
26 checks passed
@TSC21
TSC21 deleted the ci/squash-subjects branch October 28, 2026 03:05
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.

2 participants