Skip to content

chore(infra): annotate compose services with profiles#6337

Merged
otavio merged 1 commit into
masterfrom
chore/compose-profiles-annotations
May 19, 2026
Merged

chore(infra): annotate compose services with profiles#6337
otavio merged 1 commit into
masterfrom
chore/compose-profiles-annotations

Conversation

@geovannewashington
Copy link
Copy Markdown
Member

What changed?

Added profiles: annotations to docker-compose.agent.yml,
docker-compose.mongo.yml, and docker-compose.postgres.yml.
Exports COMPOSE_PROFILES in bin/utils to activate them.

Why

Part of the compose wrapper refactor (shellhub-io/team/issues/111). This is the first
incremental step: profiles must be in place before the wrapper replacement lands in the next PR.

How to test

  1. Start the environment: ./bin/docker-compose up -d
  2. Confirm postgres is running and mongo is absent:
    docker compose ps
  3. Stop the environment: ./bin/docker-compose down
  4. Set SHELLHUB_DATABASE=mongo in .env.override
  5. Start again: ./bin/docker-compose up -d
  6. Confirm mongo is running and postgres is absent:
    docker compose ps
  7. Set SHELLHUB_ENV=development in .env.override, restart,
    confirm agent is running: docker compose ps
  8. Verify profiles are correctly annotated:
    ./bin/docker-compose config | grep -A2 'profiles:'

Add profiles: annotations to docker-compose.agent.yml,
docker-compose.mongo.yml, and docker-compose.postgres.yml, and
export COMPOSE_PROFILES in bin/utils to activate them.

The agent service is gated behind the agent profile, activated when
SHELLHUB_ENV=development. The mongo and postgres services are gated
behind their respective profiles, activated based on
SHELLHUB_DATABASE.

The required: false flag is added to depends_on entries pointing
at profiled services so Compose does not error when the profile is
inactive.

This is an additive change. The existing COMPOSE_FILE chain in
bin/utils is unchanged and the profiles are inert without
COMPOSE_PROFILES being set. bin/utils will be removed in the
follow-up PR.
@geovannewashington geovannewashington self-assigned this May 19, 2026
@geovannewashington geovannewashington requested a review from a team as a code owner May 19, 2026 18:16
@geovannewashington geovannewashington added area/docker kind/refactor docker Pull requests that update Docker code labels May 19, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Claude finished @geovannewashington's task in 3m 51s —— View job


Code Review Complete

Reviewed 4 files across code quality, security, testing, language patterns, and architecture — no issues found. The code looks good as-is.

Key observations from the review:

  • The PROFILES case statement correctly inherits the SHELLHUB_DATABASE fallback — the * case in the earlier block reassigns SHELLHUB_DATABASE="mongo" before the profiles logic runs, so the profile is always set consistently with COMPOSE_FILE.
  • required: false on depends_on is the correct semantic: "if the service is running, wait for it to be healthy; if it's not running, that's OK." This prevents errors when a profiled service is excluded.
  • No security concerns — COMPOSE_PROFILES is built entirely from hardcoded literals (agent, mongo, postgres).
  • No cross-repo impact — the cloud repo doesn't reference these profiled services directly.

If you push additional changes and want a new review, tag @shellhub-io/admin and a team member can trigger it.

@otavio otavio merged commit 50c9b3f into master May 19, 2026
22 checks passed
@otavio otavio deleted the chore/compose-profiles-annotations branch May 19, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker docker Pull requests that update Docker code kind/refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants