Skip to content

Conversation

@yaleman
Copy link
Owner

@yaleman yaleman commented Nov 24, 2025

feat: add status check validation and fix ruleset API handling
Added comprehensive status check validation to ensure required checks
actually exist in workflow files before enforcing them in branch protection.

Changes:

  • Add _get_available_checks_for_repo() to parse workflow YAML files and extract job names
  • Add _validate_required_checks() to compare required vs available checks with helpful warnings
  • Integrate validation into both check and fix functions
  • Fix _get_rulesets() to fetch full ruleset details instead of summaries
    (GitHub's list API returns rules: None and conditions: None)
  • Fix filter logic to handle conditions: None (applies to all branches)
  • Add debug logging for ruleset fetching and filtering
  • Add 9 comprehensive unit tests for validation logic

Fixes:

  • Silent exit bug in fix_legacy_protection_cleanup (filter wasn't matching rulesets)
  • Missing PR rule detection (list API doesn't include full rule details)
  • Legacy protection cleanup now successfully removes old protection
  • Fix allow_admin_bypass to correctly allow/prevent admin bypass (was inverted)
  • Add support for GitHub rulesets with admin bypass actors (role ID 5)
  • Implement migration from legacy branch protection to rulesets
  • Add separate check/fix for cleaning up legacy protection after migration
  • Update CLAUDE.md with corrected configuration documentation

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

yaleman and others added 3 commits November 23, 2025 13:52
…pport

- Fix allow_admin_bypass to correctly allow/prevent admin bypass (was inverted)
- Add support for GitHub rulesets with admin bypass actors (role ID 5)
- Implement migration from legacy branch protection to rulesets
- Add separate check/fix for cleaning up legacy protection after migration
- Update CLAUDE.md with corrected configuration documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive status check validation to ensure required checks
actually exist in workflow files before enforcing them in branch protection.

Changes:
- Add _get_available_checks_for_repo() to parse workflow YAML files and extract job names
- Add _validate_required_checks() to compare required vs available checks with helpful warnings
- Integrate validation into both check and fix functions
- Fix _get_rulesets() to fetch full ruleset details instead of summaries
  (GitHub's list API returns rules: None and conditions: None)
- Fix filter logic to handle conditions: None (applies to all branches)
- Add debug logging for ruleset fetching and filtering
- Add 9 comprehensive unit tests for validation logic

Fixes:
- Silent exit bug in fix_legacy_protection_cleanup (filter wasn't matching rulesets)
- Missing PR rule detection (list API doesn't include full rule details)
- Legacy protection cleanup now successfully removes old protection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@yaleman yaleman enabled auto-merge (squash) November 24, 2025 07:05
@yaleman yaleman merged commit 365a0c2 into main Nov 24, 2025
8 checks passed
@yaleman yaleman deleted the rules branch November 24, 2025 07:05
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