feat(prepare-compose): compose file picker#1135
Open
keithy wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
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: https://github.com/keithy/goclaw/tree/main+essential-prs |
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
Contributor
Author
|
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
requested changes
Jun 21, 2026
mrgoonie
left a comment
Contributor
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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