Skip to content

fix: validate commit messages on merge to main#55

Merged
catinspace-au merged 1 commit into
mainfrom
fix/commit-validation-landing-gate
Jul 6, 2026
Merged

fix: validate commit messages on merge to main#55
catinspace-au merged 1 commit into
mainfrom
fix/commit-validation-landing-gate

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

What

Moves conventional-commit validation out of the run-checks-gated quality job into a dedicated cheap commit-check job.

Before: validation only ran on PRs (against throwaway branch commits that a squash-merge discards) and on publish pushes. An ordinary squash-merge to main was never validated (run-checks=false), and UI-merge teams never hit the local predicted_bump guard (that only runs under hyperi-ci push). Net: no landing-time guard on main for GitHub-UI merges.

After: commit-check runs on push-to-main (FATAL - validates what actually lands) and on PRs (ADVISORY - branch commits may be squashed away, only the squash subject lands). It is a git-log + regex check, not run-checks-gated. Feature-branch pushes skip it, preserving the chore-skip fast path.

Local hyperi-ci check now runs the same validation over origin/main..HEAD (FATAL) so a bad message is caught in the local tight loop, not after the push - keeping check a complete local dry-run of what CI would flag.

Where

  • New commit-check job in all four reusable <lang>-ci.yml workflows + the self-hosting ci.yml (dogfoods on this PR).
  • New hyperi-ci check-commits CLI entrypoint; commit_validation.run gains advisory-on-PR + local= modes.
  • Removed from CI stage_quality; kept there only for local check.
  • Docs: docs/ARCHITECTURE.md job-contract + what-runs-when tables.

Notes

  • The feat:/BREAKING opt-in gate is unchanged and still deliberate (comment-locked). This PR only changes where/when validation runs, not the rules.
  • Merging rolls out to all consumers on <lang>-ci.yml@main. Advisory-on-PR means PRs won't newly break; push-to-main will now flag a genuinely bad squash subject landing on main (branch protection is off, so it signals rather than blocks).
  • Surfaced by dfe-ui#81.

Conventional-commit validation was bundled in the run-checks-gated
quality job, so it only ran on PRs (against throwaway branch commits)
and publish pushes -- never on an ordinary squash-merge to main. Teams
merging via the GitHub UI thus had no landing-time guard at all (the
local predicted_bump gate only runs under `hyperi-ci push`).

Move it to a dedicated cheap `commit-check` job that runs on push-to-
main (FATAL -- validates what lands) and on PRs (ADVISORY -- branch
commits may be squashed away). Not run-checks-gated. Feature-branch
pushes skip it, preserving the chore-skip fast path.

Local `hyperi-ci check` runs the same validation over origin/main..HEAD
(FATAL) so a bad message is caught in the local tight loop, not after
the push.

Added to all four reusable <lang>-ci.yml workflows and the self-hosting
ci.yml, plus a new `hyperi-ci check-commits` CLI entrypoint. Surfaced by
dfe-ui#81 (squash-merge PR red-flagged on discarded branch commits).
@catinspace-au catinspace-au merged commit eb482a2 into main Jul 6, 2026
10 checks passed
@catinspace-au catinspace-au deleted the fix/commit-validation-landing-gate branch July 6, 2026 07:23
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