feat: first-class branch-protection command (list/get/set) instead of raw API #375
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#375
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now there is no typed madtea surface for branch protection. To check or set a branch's protection I have to drop to
madtea api(or the MCPapi_call) against/repos/{owner}/{repo}/branch_protectionsand hand-write the JSON body.That is the one place a routine repo-governance task still needs raw API calls. It comes up whenever I audit or roll out protection across an org: read each branch's current rule, then POST a matching rule with the right required status-check contexts. Get a context string wrong and
mainsilently becomes unmergeable, so hand-writing the body is exactly where a typed, validated command would help most.Proposal: a branch-protection command family (with the matching MCP tool):
list- the branch-protection rules on a repoget <branch>- one rule, formattedset <branch>- create/update: required status checks + contexts, block direct push, force-push toggle, required approvals, signed commits, etc.delete <branch>Nice-to-haves:
--from <branch>(or--from <repo>) that copies one branch's rule shape onto another, adjusting the contexts to the target's own workflowCovers the Gitea and Forgejo
/repos/{owner}/{repo}/branch_protectionsendpoints.repo protect setidempotency on slash-bearing pattern rules #397repo protect setfully define final rule state, or keep create-with-defaults + update-partial? #427repo protect setfully define final rule state, or keep create-with-defaults + update-partial? #427