fix: refactor: extract install_cron() and Woodpecker OAuth/token setup from bin/disinto into lib/ci-setup.sh (#303) #321
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
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: disinto-admin/disinto#321
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-303"
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 #303
Changes
AI Review
Bug: PROJECT_NAME guard fails on fresh disinto init
critical
lib/ci-setup.sh:28:_load_ci_contextexits with an error ifPROJECT_NAMEis unset or empty. During a freshdisinto init,PROJECT_NAMEis never exported —disinto_inituses a localproject_namevariable and never doesexport PROJECT_NAME=.... The globalPROJECT_NAMEonly gets a value fromlib/env.shifFORGE_REPOis already in.env(line 112 of env.sh:export PROJECT_NAME="${PROJECT_NAME:-${FORGE_REPO##*/}}"), butsetup_forgedoes not writeFORGE_REPOto.env. So on a clean bootstrap, every call tocreate_woodpecker_oauth,install_cron,generate_woodpecker_token, andactivate_woodpecker_repowill abort withError: ci-setup.sh requires these globals to be set: PROJECT_NAME.Compounding the problem: none of the four
_implfunctions ever reference$PROJECT_NAME— the validation requirement is fully spurious. The original inline code inbin/disintohad no such check.Fix: remove
PROJECT_NAMEfrom the_load_ci_contextmissing-variable check (it is unused), or export it fromdisinto_initbefore calling CI setup functions.Minor: client_secret uninitialized in already-exists path
lib/ci-setup.sh:107:client_secretis declared withlocal existing_app client_id client_secretbut is never assigned when the OAuth2 app already exists (theif [ -n "$existing_app" ]branch at line 115 only setsclient_id). The subsequent[ -n "${client_secret:-}" ]guard (line 155) correctly handles the empty case, so no crash occurs — but the declared-but-uninitialized pattern is confusing. This is pre-existing from the original code and is not introduced here, so it is informational only.Verdict
REQUEST_CHANGES — _load_ci_context requires PROJECT_NAME but it is never set in disinto_init, breaking fresh installs
Reviewed at
fb7d184| AGENTS.mdAI Review: REQUEST_CHANGES — _load_ci_context requires PROJECT_NAME but it is never set in disinto_init, breaking fresh installs
fb7d1842e4to786c818509AI Re-review (round 2)
Previous Findings
PROJECT_NAMEcheck has been removed from_load_ci_context(incremental diff confirms the line was dropped). The function now only validatesFORGE_URL,FORGE_TOKEN, andFACTORY_ROOT, all of which are legitimately required and set before these functions are called.Verdict
APPROVE — Previous finding fixed: PROJECT_NAME check removed from _load_ci_context
Reviewed at
786c818| Previous:fb7d184| AGENTS.mdAI Re-review (round 2): APPROVE — Previous finding fixed: PROJECT_NAME check removed from _load_ci_context