feat(graph): support multi-stamp execution graphs#250
Merged
Conversation
ea75893 to
9a6cf99
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the pipelines graph tooling to represent and execute multi-stamp topologies by duplicating stamped services per stamp while deduplicating unstamped nodes. It also changes Service.Stamped to *bool to preserve explicit user intent (stamped: false) and introduces per-stamp keying in graph identifiers/metadata.
Changes:
- Changed
topology.Service.Stampedfromboolto*bool, updated stamping propagation, and added validation for explicit opt-outs under stamped parents. - Added stamp-aware graph identity (
Identifier.Stamp) plus composite keys for steps/resource groups, and introducedForStampedEntrypoint+mergeStampedto merge per-stamp graphs. - Added
ConfigResolver.GetRegionStampConfigurationto re-resolve configuration templates using a different stamp value.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pipelines/topology/types.go | Switches Stamped to pointer semantics and updates propagation/validation logic. |
| pipelines/topology/types_test.go | Adds/updates tests for pointer-based stamped propagation and validation cases. |
| pipelines/graph/graph.go | Introduces Stamp in identifiers and refactors graph lookups to use composite keys; adds ForStampedEntrypoint. |
| pipelines/graph/merge.go | Adds per-stamp graph merge implementation to combine per-stamp graphs into one execution graph. |
| pipelines/graph/merge_test.go | Adds tests for per-stamp merge behavior (node duplication, rewiring, and RG/step selection). |
| config/config.go | Adds API to resolve config for a region using an alternate stamp and stores resolver inputs for re-resolution. |
| config/config_test.go | Adds test coverage for stamp-specific config resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9a6cf99 to
5ad5152
Compare
5ad5152 to
cb0be5e
Compare
cb0be5e to
fc1c8c7
Compare
7 tasks
fc1c8c7 to
5f52dbb
Compare
3e08b9f to
1d214ad
Compare
1d214ad to
e63e2cb
Compare
7b31b0b to
961e693
Compare
961e693 to
74e83f2
Compare
74e83f2 to
cfd83fc
Compare
cfd83fc to
35a08c0
Compare
MarshalDOT now takes *Graph instead of individual field arguments, and resolves the actual resource group name from ResourceGroupMeta for node labels. Node IDs still use the internal key for stability. Extract dotID and dotLabel helpers for clearer separation of identity vs display concerns.
Move graph construction methods (accumulate, addExternalDependencyEdges, node) from *Graph to a private *graphBuilder that embeds *Graph and holds a transient nodeIndex. This keeps the exposed Graph struct free of build-time bookkeeping while enabling O(1) node lookups during construction.
35a08c0 to
8fac4d9
Compare
Stamp-aware graph construction: when a service is marked as stamped in
the topology, accumulate() expands it once per stamp during a single
tree walk. Unstamped services are processed once.
Key changes:
- Stamp type wraps stamp identity with Unstamped sentinel and IsSet().
- ForEntrypoints accepts stamp-keyed pipelines
(map[Stamp]map[string]*Pipeline). Non-stamped callers use
ForEntrypoint which wraps pipelines as {Unstamped: pipelines}.
- nodesFor bakes stamp into all Identifiers at creation (nodes, edges,
steps, validation steps, resource group keys).
- Leaf-to-root wiring between services is stamp-scoped: stamped parent
leaves connect only to same-stamp child roots. Unstamped parent
leaves fan out to all stamps.
- External dependency resolution inherits stamp from the declaring node
when the target service is stamped; unstamped targets keep Unstamped.
- ResourceGroupKey introduced to key resource groups by (Stamp, Name).
- Service.Stamped changed to *bool — explicit false preserved and
validated, distinguishing "unset" from "intentionally not stamped".
8fac4d9 to
40c9276
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.
Summary
Stamp-aware graph construction: when a service is marked as stamped in the topology,
accumulate()expands it once per stamp during a single tree walk. Unstamped services are processed once. No post-hoc merge pass needed.Service.Stampedchanged to*bool— explicitfalseis preserved and validated, distinguishing "unset" from "intentionally not stamped".What changed
map[string]*Pipeline— stamped services appear once with an empty Stamp, suitable for runtimes that handle stamp expansion themselves (e.g. EV2).map[string]map[string]*Pipeline) and expands stamped services once per stamp in the graph, suitable for runtimes where the graph drives per-stamp execution (e.g. templatize).Identifierused as map key forSteps.ResourceGroupKeyinstead ofIdentifier.Breaking changes
Breaking changes on
Graph,ForEntrypoints(signature changed), andForStampedEntrypoint(replaced byForStampedEntrypoints).Companion PRs to adapt: