Skip to content

chore: test compose-spec/compose-go#874 (v3 yaml.Node-based loader) — DO NOT MERGE#13799

Draft
ndeloof wants to merge 3 commits into
docker:mainfrom
ndeloof:test-compose-go-v3
Draft

chore: test compose-spec/compose-go#874 (v3 yaml.Node-based loader) — DO NOT MERGE#13799
ndeloof wants to merge 3 commits into
docker:mainfrom
ndeloof:test-compose-go-v3

Conversation

@ndeloof
Copy link
Copy Markdown
Contributor

@ndeloof ndeloof commented May 20, 2026

Summary

  • Adds a replace in go.mod pointing github.com/compose-spec/compose-go/v3 to the head of compose-spec/compose-go#874 (commit 2609dbcc99e81731403cb612d3e272cd8ffd5989 from ndeloof/compose-go@v3-yaml-node-context).
  • Mass-rewrites every import from compose-spec/compose-go/v2 to /v3 (72 files).
  • Local make build and golangci-lint run --build-tags e2e ./... both pass.

Why

Exploratory branch to validate the upstream v3 loader refactor (yaml.Node based loader with preserved context) against the full Compose test matrix and CI environment before the v3 cut-over.

DO NOT MERGE — this is a CI probe and the replace target is a feature branch.

Test plan

  • CI green on this draft
  • No regressions in unit/integration tests vs. main

@ndeloof ndeloof force-pushed the test-compose-go-v3 branch from 81c1f0a to becc8da Compare May 20, 2026 16:10
ndeloof added a commit to ndeloof/compose-go that referenced this pull request May 20, 2026
Three regressions reported when bumping docker/compose to compose-go v3:

1. TestSecretFromInclude — a variable provided by include.env_file that
   interpolates a field of the included tree (e.g. the file path of a
   secret) was lost because interpolation happened post-merge and nodes
   reshaped by specialized mergers no longer carried the include context.
   Interpolation now runs on each layer before merge using the layer
   NodeContext.Env, so variables from include.env_file are resolved
   against the right environment.

2. TestPublishChecks/refuse_to_publish_with_local_include — the
   "include" Listener event used by docker compose publish to detect
   local includes was not emitted by the v3 loader. loadIncludeEntry
   now calls opts.ProcessEvent("include", {path, workingdir}) for every
   include entry, matching loader/include.go.

3. TestPublish (OCI extends round-trip) — extending a service declared
   in a remote-loaded compose file (typically resolved through a hashed
   OCI path) must propagate the base service fields (image, command, ...)
   into the extender and clear the extends key so a downstream publish
   then reload without the loader still works. The existing pipeline
   already produced the right shape; the test
   TestExtends_RemoteResource_RoundTrip locks that behaviour.

Tests added:
- TestInclude_EnvFile_InterpolatesIncludedSecret
- TestInclude_EmitsIncludeListenerEvent
- TestExtends_RemoteResource_PropagatesImage
- TestExtends_RemoteResource_RoundTrip

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a go.mod `replace` directive pointing the compose-go dependency at
ndeloof/compose-go branch `v3-yaml-node-context` (PR
compose-spec/compose-go#874) and migrate all imports from
`compose-spec/compose-go/v2` to `/v3`.

DO NOT MERGE — exploratory branch to validate CI against the v3
loader refactor.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof force-pushed the test-compose-go-v3 branch from becc8da to c294b15 Compare May 20, 2026 16:44
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof force-pushed the test-compose-go-v3 branch from 9b241ee to 7f21c08 Compare May 20, 2026 20:15
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/compose/compose.go 66.66% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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