feat(prepare-compose): compose file picker#1135
Conversation
|
Combination of my pull request enhancements built daily against latest main/dev for testing: https://github.com/keithy/workflows/actions/workflows/goclaw-daily.yml output: |
COMPOSE_FILE can be set (via .env) to choose compose configuration files. - Removed compose.d/ and compose.options/ symlink directories - New .env-compose file-based selection - Sections: ROOT (required), SERVICE (optional), OVERLAY (optional) - Detection: by content + naming (. = service, + = overlay) - Options: --generate, --edit, --update, --check, --file - Validation via docker/podman compose config - Rename overlay example: postgres-low-cpu.yml → postgres+low-cpu.yml 💘 Generated with Crush Assisted-by: Crush:MiniMax-M2.7
8e7a9cd to
c49253f
Compare
|
This functionality is also available in this parent project deploying goclaw on podman etc. For production deployment of goclaw on podman, here the runtime environment is decoupled from the upstream goclaw codebase. |
mrgoonie
left a comment
There was a problem hiding this comment.
Summary: This moves the compose picker in a useful direction, but the new script breaks existing operator behavior and can generate invalid COMPOSE_FILE entries.
Risk level: Medium
Mandatory gates:
- Duplicate/prior implementation: clear; I found no existing issue/PR for the same compose picker beyond this PR.
- Project standards: issue found; this changes deployment bootstrap semantics without preserving the existing env override/validation behavior.
- Strategic necessity: clear value, but the migration has to be backwards-compatible because this script sits in the deploy path.
- CI/checks: green
Findings: - Critical: none.
- Important: The script drops the existing GOCLAW_ENV_FILE override and hardcodes ENV_FILE to "$SCRIPT_DIR/.env". Existing automation that runs prepare-compose with a custom env file will silently update the wrong file, which is a deployment regression.
- Important: --generate writes relative paths using line#"$SCRIPT_DIR/", but find_compose_files is fed "$SCRIPT_DIR" while find can emit paths with a relative prefix in some invocations; entries can remain absolute in .env-compose, then COMPOSE_FILE gets absolute host paths. Docker Compose supports them, but this breaks the previous repo-relative env behavior and makes generated files non-portable.
- Important: The old no-arg path generated/validated/updated COMPOSE_FILE. The new no-arg path only prints help, so existing setup scripts or docs that call ./prepare-compose.sh as the update step will stop applying compose selection.
- Suggestion: Keep the old default behavior as a compatibility path, preserve GOCLAW_ENV_FILE, and add a shell test fixture for generate/update/check using a temporary env file before removing the symlink-based workflow.
Verdict: REQUEST_CHANGES
|
Maintainer follow-up: This PR has been open for ~7 weeks with CHANGES_REQUESTED since 2026-06-21. CI is green (go + web), and the PR is mergeable. The review raised three important items:
@keithy — are you planning to address these? The core idea is solid and the script is useful, but the backward-compat gaps need fixing before merge. Happy to help scope a minimal fix if needed. Posted by /github-maintain at 2026-06-26T09:15:00Z |
|
🦸♂️ Maintainer check-in — PR #1135 has been in CHANGES_REQUESTED state for 5 days (since 2026-06-21). The review feedback from @mrgoonie is specific and actionable:
These are backwards-compat issues in the deploy path, so they need fixing before merge. @keithy — are you still working on this? Happy to help clarify the review feedback if needed. Posted by github-maintain at 2026-06-26T11:55:00Z |
Summary
COMPOSE_FILE can be set (via .env) to chose a set of configuration files for docker-compose.
This is a single clean and simple bash script that searches for the available options, and offers the user the ability to edit the list.
This is simpler than previous approaches, and it is generic, it can be used by other docker-compose oriented projects.
compose.d/andcompose.options/symlink directories (tidier).env-composefile-based selection uncomment to enable files. (effectively a tmpfile)services:/networks:/volumes:) + naming (.= service,+= overlay)--generate,--edit,--update,--check,--filedocker/podman compose configviaDOCKER_CMDpostgres-low-cpu.yml→postgres+low-cpu.ymlOptions
--generate.env-composefrom available compose files--edit.env-composein$EDITOR, then apply to.env--update.env-composeto.env--check$DOCKER_CMD(default: docker)--file <f><f>to.env-compose, auto-runs--check+--updateTest plan
prepare-compose.sh --generatecreates.env-composeprepare-compose.sh --editopens editor and appliesprepare-compose.sh --checkvalidates with compose configprepare-compose.sh --file <f>copies file, checks, and updates