refactor: NewGraph stops mutating the project - #14124
Open
ndeloof wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
newgraph-stops-mutating
branch
from
August 26, 2026 08:57
40a1179 to
deb2d77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building the dependency graph silently deleted unresolvable optional
depends_onreferences from the caller's project — and sinceDependsOnis 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 —createandstart— before the graph, the dependency waits and thecom.docker.compose.depends_onlabel read the model.NewGraphnow 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.WithoutUnresolvedOptionalDependenciesfrom 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