Class FoundationBaker

java.lang.Object
network.ike.plugin.scaffold.FoundationBaker

public final class FoundationBaker extends Object
Release-time refresh of the scaffold manifest's foundation: block (IKE-Network/ike-issues#414).

The foundation: block in ike-build-standards/src/main/scaffold/scaffold-manifest.yaml is the tested-together compatibility snapshot a consumer picks up with a given ike-tooling scaffold. ike-tooling.version is filtered from ${project.version} and so is always correct; ike-parent, ike-docs, and ike-platform were hand-maintained literals. This class resolves their latest released (GA) versions from the configured remote repositories and rewrites the block, so the scaffold zip always ships a current snapshot without a manual edit.

This is the discovery half of foundation currency — the scaffold foundation: block can only propagate a snapshot, it cannot find out a newer upstream version exists. Moving discovery to release-time bake here is what lets the scaffold mechanism own foundation currency end to end (the precondition for retiring the versions-upgrade subsystem, ike-issues#415).

  • Field Details

  • Method Details

    • assess

      Assess every baked foundation pin against the latest GA versions the resolver can see.

      Two coordinates are resolved, not three: ike-parent and ike-docs. The ike-platform.version pin shares the unified ike-platform reactor version with ike-parent, so its FoundationBaker.Finding is derived from the same resolution rather than queried separately.

      Parameters:
      foundation - the manifest's current foundation: block
      resolver - resolves released versions for a coordinate
      Returns:
      one FoundationBaker.Finding per pin, in ike-parent, ike-docs, ike-platform order
    • latestFoundation

      public static ScaffoldManifest.Foundation latestFoundation(ScaffoldManifest.Foundation baked, CandidateVersionResolver resolver)
      Resolve the latest released versions for every foundation pin and return a ScaffoldManifest.Foundation carrying them — the input snapshot with each version advanced to the latest GA the resolver can see.

      The consumer-side counterpart to assess(ScaffoldManifest.Foundation, CandidateVersionResolver): it lets ike:scaffold-publish's opt-in resolve-latest mode apply current foundation pins instead of the (possibly stale, parent-pinned) snapshot baked into the scaffold zip — the escape hatch for the bootstrap loop where a consumer's scaffold tooling is itself gated by the ike-parent it needs to bump.

      A pin is only advanced, never lowered: when the resolved GA is not newer than the baked value, or cannot be resolved, the baked value is kept. A value containing ${...} is left verbatim.

      Parameters:
      baked - the foundation snapshot from the scaffold zip
      resolver - resolves released versions for a coordinate
      Returns:
      a foundation with each pin at the latest released version
    • rewrite

      public static String rewrite(String manifestYaml, List<FoundationBaker.Finding> findings)
      Rewrite the foundation: block of a scaffold-manifest YAML document, applying every FoundationBaker.Status.AHEAD finding. Only the version values change — comments, indentation, key order, and the rest of the document are byte-preserved.
      Parameters:
      manifestYaml - the full scaffold-manifest.yaml content
      findings - the assessment from assess(ScaffoldManifest.Foundation, CandidateVersionResolver)
      Returns:
      the rewritten content; identical to the input when no finding is FoundationBaker.Status.AHEAD