feat(repo): add branch-protection set (create-or-update upsert) #400

Merged
hexajon merged 1 commit from issue-375-branch-protection-command into main 2026-08-17 08:25:22 +00:00
Owner

Summary

Add a set <branch> verb to the branch-protection command family on both surfaces: CLI madtea repo protect set and MCP madt_branches_remote protect_set. list/get/create/update/delete already existed; only the create-or-update upsert was missing. set probes the existing rule and creates it when absent or updates it when present.

Also fixes a latent idempotency bug: the branch-protection by-name client paths concatenated the rule name raw, so a slash-bearing pattern rule (release/*) never matched the single-segment route and set always re-created it. The get/update/delete paths now url.PathEscape the name (a no-op for plain names).

Note for review: this raises the aggregate tool-schema byte budget 230000 -> 240000. The new protect_set action tips the measured total to 230094, and the old cap's headroom was exhausted by prior additions; the measurement comments are refreshed.

Follow-ups filed: #397 (live-forge probe for pattern-rule idempotency), #398 (whether set should fully define final rule state - a semantics decision).

Gate green including mcp-conformance and parity.

Closes #375

## Summary Add a `set <branch>` verb to the branch-protection command family on both surfaces: CLI `madtea repo protect set` and MCP `madt_branches_remote protect_set`. list/get/create/update/delete already existed; only the create-or-update upsert was missing. set probes the existing rule and creates it when absent or updates it when present. Also fixes a latent idempotency bug: the branch-protection by-name client paths concatenated the rule name raw, so a slash-bearing pattern rule (release/*) never matched the single-segment route and set always re-created it. The get/update/delete paths now url.PathEscape the name (a no-op for plain names). Note for review: this raises the aggregate tool-schema byte budget 230000 -> 240000. The new protect_set action tips the measured total to 230094, and the old cap's headroom was exhausted by prior additions; the measurement comments are refreshed. Follow-ups filed: #397 (live-forge probe for pattern-rule idempotency), #398 (whether set should fully define final rule state - a semantics decision). Gate green including mcp-conformance and parity. Closes #375
feat(repo): add branch-protection set (create-or-update upsert)
Some checks failed
ci / mcp-conformance (pull_request) Successful in 2m23s
drift / govulncheck (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 1m32s
drift / forgejo-smoke (pull_request) Has been skipped
ci / mcp-conformance (push) Successful in 38s
drift / govulncheck (push) Has been skipped
drift / surface-diff (push) Successful in 17s
drift / forgejo-smoke (push) Has been skipped
ci / gate (push) Has been cancelled
ci / gate (pull_request) Successful in 28m37s
98819989a6
Add a `set <branch>` verb to the branch-protection command family
(list/get/create/update/delete already existed) on both the CLI
(`madtea repo protect set`) and the MCP surface (madt_branches_remote
protect_set). set probes the existing rule and creates it when absent or
updates it when present, so one command does create-or-update.

Also fix a latent idempotency bug: the branch-protection by-name client
paths concatenated the rule name raw, so a slash-bearing pattern rule
(release/*) never matched the single-segment route and set always
re-created it. url.PathEscape the name in the get/update/delete paths.

Raise the aggregate tool-schema byte budget 230000 -> 240000: the new
protect_set action tips the measured total to 230094, and headroom under
the old cap was exhausted by prior additions. Regenerate reference docs.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!400
No description provided.