fix: bug: disinto init does not set up human user as site admin or ops repo collaborator (#113) #117
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#117
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-113"
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 #113
Changes
AI Review
Summary
Bug fix for #113 — adds the
johbahuman user as Forgejo site admin, creates a token stored inHUMAN_TOKEN, adds granular per-bot permissions (replacing uniform write), includesarchitect-botin both bot loops, and addsdisinto-adminas admin collaborator on both repos. Also wires upsetup_vault_branch_protectionafter ops repo creation. The intent is correct but there is one real bug that needs fixing.Issues
bin/disinto:951:${human_user}is referenced insidesetup_ops_repobut it is declared aslocal human_user="johba"at line 669 insidesetup_forge.setup_ops_repois called frominitat line 1914, aftersetup_forgehas already returned (line 1884). Withset -u(line 23), this expands to an unbound variable error and crashes the script whenever the org-level repo creation fallback is triggered. The same pattern at line 877 is safe because that code is insidesetup_forge, but line 951 is in a different function with no access tosetup_forge's locals. Fix: replace${human_user}with the literal string"johba"(or promote the variable to a module-level constant), and apply the same fix toadmin_tokenwhich uses${admin_token:-${FORGE_TOKEN}}safely buthuman_userdoes not.Minor Notes
human_passis re-generated randomly, the tokencurlgets a 401,human_tokenstays empty, and the existing.envHUMAN_TOKENis left untouched. This is acceptable — the token from the first run remains valid. No change needed.architect-botaddition are well-structured improvements.lib/env.shandlib/branch-protection.shinsideinitfor vault branch protection is clean.Verdict
REQUEST_CHANGES — human_user local variable used in setup_ops_repo after setup_forge returns — unbound variable crash with set -u
Reviewed at
ae3d6f2| AGENTS.mdAI Review: REQUEST_CHANGES — human_user local variable used in setup_ops_repo after setup_forge returns — unbound variable crash with set -u
AI Re-review (round 2)
Previous Findings
${human_user}unbound variable insetup_ops_repo(bin/disinto:951) → FIXED: replaced with the literal stringjohba, eliminating theset -ucrash in the fallback path.New Issues
None.
Verdict
APPROVE — unbound variable bug fixed by replacing ${human_user} with literal 'johba' in setup_ops_repo
Reviewed at
e8b9f07| Previous:ae3d6f2| AGENTS.mdAI Re-review (round 2): APPROVE — unbound variable bug fixed by replacing ${human_user} with literal 'johba' in setup_ops_repo