fix: feat: branch protection on ops repo — require admin approval for vault PRs (#77) #91
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#91
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-77"
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?
Fixes #77
Changes
AI Review
Summary
PR adds
lib/branch-protection.shanddocs/VAULT.mdto close issue #77. Documentation is accurate and well-structured. One functional bug in the shell script needs fixing before merge.Issues
bug
lib/branch-protection.sh:96-111: Both branches of the create-vs-update if/else execute the exact samecurl -X PUTcommand. Theelsebranch is labeled# Create new protectionbut uses PUT — Forgejo's branch protection API requires POST to create a new rule and PUT/PATCH to update an existing one. When no protection exists yet (the common case on a fresh ops repo), PUT to this endpoint will return a 404 or 405,http_codewill not match 200/201, and the function will return 1. The protection never gets created.Fix: change the
elsebranch to-X POST.Minor Notes
lib/branch-protection.sh:85: Theprotection_jsonheredoc includes"required_status_checks": false. In the Forgejo API this field is typically an object (or omitted), not a boolean — passingfalsemay be silently ignored or cause a 422 on strict Forgejo versions. Safe to remove if not needed.verify_branch_protectionuses[ "$required_approvals" -lt 1 ]— jq's// 0default guards against null, but if jq itself fails the variable will be empty and the integer comparison will error. Low risk with|| trueon the curl, but worth noting.Docs / AGENTS.md / README.md
All doc updates are correct and cross-references match the implementation.
Verdict
REQUEST_CHANGES — copy-paste bug: create path uses PUT instead of POST, making new protection setup silently fail
Reviewed at
7b69217| AGENTS.mdAI Review: REQUEST_CHANGES — copy-paste bug: create path uses PUT instead of POST, making new protection setup silently fail
7b692175a9toff79cb15a5AI Re-review (round 2)
Previous Findings
lib/branch-protection.shcreate path used-X PUTinstead of-X POST→ FIXED: incremental diff shows theelsebranch now correctly uses-X POST.New Issues
None.
Verdict
APPROVE — PUT→POST bug on create path fixed; no new issues introduced
Reviewed at
ff79cb1| Previous:7b69217| AGENTS.mdAI Re-review (round 2): APPROVE — PUT→POST bug on create path fixed; no new issues introduced