Skip to content

fix(ci): lint integration commits on dispatch - #1806

Merged
ScriptedAlchemy merged 1 commit into
masterfrom
cursor/batch-merge-commit-hygiene-29ef
Sep 19, 2026
Merged

ScriptedAlchemy merged 1 commit into
masterfrom
cursor/batch-merge-commit-hygiene-29ef

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • workflow_dispatch now lints the commits a merge onto the default branch would introduce, using the same commitlint rules a master push uses.
  • Batch-fold follow-ups whose headers exceed 72 characters fail that admission instead of landing and failing the tip push.
  • header-max-length stays 72. The workflow trigger list is unchanged: push and workflow_dispatch only.

Motivation

#1796 folded batch B through workflow_dispatch, then the master push (CI run 35423924082, tip 3f71bccb2dba) failed header-max-length on three follow-up commits:

  • 92b22f71996ff40ec21c2de08d4f53cd63cea6f8 (73)
  • 4c5275f31a54e8b2d220db120223c16609bd368e (75)
  • 943f641111e71050a1c487af7e6f53e1999a482c (85)

Dispatch was the admission path and did not run commitlint. Rewriting those published SHAs is left to the tip-commit-lint lane; this change does not widen ignores or the 72-character rule. A dispatch of the default branch has an empty range, so published history is not rejudged.

Changes

  • scripts/lint-ci-commits.sh selects the push before..HEAD range or the dispatch merge-base(default, HEAD)..HEAD range, then calls scripts/lint-commit-range.mjs.
  • .github/workflows/ci.yml runs that script for push and workflow_dispatch.
  • scripts/test-lint-commit-range.py covers the three failing subjects, the same follow-ups once the header fits, a default-branch dispatch that must not rejudge, and the existing push path.

Test plan

  • python3 scripts/test-lint-commit-range.py — 9 tests, OK
  • Push range b4aa02ae61..3f71bccb2d exits 1 with those three SHAs and lengths 73 / 75 / 85
  • Dispatch of batch tip 0f94ec9f9b against b4aa02ae61 exits 1 on the same three SHAs
  • Dispatch of published tip 3f71bccb2d against itself exits 0
  • cargo nextest run --workspace --no-fail-fast not run; this change does not touch Rust
  • cargo clippy not run; this change does not touch Rust

Commit: a943654d99f0ed61a4f8b15aff278562a41fbeb7

Checklist

  • No secrets, credentials, or .env files included
  • CHANGELOG.md updated — not applicable; CI lint entry point only
  • Breaking changes documented — none
Open in Web Open in Cursor 

workflow_dispatch admits an integration branch and previously skipped
commitlint, so batch-fold follow-ups with headers of 73, 75, and 85
characters landed in #1796 and failed the master push. Dispatch now
lints the commits a merge onto the default branch would introduce.

header-max-length stays 72. A dispatch of the default branch does not
rejudge published history.

Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Sep 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a943654

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy marked this pull request as ready for review September 19, 2026 06:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-19T06:24:17.995596Z a943654 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a943654d99

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +78 to +79
base=$(git -C "$repository" merge-base "$head" "$upstream")
lint_range "$base"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude every commit already reachable from upstream

Use the resolved upstream ref itself as the left side of the lint range. When the dispatch head and default branch have a criss-cross history, they can have multiple best common ancestors; git merge-base -h explicitly says that --all outputs all common ancestors, while this invocation selects only one. Consequently, base..head can include a different common ancestor that is already published on the default branch and reject the dispatch for its old message, contrary to the stated no-rejudging behavior. upstream..head directly selects exactly the commits reachable from the proposed head but not from the default branch.

Useful? React with 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy merged commit daf9e0f into master Sep 19, 2026
22 of 25 checks passed
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