fix: fix: docker-compose.yml generated by init diverges from running stack — recreate breaks services (#354) #371
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#371
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-354"
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 #354
Changes
AI Review
Summary
This PR fixes two related causes of divergence between
disinto init-generated compose files and the running stack:container_name additions — without explicit container names, Docker Compose derives them from
{project}_{service}_{index}, whereprojectis the working directory name. If the directory changes, all containers are treated as new and recreated. Adding stablecontainer_namevalues to all five core services (forgejo,woodpecker,woodpecker-agent,agents,edge) eliminates this drift. Correct fix.Image tag
11.0→1— verified against the actualdocker-compose.ymlin the repo: the running stack usescodeberg.org/forgejo/forgejo:1. The generator was hardcoded to11.0, causing a divergence on every freshinit. The PR aligns these. The sed patch that searches for the image string is updated consistently.Minor Observation
lib/generators.sh: Thestagingservice in the generated compose does not receive acontainer_name. It is not profile-gated likerunner/staging-deploy, so it could still diverge on project rename. Low-impact (static file server, not stateful), but worth a follow-up for completeness.Verdict
APPROVE — container_name additions correctly fix the recreate divergence; image tag aligns with running stack
Reviewed at
cfe96f3| AGENTS.mdAI Review: APPROVE — container_name additions correctly fix the recreate divergence; image tag aligns with running stack
AI Review
Summary
This PR fixes the docker-compose.yml divergence by adding explicit
container_namefields to every service. The container_name additions are the correct fix — without them, Docker Compose derives names from the project name (typically the directory), so a re-generated compose file may reference different container IDs than what is running, causingrecreateto tear down and rebuild services unnecessarily.Issues
critical
lib/generators.sh:46: The image tag is changed fromcodeberg.org/forgejo/forgejo:11.0tocodeberg.org/forgejo/forgejo:1. Forgejo 11.x is the current-generation release (version 11 was published in late 2024/early 2025). The:1tag refers to the old 1.x line — a much earlier version. If a running stack has Forgejo 11 installed and a re-generated compose file references:1, adocker compose pullwould downgrade Forgejo, potentially breaking the database schema. This appears to be a regression rather than a fix.If the intent is to use a floating major-version tag (so the compose file does not pin a minor), the correct tag would be
:11, not:1. If the running stack genuinely uses:1(an old installation), this should be documented explicitly and the tag still should not be silently changed in the generator without rationale.The sed anchor patterns at lines 242–245 were updated to match the new tag, which is internally consistent — but the correctness of the tag itself needs to be verified.
What Is Good
container_nameto all five services (forgejo, woodpecker, woodpecker-agent, agents, edge) is the right fix for the described divergence issue. Stable, predictable container names decouple Docker Compose identity from the project-name heuristic.Verdict
REQUEST_CHANGES — Image tag regression: changing from forgejo:11.0 to forgejo:1 likely downgrades Forgejo from version 11 to an old 1.x release
Reviewed at
cfe96f3| AGENTS.mdAI Review: REQUEST_CHANGES — Image tag regression: changing from forgejo:11.0 to forgejo:1 likely downgrades Forgejo from version 11 to an old 1.x release