Skip to content

fix(ci): reserve the room a squash merge takes - #506

Merged
gloryfromca merged 1 commit into
mainfrom
ci/pr-title-reserve-squash-suffix
Oct 15, 2026
Merged

gloryfromca merged 1 commit into
mainfrom
ci/pr-title-reserve-squash-suffix

Conversation

@gloryfromca

Copy link
Copy Markdown
Member

The gap

check_pr_title measures the title an author types. What lands on main is the subject GitHub builds from it on squash — <title> (#<number>) — which is longer by 6–9 characters. Nothing checks that one.

v1.4.2 went out through that gap. #496's title was fix(lancedb): cap both caches, give queries their own embed budget, a legal 66 characters. The commit on main is 73, over the 72 this same policy enforces for commit subjects — so commit messages then failed on every open PR, for a commit none of their authors wrote. #505 narrowed the range so those PRs stop being blamed; this closes the hole that produced the subject.

It is not a one-off

Of the 29 PRs open today, 5 would still land an over-length subject:

squash subject PR
93 #445 fix(reflection): batch source deprecation, revert it on failure, cap sources per merge
91 #424 feat(memory): add Decision Memory Kind (extract → persist → index → search → evolve)
80 #470 build(deps): bump the python-deps group across 1 directory with 7 updates
77 #444 feat(llm): add aimlapi.com as an LLM endpoint with partner attribution
76 #419 build(deps): bump the actions group across 1 directory with 2 updates

Each one that merges puts commit messages back in the state #505 just cleaned up, for every PR behind it.

The change

Reserve the suffix before comparing. The workflow now passes PR_NUMBER, so the reserve is the real string — a four-digit PR costs one more character than a three-digit one. A local make check-pr-title has no number and falls back to the width of " (#0000)".

The message says what to do:

PR title is 66 chars; max is 65: fix(lancedb): cap both caches, give queries their own embed budget
  a squash merge appends " (#496)", and the commit subject it produces may not exceed 72

Verification

Five tests in tests/unit/test_scripts/test_check_pr_title.py, each failing against the current script:

  • the fix(lancedb): cap both caches, give queries their own embed budget #496 title with its real number is blocked, and the message names the suffix
  • a title that still fits once the suffix is counted passes
  • the same title passes at #496 and fails at #4096 — the reserve is the real suffix, not a guess
  • main() reads PR_NUMBER
  • the pre-existing length test now expects the fallback budget

make lint and make check-commits pass.

Expect five PRs to go red

That is the point — they are red now instead of after they have put a bad subject on main. Each one needs its title shortened, which is a text edit on the PR, no code change and no rebase.

The PR title check measured the title an author types. What lands on
main is the squash subject GitHub builds from it, "<title> (#<number>)",
which is longer. v1.4.2 went out that way: #496's title was a legal 66
chars and the commit on main is 73, over the 72 this policy enforces --
and `commit messages` then failed on every open PR for a commit none of
them wrote.

Reserve the suffix before comparing. CI now passes PR_NUMBER so the
reserve is exact; a local run without it falls back to the width of a
four-digit number.

5 of the 29 PRs open today would still land an over-length subject, so
this turns them red before the merge rather than after it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gloryfromca
gloryfromca merged commit ec32f4b into main Oct 15, 2026
11 checks passed
@gloryfromca
gloryfromca deleted the ci/pr-title-reserve-squash-suffix branch October 15, 2026 11:35
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.

1 participant