chore(infra): docker-compose wrapper rework + bats tests#6348
Conversation
|
Claude finished @gustavosbarreto's task in 3m 7s —— View job Code Review CompleteReviewed 13 files across code quality, security, testing, shell patterns, and architecture. 1 inline issue posted (1 high). The overall approach is solid — the move from The one issue found is an ordering regression in the To request another review round, comment |
66d9227 to
00f2325
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 3m 17s —— View job Code Review CompleteReviewed 13 files across code quality, security, testing, shell patterns, and architecture. 2 inline issues posted (2 high). The overall rework is a solid improvement — the explicit The two issues found are:
To request another review round, comment |
… env Rewrite bin/docker-compose as a single autonomous script. bin/utils and the readlink_f cross-platform workaround are gone. Env loading is delegated to Compose v2.24+ via COMPOSE_ENV_FILES; a small env_var helper reads flags from .env/.env.override in a subshell so the wrapper's environment is not polluted (preserves last-wins for COMPOSE_ENV_FILES). Extract enterprise-only defaults out of .env into a new .env.enterprise: admin credentials, SAML secret, web endpoints (8 vars), and object storage (5 vars). The wrapper auto-loads .env.enterprise when SHELLHUB_ENTERPRISE=true. Base .env now contains only CE settings. Add a guard that aborts the wrapper when SHELLHUB_CLOUD=true without SHELLHUB_ENTERPRISE=true, removing the silent enterprise auto-enable that previously came from cloud/.env. Drop the profiles annotations and /dev/null sentinel includes from the previous refactor; the COMPOSE_FILE chain is kept. Addresses team#111 problems 2 (silent cloud->enterprise coupling) and 3 (redundant SHELLHUB_CLOUD in cloud override).
Verify that bin/docker-compose builds the expected COMPOSE_FILE chain and COMPOSE_ENV_FILES list for each deploy scenario, and that the cloud-without-enterprise guard aborts. Tests stub `docker` in PATH so the wrapper's exec is captured without invoking Compose — we test the wrapper's decisions, not the Compose merge. Scenarios that require the cloud/ sibling repo live in with_cloud.bats and skip per test when ../cloud/ is absent. The compose-tests.yml workflow runs wrapper.bats on every PR that touches the wrapper, the env files, or the compose YAMLs.
ad3f3ea to
c6ae703
Compare
|
All three review findings addressed in 8d96d7e (squashed into the wrapper commit):
|
|
/review |
|
Claude finished @gustavosbarreto's task in 2m 42s —— View job Code Review CompleteReviewed 14 files across code quality, security, testing, shell patterns, and architecture — no issues found. The overall rework is well-executed. The three issues from the previous review rounds (override ordering, cloud file-existence guards, unwanted mongo container) are all confirmed fixed. Specific observations:
To request another review round, comment |
Summary
bin/docker-composeinto an autonomous script; deletebin/utils. Replaceset -o allexportsourcing with anenv_varsubshell helper so the wrapper does not pollute its shell, preservingCOMPOSE_ENV_FILESlast-wins semantics with the cloud env files..envinto a new.env.enterprise, loaded automatically whenSHELLHUB_ENTERPRISE=true. Base.envbecomes CE-only. The enterprise file lives in the public repo so a CE user can upgrade to Enterprise by flippingSHELLHUB_ENTERPRISE=truein.env.overrideand providing registry credentials, no re-clone needed.SHELLHUB_CLOUD=truewithoutSHELLHUB_ENTERPRISE=true, removing the silent coupling that used to come fromcloud/.envhardcodingSHELLHUB_ENTERPRISE=true.COMPOSE_FILEchain as the composition mechanism.tests/compose/covering wrapper decisions (COMPOSE_FILE chain, COMPOSE_ENV_FILES composition, guard) without invoking Compose. Cloud-dependent scenarios live inwith_cloud.batsand skip when../cloud/is absent. Newcompose-tests.ymlworkflow runswrapper.batson every PR that touches the wrapper, env files, or compose YAMLs.The matching env cleanup on the cloud side is at shellhub-io/cloud#2375.