Skip to content

refactor: NewGraph stops mutating the project - #14124

Open
ndeloof wants to merge 1 commit into
mainfrom
newgraph-stops-mutating
Open

refactor: NewGraph stops mutating the project#14124
ndeloof wants to merge 1 commit into
mainfrom
newgraph-stops-mutating

Conversation

@ndeloof

@ndeloof ndeloof commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Building the dependency graph silently deleted unresolvable optional depends_on references from the caller's project — and since DependsOn is a map, even from projects sharing it. What later readers observed depended on how many graphs had been built before them.

The pruning becomes an explicit step (withoutUnresolvedOptionalDependencies), applied once where the project consumed by the engines is established — create and start — before the graph, the dependency waits and the com.docker.compose.depends_on label read the model. NewGraph now just skips the edge; required dangling references still flow to its existing errors (naming the profiles that would enable the dependency). No behavior change.

Epic #14081, Lot 0 step 4 — precondition for a canonical project object across plan phases. Uses Project.WithoutUnresolvedOptionalDependencies from compose-spec/compose-go#922 (merged); go.mod is bumped to the post-merge commit — to be re-pinned on the next compose-go release.

🤖 Generated with Claude Code

Building the dependency graph silently deleted unresolvable optional
depends_on references from the caller's project — and since DependsOn
is a map, even from projects sharing it. What later readers observed
depended on how many graphs had been built before them.

The pruning becomes an explicit step, applied once where the project
consumed by the engines is established — create and start — before the
graph, the dependency waits and the com.docker.compose.depends_on
label read the model, using Project.WithoutUnresolvedOptionalDependencies
introduced by compose-spec/compose-go#922 (go.mod bumped to the
post-merge commit). NewGraph now just skips the edge; required dangling
references still flow to its existing errors (naming the profiles that
would enable the dependency).

No behavior change; epic #14081, Lot 0 step 4 — precondition for a
canonical project object across plan phases.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof force-pushed the newgraph-stops-mutating branch from 40a1179 to deb2d77 Compare August 26, 2026 08:57
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