Skip to content

feat(graph): support multi-stamp execution graphs#250

Merged
geoberle merged 3 commits into
mainfrom
stamp-validation
Jul 9, 2026
Merged

feat(graph): support multi-stamp execution graphs#250
geoberle merged 3 commits into
mainfrom
stamp-validation

Conversation

@geoberle

@geoberle geoberle commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

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.Stamped changed to *bool — explicit false is preserved and validated, distinguishing "unset" from "intentionally not stamped".

What changed

  • ForEntrypoint / ForEntrypoints accept flat map[string]*Pipeline — stamped services appear once with an empty Stamp, suitable for runtimes that handle stamp expansion themselves (e.g. EV2).
  • ForStampedEntrypoints accepts stamp-keyed pipelines (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).
  • 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 empty stamp.
  • StepKey removedIdentifier used as map key for Steps.
  • GetResourceGroup narrowed to accept ResourceGroupKey instead of Identifier.
  • ConfigResolver.GetRegionConfiguration and ValueProvenance accept stamp and optional regionShort parameters for per-stamp re-templating.

Breaking changes

Breaking changes on Graph, ForEntrypoints (signature changed), and ForStampedEntrypoint (replaced by ForStampedEntrypoints).
Companion PRs to adapt:

Copilot AI review requested due to automatic review settings June 17, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.Stamped from bool to *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 introduced ForStampedEntrypoint + mergeStamped to merge per-stamp graphs.
  • Added ConfigResolver.GetRegionStampConfiguration to 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.

Comment thread pipelines/topology/types.go
Comment thread pipelines/graph/merge.go Outdated
Comment thread pipelines/graph/merge.go Outdated
Copilot AI review requested due to automatic review settings June 17, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/graph.go
Comment thread pipelines/graph/graph.go
Copilot AI review requested due to automatic review settings June 17, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread pipelines/topology/types.go
Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/graph.go
Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/graph.go Outdated
Comment thread config/config.go Outdated
Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/merge.go Outdated
Copilot AI review requested due to automatic review settings June 18, 2026 06:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings June 18, 2026 09:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread config/config.go Outdated
Copilot AI review requested due to automatic review settings June 18, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/graph.go
Copilot AI review requested due to automatic review settings June 25, 2026 14:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread pipelines/graph/graph.go
Comment thread pipelines/graph/graph.go
Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/testdata/zz_fixture_TestForEntrypoint.dot
Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/graph.go Outdated
Comment thread pipelines/graph/testdata/zz_fixture_TestStampedEntrypointDOT.dot Outdated
@geoberle geoberle force-pushed the stamp-validation branch from 74e83f2 to cfd83fc Compare July 7, 2026 06:55
Copilot AI review requested due to automatic review settings July 7, 2026 07:48
@geoberle geoberle force-pushed the stamp-validation branch from cfd83fc to 35a08c0 Compare July 7, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread pipelines/graph/graph.go
geoberle added 2 commits July 7, 2026 10:17
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.
@geoberle geoberle force-pushed the stamp-validation branch from 35a08c0 to 8fac4d9 Compare July 7, 2026 11:35
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".
Copilot AI review requested due to automatic review settings July 7, 2026 13:21
@geoberle geoberle force-pushed the stamp-validation branch from 8fac4d9 to 40c9276 Compare July 7, 2026 13:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread pipelines/graph/graph.go
@geoberle geoberle removed the hold label Jul 8, 2026
Comment thread pipelines/graph/testdata/zz_fixture_TestStampedEntrypointDOT.dot

@stevekuznetsov stevekuznetsov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm
/approve

@geoberle geoberle merged commit a31d75a into main Jul 9, 2026
3 checks passed
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.

3 participants