Class CascadeAssembler

java.lang.Object
network.ike.workspace.cascade.CascadeAssembler

public final class CascadeAssembler extends Object
Assembles the full IKE release cascade graph by traversing the per-project release-cascade.yaml manifests (IKE-Network/ike-issues#420).

The cascade is a loosely-coupled distributed system: each project version-controls only its own upstream/downstream edges. This assembler starts from one project, follows every edge to its neighbours (resolving each neighbour's manifest through a caller-supplied CascadeAssembler.CascadeResolver), and stitches the result into a single topologically ordered ReleaseCascade.

Two consistency rules are enforced during assembly:

  • Edge reciprocity — if project A names B as downstream, B must name A as upstream, and vice versa. A one-sided edge is a manifest error.
  • Acyclicity — the consume relation must be a DAG; a cycle has no release order.
  • Method Details

    • assemble

      public static ReleaseCascade assemble(CascadeEdge start, ProjectCascade startCascade, CascadeAssembler.CascadeResolver resolver)
      Assembles the cascade graph rooted at one known project, without populating RepositoryKey on the nodes.
      Parameters:
      start - an edge identifying the starting project — its coordinates and locators (groupId, artifactId, repo, url); kind is unused
      startCascade - the starting project's already-parsed manifest
      resolver - resolves every other project's manifest
      Returns:
      the assembled, topologically ordered cascade
      Throws:
      IllegalArgumentException - if an edge is one-sided or the graph contains a cycle
    • assemble

      public static ReleaseCascade assemble(CascadeEdge start, ProjectCascade startCascade, CascadeAssembler.CascadeResolver resolver, RepositoryKeyResolver repositoryResolver)
      Assembles the cascade graph rooted at one known project, populating each node's RepositoryKey via repositoryResolver when supplied (IKE-Network/ike-issues#496 part C).
      Parameters:
      start - an identifying edge for the starting project
      startCascade - the starting project's parsed manifest
      resolver - resolves every other project's manifest
      repositoryResolver - maps a coordinate to its RepositoryKey; may be null to leave keys unset on the assembled nodes
      Returns:
      the assembled, topologically ordered cascade
      Throws:
      IllegalArgumentException - if an edge is one-sided or the graph contains a cycle