Skip to content

feat(prepare-compose): compose file picker#1135

Open
keithy wants to merge 1 commit into
nextlevelbuilder:mainfrom
keithy:feature/prepare-compose-script
Open

feat(prepare-compose): compose file picker#1135
keithy wants to merge 1 commit into
nextlevelbuilder:mainfrom
keithy:feature/prepare-compose-script

Conversation

@keithy

@keithy keithy commented May 9, 2026

Copy link
Copy Markdown
Contributor

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.

  • Removed: compose.d/ and compose.options/ symlink directories (tidier)
  • New: .env-compose file-based selection uncomment to enable files. (effectively a tmpfile)
  • Sections: ROOT (required), SERVICE (optional), OVERLAY (optional)
  • Detection: by content (services:/networks:/volumes:) + naming (. = service, + = overlay)
  • Options: --generate, --edit, --update, --check, --file
  • Validation: runs docker/podman compose config via DOCKER_CMD
  • Rename overlay example: postgres-low-cpu.ymlpostgres+low-cpu.yml

Options

Flag Description
--generate Create/replace .env-compose from available compose files
--edit Open .env-compose in $EDITOR, then apply to .env
--update Apply current .env-compose to .env
--check Validate compose config using $DOCKER_CMD (default: docker)
--file <f> Copy <f> to .env-compose, auto-runs --check + --update

Test plan

  • prepare-compose.sh --generate creates .env-compose
  • prepare-compose.sh --edit opens editor and applies
  • prepare-compose.sh --check validates with compose config
  • prepare-compose.sh --file <f> copies file, checks, and updates
  • Categories correctly separate root/service/overlay

@keithy

keithy commented May 11, 2026

Copy link
Copy Markdown
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

@keithy keithy closed this May 22, 2026
@keithy keithy reopened this May 22, 2026
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
@keithy keithy force-pushed the feature/prepare-compose-script branch from 8e7a9cd to c49253f Compare May 22, 2026 00:42
@keithy

keithy commented May 22, 2026

Copy link
Copy Markdown
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.

https://github.com/keithy/podclaws.git

@mrgoonie mrgoonie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants