Skip to content

fix(ci): preserve GitHub Update branch merge exception - #220

Merged
ruby-automation merged 1 commit into
mainfrom
EXT-35-preserve-update-branch-exception
Sep 5, 2026
Merged

fix(ci): preserve GitHub Update branch merge exception#220
ruby-automation merged 1 commit into
mainfrom
EXT-35-preserve-update-branch-exception

Conversation

@ruby-automation

Copy link
Copy Markdown
Contributor

Summary

  • Restores the narrowly scoped exception in validate-commit-range for GitHub's auto-generated "Update branch" merge commits, which was lost in EXT-29 (PR ci: harden Conventional Commit validators and Git test isolation #218).
  • Expands git log format from %s to %P%x01%cn%x01%ce%x01%s so parent hashes, committer name, and committer email are available alongside the subject in the validation loop.
  • A commit is skipped only when all three predicates match simultaneously: exactly 2 parents, committer is GitHub <noreply@github.com>, subject matches ^Merge branch '[^']+' into .+.
  • Adds 5 new ExUnit tests covering the happy path and each predicate variation (wrong name, wrong email, single parent, non-matching subject).
  • Adds documents/github-update-branch-validation-decision.adoc recording the rationale and alternatives considered.

Test plan

  • mix ci passes (405 tests, no lint or format issues)
  • New test: GitHub Update branch merge is skipped (exit 0)
  • New test: wrong committer name → validated → fails
  • New test: wrong committer email → validated → fails
  • New test: single-parent commit with matching subject → validated → fails
  • New test: two-parent GitHub-committer merge with non-matching subject → validated → fails
  • Existing tests unchanged and passing

Closes EXT-35

🤖 Generated with Claude Code

EXT-29 (PR #218) replaced the metadata-aware commit-range validator with
a subject-only traversal, losing the exception for GitHub's trusted
"Update branch" auto-merge commits.

Restore it in validate-commit-range using a three-part predicate: a
commit is skipped only when it has exactly two parents, the committer is
GitHub <noreply@github.com>, and the subject matches
`Merge branch '<base>' into <head>`.

The git log format is expanded from `%s` to
`%P%x01%cn%x01%ce%x01%s` (SOH-delimited) so parent hashes, committer
name, and committer email are available in the loop alongside the subject.

Add five new ExUnit tests covering the skip itself and each predicate
variation (wrong name, wrong email, single parent, non-matching subject).
Add documents/github-update-branch-validation-decision.adoc recording
the rationale and alternatives considered.

Refs: EXT-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