fix: refactor: extract compose/Dockerfile/Caddyfile generation from bin/disinto into lib/generators.sh (#301) #317
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#317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-301"
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 #301
Changes
dd74a36e3ftocbc28d34f3AI Review
Summary
Clean refactor extracting generator functions into
lib/generators.sh. The public-to-private indirection and CI pipeline update are correct. One blocking bug found.Blocking
lib/generators.sh:24:: "${PROJECT_NAME:?PROJECT_NAME must be set}"fails on a fresh install.env.shsetsPROJECT_NAME="${PROJECT_NAME:-${FORGE_REPO##*/}}"— whenFORGE_REPOis unset (clean machine, no.env),PROJECT_NAMEbecomes an empty string. The:?operator fires on empty as well as unset, so sourcinggenerators.shat line 30 ofbin/disintoaborts before any subcommand runs. This breaksdisinto initon first-time use, which is exactly when these generators are needed. None of the_generate_*_implfunctions actually usePROJECT_NAMEat source time (the compose template uses${PROJECT_NAME:-project}as a literal shell expansion written into the generated file, not evaluated by bash). The assertion should be removed or replaced with a soft default:PROJECT_NAME="${PROJECT_NAME:-project}".Minor
lib/generators.sh:25:: "${PRIMARY_BRANCH:-main}"is a no-op — it neither asserts nor assigns. The header comment says defaults to main but the line does nothing.env.shalready setsPRIMARY_BRANCH="${PRIMARY_BRANCH:-master}"so this is harmless, but confusing. Either remove it or change to an assignment:PRIMARY_BRANCH="${PRIMARY_BRANCH:-main}".Verdict
REQUEST_CHANGES — PROJECT_NAME:? assertion in generators.sh breaks disinto init on a fresh machine where FORGE_REPO is not yet set
Reviewed at
cbc28d3| AGENTS.mdAI Review: REQUEST_CHANGES — PROJECT_NAME:? assertion in generators.sh breaks disinto init on a fresh machine where FORGE_REPO is not yet set
cbc28d34f3toc62f8e77efc62f8e77efto47215a85aaAI Re-review (round 2)
Previous Findings
PROJECT_NAME="${PROJECT_NAME:-project}"— safe default, no abort on empty envPRIMARY_BRANCH="${PRIMARY_BRANCH:-main}"— actual assignment, header comment now accurateNew Issues
None. The detect-duplicates.py exemptions for the intentional generators.sh / hire-agent.sh template duplicates are correctly documented. The AGENTS.md lib listing update is accurate.
Verdict
APPROVE — Both previous findings fixed; refactor is clean and correct
Reviewed at
47215a8| Previous:cbc28d3| AGENTS.mdAI Re-review (round 2): APPROVE — Both previous findings fixed; refactor is clean and correct