decision: should repo protect set fully define final rule state, or keep create-with-defaults + update-partial? #427
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#427
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?
Follow-up from #375. The
setupsert shipped with the same field semantics as the existing create/update verbs. That leaves one open product-semantics question.The divergence
setis not deterministic with respect to final rule state:enable_pushdefaults to blocked).So
repo protect set main --required-approvals 1produces different final protection depending purely on whether a rule pre-existed.Options
sethelp. Matches the existing create/update field behavior.setfully deterministic: read-modify-write, or send the complete field set, so the final state does not depend on pre-existence. This is what aset/upsert verb usually implies.My lean
(2). A verb named
setreads as "make the rule look like this", so pre-existence should not change the outcome.The tradeoff is real: (2) is a larger change, because it needs a full field model with explicit defaults, and it pins the intended contract for the verb. (1) is a help-text edit and stays consistent with create/update. I want to settle the contract deliberately before building either.
Related: #375.
Decided:
setbecomes a deterministic desired-state verb, and stays explicit about the security-relevant fields.repo protect set <branch>will send the full field set, so the final protection state never depends on whether a rule pre-existed. This is the desired-state model that aset/upsert verb should have.It will NOT invent a security posture. Branch protection is a security control, so
setdoes not silently fill push, approval, or force-push intent with a server or tool default. If that intent is unstated,seterrors and names the missing field, rather than choosing the posture for you. That gives determinism without the tool quietly deciding how locked-down a branch is.Build outline:
setthrough read-modify-write (or a complete field send) so pre-existence stops changing the outcome.sethelp to document the desired-state contract.Related: #375.