fix: feat(20d): branch protection on .profile repos — admin-only formula merge (#87) #98
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#98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-87"
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 #87
Changes
AI Review
Summary
The PR correctly adds
setup_profile_branch_protectiontobranch-protection.shand wires it into the hire-an-agent flow inbin/disinto. The branch protection logic mirrors the existingsetup_vault_branch_protectionfunction and the graceful-degradation handling (non-fatal warnings if API is unavailable) is appropriate. One correctness bug prevents the journal branch from ever being created.Findings
bug
lib/branch-protection.sh:315: The Forgejo API endpoint/git/refs/heads/{branch}returns an array ofGitReferenceobjects, not a single object.jq -r '.object.sha'on an array outputs the stringnull, not a SHA.main_commitis then set to"null"(a non-empty string), the subsequentcurlcall sends{"sha":"null"}which the API rejects, and the|| { _bp_log "Warning..." }branch fires silently. The journal branch is never created, butsetup_profile_branch_protectionstill returns 0.The fix is to index into the array:
jq -r '.[0].object.sha'.As a consequence,
bin/disintoalso incorrectly printsJournal branch created for direct agent pusheswhen the branch was not actually created.Verdict
REQUEST_CHANGES — jq array indexing bug means journal branch is never created, but function reports success
Reviewed at
0d2ed58| AGENTS.mdAI Review: REQUEST_CHANGES — jq array indexing bug means journal branch is never created, but function reports success
AI Re-review (round 2)
Previous Findings
lib/branch-protection.sh:315— jq array indexing.object.shaon array response → FIXED: incremental diff shows.[0].object.shaapplied correctly.New Issues
None.
Verdict
APPROVE — jq array indexing bug fixed; no new issues
Reviewed at
bcad5c7| Previous:0d2ed58| AGENTS.mdAI Re-review (round 2): APPROVE — jq array indexing bug fixed; no new issues