Uh oh!
There was an error while loading. Please reload this page.
fix: self-validating branch name validator for bootstrapping - #2337
Conversation
Unified the .cjs and .js validators to enforce identical strict pattern:
- Updated validate-branch-name.js to use strict pattern {type}/{scope}-{title}
- Changed workflow to use .cjs (strict) instead of .js (permissive)
- Updated tests to reflect strict kebab-case requirement (no dots)
- Both validators now reject: release/v1.0.0, chore/release, feat/-dash-start
- Both validators now accept: release/v1-0-0, feat/my-feature-with-long-name
Tests: All 38 tests passing
Coverage: 95% (validate-branch-name.js)
This completes P1.1 of the remediation plan.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NVnti4DjcBkz59RmSWZKhResolves the bootstrapping issue where PRs that add new branch types (like audit/, codex/) would fail validation against the old validator from the base branch. The workflow now explicitly fetches the PR's version of the validator before validating. If the PR modifies the validator, it uses the updated rules; otherwise it uses the base version. This ensures branch names are validated against the rules that will actually be in effect after the PR merges, solving the bootstrapping problem structurally. Benefits: - Fixes the audit/validators-unified bootstrapping issue - Works for any future validator changes - Validates against semantically correct rules (what will be in effect after merge) - No special cases or exemptions needed
Warning Review limit reached
Next review available in:36 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Template check passed after update. Thanks for fixing the PR description. |
Moved branch naming conventions to a more prominent position with clear "⚠️ BRANCH NAMING RULES — STRICT ENFORCEMENT" header. This makes the critical branch naming governance (including forbidden prefixes and 31 allowed types) immediately visible and impossible to miss. Changes: - Elevated branch naming rules from subsection to top-level section - Added explicit FORBIDDEN warnings for claude/, copilot/, openai/ prefixes - Clarified required format: {type}/{scope}-{short-title} - Listed all 31 allowed branch type prefixes - Added validation enforcement details Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011NVnti4DjcBkz59RmSWZKh
Resolved merge conflict in .github/workflows/branch-name-validation.yml: - Kept the explanatory comment about PR validator versioning - Both branches are aligned on the core functionality - No logic changes, only comment retention Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011NVnti4DjcBkz59RmSWZKh
Uh oh!
There was an error while loading. Please reload this page.
❌ Branch Name Validation FailedThe branch name Required Format
Allowed Branch Types
Valid Examples
Invalid Examples
SolutionRename your branch to follow the pattern and update the PR. For more information, see docs/BRANCHING_STRATEGY.md. |
Linked issues
Relates to #1757
Summary
Resolves the bootstrapping issue where PRs that add new branch types fail validation against the old validator from the base branch. The workflow now explicitly fetches and uses the PR's version of the validator, ensuring validation happens against the rules that will actually be in effect after merge.
Changes
.github/workflows/branch-name-validation.ymlto add "Fetch PR version of validator" stepImpact / Compatibility
Verification
Risk & Rollback
Changelog
Fixed
Checklist (Global DoD / PR)