Class CohortResolver

java.lang.Object
network.ike.workspace.CohortResolver

public final class CohortResolver extends Object
Resolves the Cohort an artifact / release-style workspace verb acts on, from a starting directory (IKE-Network/ike-issues#610, under #601).

Searches upward for a workspace.yaml. When found, the cohort is the workspace's subprojects in topological order — the aggregator root is excluded, as it is not a released artifact. When not found, the cohort is the single repository at the start directory: a cohort of one. This is the home for the "single repo vs workspace" decision that artifact goals — the bare mode of ws:release / ws:scaffold (#605/#607) — make for themselves today; the migration in ike-issues#612 folds them onto it.

The decentralized cohort (the foundation cascade, assembled from release-cascade.yaml) is modelled by ReleaseCascade — already a topologically-ordered list; expressing it as a Cohort is a follow-on as the foundation cascade adopts this type.

  • Method Details

    • resolve

      public static Cohort resolve(Path startDir)
      Resolve the cohort from a starting directory.
      Parameters:
      startDir - the directory to resolve from (typically the CWD)
      Returns:
      the workspace cohort when a workspace.yaml is found at or above startDir; otherwise the single-repository cohort of one rooted at startDir
    • singleRepo

      public static Cohort singleRepo(Path dir)
      Build a single-repository cohort of one rooted at dir.
      Parameters:
      dir - the repository directory
      Returns:
      the cohort of one