test: add comprehensive branch name validation tests - #2551
Conversation
- Tests all 34 allowed branch type prefixes
- Validates rejection of forbidden prefixes (claude/, copilot/, openai/)
- Enforces format pattern {type}/{scope}-{title}
- Tests edge cases: null, undefined, special characters, dashes
- Includes real-world valid and invalid branch name examples
- Tests consistency with CLAUDE.md repository rules
- All 39 tests passing with proper type extraction from regex groups
Closes #2544
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
|
Warning Review limit reachedNext included review available in 14 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
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 |
|
🚫 This PR description is missing required template content. Missing required section(s): Global DoD checklist Please update the PR body using one of the repository PR templates:
Empty placeholders, unchecked checklist boxes, and stub issue references do not count. |
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
- Add audit/ and codex/ types (complete 34-type set) - Document forbidden AI agent prefixes: claude/, copilot/, openai/ - Explain fallback routing for forbidden prefixes to default PR template - Update all regex patterns and labeler config with new types - Add PR template routing table and fallback logic explanation - Clarify enforcement and governance rationale for AI agents Closes #2545 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Routes codex/ branches to pr_docs.md template - Completes routing map for all 34 allowed branch types - Ensures fallback routing works for all type prefixes - Relates to Issue #2546 (template routing completion) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
📄 README Validation❌ One or more README checks failed.
|
- Added documentation for __tests__/validate-branch-names.test.js - Updated frontmatter (version 1.0.0 → 1.1.0, last_updated: 2026-08-30) - Updated description to include branch naming governance validation - Added branch-governance tag to reflect new test coverage - Fixes README frontmatter validation failure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
1 similar comment
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
Status Update✅ Implementation Complete All Phase 3 AI Governance Audit work is complete:
Remaining Step: Assign milestone Once the milestone is assigned, all governance checks will pass and the PR is ready for review and merge. Generated by Claude Code |
🎨 Mermaid Diagram Validation❌ One or more Mermaid diagram checks failed.
|
…ADME - Added accTitle for screen reader compatibility - Added accDescr with comprehensive diagram description - Fixes Mermaid accessibility validation check Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Updated Mermaid diagram to use YAML config syntax for accTitle and accDescr - Ensures accessibility validation compatibility with current Mermaid version - Maintains diagram styling and structure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
1 similar comment
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
- Tests all 34 allowed branch type prefixes
- Validates rejection of forbidden prefixes (claude/, copilot/, openai/)
- Enforces format pattern {type}/{scope}-{title}
- Tests edge cases: null, undefined, special characters, dashes
- Includes real-world valid and invalid branch name examples
- Tests consistency with CLAUDE.md repository rules
- All 39 tests passing with proper type extraction from regex groups
Closes #2544
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Add audit/ and codex/ types (complete 34-type set) - Document forbidden AI agent prefixes: claude/, copilot/, openai/ - Explain fallback routing for forbidden prefixes to default PR template - Update all regex patterns and labeler config with new types - Add PR template routing table and fallback logic explanation - Clarify enforcement and governance rationale for AI agents Closes #2545 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Routes codex/ branches to pr_docs.md template - Completes routing map for all 34 allowed branch types - Ensures fallback routing works for all type prefixes - Relates to Issue #2546 (template routing completion) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Added documentation for __tests__/validate-branch-names.test.js - Updated frontmatter (version 1.0.0 → 1.1.0, last_updated: 2026-08-30) - Updated description to include branch naming governance validation - Added branch-governance tag to reflect new test coverage - Fixes README frontmatter validation failure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
…ADME - Added accTitle for screen reader compatibility - Added accDescr with comprehensive diagram description - Fixes Mermaid accessibility validation check Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
- Updated Mermaid diagram to use YAML config syntax for accTitle and accDescr - Ensures accessibility validation compatibility with current Mermaid version - Maintains diagram styling and structure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G7MTRFUKLDQTeJ1v5iZKAr
1030920 to
6861f5b
Compare
❌ 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. |
…debug logging Fixed ReferenceError where debug code was trying to reference undefined BRANCH_PATTERN variable. Replaced with correct pattern names: BRANCH_PATTERN_STANDARD, BRANCH_PATTERN_RELEASE_SEMVER, and BRANCH_PATTERN_RELEASE_STANDARD to enable proper debug output without crashing the validator. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…ANCH_PATTERN alias fix The remote version already included a better fix for the undefined BRANCH_PATTERN reference by adding it as an alias: const BRANCH_PATTERN = BRANCH_PATTERN_STANDARD; This allows the debug code and existing code to work without modification.
e7d2919 to
96e58b4
Compare
🔍 Reviewer Summary for PR #2551CI Status: ✅ Recommendations
|
Linked issues
Closes #2544, #2545, #2546
Changelog
Added
{type}/{scope}-{title}docs/BRANCHING_STRATEGY.mdwith audit/ and codex/ types.github/PULL_REQUEST_TEMPLATE/config.ymlwith complete routing mapChanged
scripts/validation/README.mdto document new branch name validation testsChecklist (Global DoD / PR)