infra: _regen_file does not restore stash if generator fails — compose file lost at temp path #784
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#784
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Flagged by AI reviewer in PR #783.
Problem
_regen_file()(added in PR #783,bin/disinto~line 1424) moves the existing target file to a temp stash before calling the generator:The script runs under
set -euo pipefail. If the generator exits non-zero, bash exits immediately and the original file remains stranded at${target}.stash.XXXXXX(never restored). The target file no longer exists, anddocker compose upis never reached. Recovery requires the operator to manually locate and rename the hidden stash file.Fix
Add an ERR trap inside
_regen_fileto restore the stash on failure, e.g.:Auto-created from AI review
disinto upshould regenerate compose/Caddyfile from lib/generators.sh and reconcile orphans beforedocker compose up -d(#770) #783