Skip to content

feat: show images in SSH status, remove roles per run, reject unused --tag - #2

Merged
sandrinodm merged 1 commit into
mainfrom
feat/roles-followups
Nov 11, 2026
Merged

sandrinodm merged 1 commit into
mainfrom
feat/roles-followups

Conversation

@sandrinodm

Copy link
Copy Markdown
Owner

Follow-ups to #1, which added roles.

SSH status shows images

With execution: ssh and a managed secret source, status printed each container's service, state, health and exit code. It left out the image, so there was no way over SSH to see which role tag was running. It now includes image.

While adding the image, we found the redaction was too broad. It replaced every value from the stack .env, including plain environment settings. A setting like WEB_CONCURRENCY=2 turned shop-web:3f2a2b9 into ***-web:3f***a***b9, and POSTGRES_USER=postgres turned postgres:16 into ***:16.

  • Deploys now record the secret variable names (never values) as secretNames in .compoza.json. Status redacts only those values.
  • Stacks deployed by an earlier version have no secretNames, so they keep redacting every value until their next deploy.
  • Service and image patterns are anchored with \A…\z, so a trailing newline no longer passes.
  • Longer values are redacted before shorter ones, so overlapping values no longer leak.
  • A value that doesn't look like an image reference shows as (image).

Remove a role for one run

destinations:
  staging:
    composeFiles: [compose.staging.yaml]   # no worker service
    roles:
      worker: null
local:
  roles:
    worker: null

A removed role isn't built, imaged, Git-checked or validated against the Compose files. It gets no override entry and no metadata tag, and its secrets are no longer added to a 1Password variables allowlist. If the Compose files still declare the service, it runs as they define it.

  • Removals are checked when the config loads, for every destination, whether or not it is selected. A typo fails a plain check: Destination "staging" removes role "wrker", which is not a role; roles: web, worker.
  • null is only accepted under destination and local roles, not under the top-level roles.
  • With --destination staging --local, a role the destination removes stays removed. A local.roles null for it does nothing, and local.roles settings for it are ignored.

--tag

  • Any --tag fails when no role has a build, instead of being silently ignored: No role has a build, so there are no images to reuse; deploy without --tag.
  • Naming a role removed for this run fails with Role "worker" is removed for this run, so --tag cannot name it.

Testing

  • pnpm check passes.
  • pnpm test: 543 passed, 2 skipped.
  • pnpm pack plus pnpm test:package pass.
  • New tests cover:
    • status redaction: environment values left intact, secrets redacted in service and image, legacy metadata, trailing newlines, overlapping values
    • removal at load, including an unselected destination and deploy.yml
    • --destination combined with --local
    • the 1Password allowlist after a removal
    • the new --tag errors
  • Dry runs checked: a destination and local.roles both removing worker builds only web; --tag worker=abc on the removed role fails as above; a typo in a destination fails check.

No real SSH host was used; status redaction was tested with fake docker compose ps output.

Docs

docs/configuration.md, docs/secrets.md, docs/ssh-deployment.md, docs/commands.md, the status help text and both copies of the compoza skill describe the new behavior.

…--tag

- Managed SSH `status` includes each container's image. Only secret values
  are redacted now: deploys record the secret variable names (never values)
  in `.compoza.json`. Stacks deployed by earlier versions keep redacting
  every dotenv value. Service and image patterns are fully anchored, and
  longer values are redacted before shorter ones.
- `destinations.<name>.roles.<role>: null` and `local.roles.<role>: null`
  remove a role for that run: no build, image, Git check, validation,
  override entry or allowlisted secrets. Removals are checked when the
  config loads, including unselected destinations. A role the selected
  destination removes stays removed for `--local`.
- `--tag` fails when no role has a build, and naming a removed role says so.
@sandrinodm
sandrinodm merged commit 53086b4 into main Nov 11, 2026
3 checks passed
@sandrinodm
sandrinodm deleted the feat/roles-followups branch November 11, 2026 09:53
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.

1 participant