Skip to content

feat: support compose-style interpolation in x-topo attributes - #413

Open
awphi wants to merge 1 commit into
mainfrom
target-interpolation
Open

feat: support compose-style interpolation in x-topo attributes#413
awphi wants to merge 1 commit into
mainfrom
target-interpolation

Conversation

@awphi

@awphi awphi commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Adds support for compose-style env var interpolation inside x-topo.deployment_success_message
  • Injects two new env vars when running compose.ReadProject in the post deploy step:
    • TOPO_TARGET: the selected target for deploy/stop/ps
    • TOPO_TARGET_HOSTNAME: the ssh -G-resolved HostName of the selected target
name: test-project
services:
  app:
    image: nginx
x-topo:
  deployment_success_message: "${COMPOSE_PROJECT_NAME} is available at http://${TOPO_TARGET_HOSTNAME}:${APP_PORT:-8080}"

Checklist

  • 🤖 This change is covered by tests as required.
  • 🤹 All required manual testing has been performed.
  • 📖 All documentation updates are complete.

@awphi
awphi marked this pull request as ready for review August 18, 2026 10:05
@awphi
awphi requested a review from a team as a code owner August 18, 2026 10:05
@muchzill4

Copy link
Copy Markdown
Contributor

Wonder if we should scope it to success_message for now. It’s nice to keep the behaviour consistent, but using TOPO_TARGET_HOSTNAME anywhere else sounds a bit nuts.

Open http://${TOPO_TARGET_HOSTNAME:-localhost}:${WEB_PORT:-8080}
```

The `localhost` default keeps the Project usable with plain `docker compose`, where Topo does not provide `TOPO_TARGET_HOSTNAME`.

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.

docker compose doesn’t read x-topo anyway, so no need for a default.

@awphi
awphi marked this pull request as draft August 18, 2026 15:13
Signed-off-by: awphi <26072111+awphi@users.noreply.github.com>
@awphi
awphi force-pushed the target-interpolation branch from cd18cdc to b15bae4 Compare August 18, 2026 15:50
@awphi
awphi marked this pull request as ready for review August 18, 2026 15:51
@awphi
awphi requested a review from muchzill4 August 18, 2026 15:52
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