Skip to content

Normalize Compose service additional contexts in bake#523

Merged
PedroGuerraPT merged 2 commits into
mainfrom
codex/compose-service-additional-contexts
Jul 1, 2026
Merged

Normalize Compose service additional contexts in bake#523
PedroGuerraPT merged 2 commits into
mainfrom
codex/compose-service-additional-contexts

Conversation

@PedroGuerraPT

@PedroGuerraPT PedroGuerraPT commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Translate Compose additional_contexts values like service:api.docs into generated bake target links like target:api_docs.
  • Preserve non-service additional contexts unchanged.
  • Add regression coverage for linked Compose build targets.

Test plan

  • GOCACHE=/private/tmp/go-cache go test ./pkg/buildx/bake

Support thread: T-9318


Note

Low Risk
Scoped to compose bake target generation and additional context mapping; behavior change only affects service: additional context values.

Overview
Compose-to-bake conversion now rewrites additional_contexts entries that reference another service (e.g. service:api.docs) into bake target: links that match sanitized target names (e.g. target:api_docs). Path and other non-service values are left unchanged.

Service-to-target naming is built once via composeBuildTargetNames and reused when emitting targets, so linked contexts stay consistent with how compose services become bake targets (including dot-to-underscore sanitization). A regression test covers a service-linked context plus a local path context.

Reviewed by Cursor Bugbot for commit 138f26b. Bugbot is set up for automated code reviews on this repo. Configure here.

@PedroGuerraPT
PedroGuerraPT marked this pull request as ready for review June 30, 2026 10:11
@PedroGuerraPT

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 138f26b37c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@PedroGuerraPT

Copy link
Copy Markdown
Contributor Author

@BugBot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 138f26b. Configure here.

@PedroGuerraPT
PedroGuerraPT merged commit 1bccd48 into main Jul 1, 2026
12 checks passed
@PedroGuerraPT
PedroGuerraPT deleted the codex/compose-service-additional-contexts branch July 1, 2026 16:39
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