Skip to content

feat: add branch protection rules 9-11#18

Merged
packet-mover merged 1 commit intomainfrom
feat/branch-protection-rules
Apr 6, 2026
Merged

feat: add branch protection rules 9-11#18
packet-mover merged 1 commit intomainfrom
feat/branch-protection-rules

Conversation

@packet-mover
Copy link
Copy Markdown
Contributor

@packet-mover packet-mover commented Apr 6, 2026

Summary

  • Add GetBranchProtection to GitHubClient interface + implementation (404 = nil, not error)
  • Add BranchProtection struct with RequiredReviewers and RequiredStatusChecks
  • Add 3 rules: HasBranchProtection, HasRequiredReviewers, HasRequiredStatusChecks
  • All three share a single API call per repo (2 total calls per repo: GetTree + GetBranchProtection)
  • This completes all 11 rules defined in the spec

Test plan

  • go test ./... passes (9 new tests)
  • go vet ./... clean

Add HasBranchProtection, HasRequiredReviewers, HasRequiredStatusChecks.

All three rules use a single GetBranchProtection API call per repo.
404 (no protection) is handled as nil, not an error.

This completes all 11 rules defined in the spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@packet-mover packet-mover merged commit 02b3b2c into main Apr 6, 2026
2 checks passed
@packet-mover packet-mover deleted the feat/branch-protection-rules branch April 6, 2026 10:53
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