Class FoundationBaker
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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA foundation artifact whose pin is baked at release time.static final recordThe assessment of one foundation pin.static enumClassification of a foundation pin against its latest GA. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FoundationBaker.Coordinateike-docs— theike-docs.versionproperty pin.static final FoundationBaker.Coordinateike-parent— carried in thefoundation.parentblock.static final FoundationBaker.Coordinateike-platform— theike-platform.versionpin.static final FoundationBaker.Coordinateike-tooling— tracks theike-tooling.versionproperty pin (the version lineike-build-standards,ike-maven-pluginand the rest of the ike-tooling reactor share). -
Method Summary
Modifier and TypeMethodDescriptionstatic List<FoundationBaker.Finding> assess(ScaffoldManifest.Foundation foundation, CandidateVersionResolver resolver) Assess every baked foundation pin against the latest GA versions the resolver can see.static ScaffoldManifest.FoundationlatestFoundation(ScaffoldManifest.Foundation baked, CandidateVersionResolver resolver) Resolve the latest released versions for every foundation pin and return aScaffoldManifest.Foundationcarrying them — the input snapshot with each version advanced to the latest GA the resolver can see.static Stringrewrite(String manifestYaml, List<FoundationBaker.Finding> findings) Rewrite thefoundation:block of a scaffold-manifest YAML document, applying everyFoundationBaker.Status.AHEADfinding.
-
Field Details
-
IKE_PARENT
ike-parent— carried in thefoundation.parentblock.ike-tooling.versionis deliberately absent: it is filtered from${project.version}and never baked. -
IKE_DOCS
ike-docs— theike-docs.versionproperty pin. -
IKE_PLATFORM
ike-platform— theike-platform.versionpin.ike-parent,ike-bom,ike-workspace-maven-pluginand thenetwork.ike.platform:ike-platformreactor root all share one unified version, so this pin andIKE_PARENTalways resolve to the same release.assess(ScaffoldManifest.Foundation, CandidateVersionResolver)queriesike-parentonce and answers both — thegroupId/artifactIdhere document what the pin tracks but are not resolved independently. -
IKE_TOOLING
ike-tooling— tracks theike-tooling.versionproperty pin (the version lineike-build-standards,ike-maven-pluginand the rest of the ike-tooling reactor share). Resolved only for the consumer-sidelatestFoundation(ScaffoldManifest.Foundation, CandidateVersionResolver)path; the release-timeassess(ScaffoldManifest.Foundation, CandidateVersionResolver)never touches it — there it is${project.version}, correct by construction.
-
-
Method Details
-
assess
public static List<FoundationBaker.Finding> assess(ScaffoldManifest.Foundation foundation, CandidateVersionResolver resolver) Assess every baked foundation pin against the latest GA versions the resolver can see.Two coordinates are resolved, not three:
ike-parentandike-docs. Theike-platform.versionpin shares the unified ike-platform reactor version withike-parent, so itsFoundationBaker.Findingis derived from the same resolution rather than queried separately.- Parameters:
foundation- the manifest's currentfoundation:blockresolver- resolves released versions for a coordinate- Returns:
- one
FoundationBaker.Findingper pin, inike-parent, ike-docs, ike-platformorder
-
latestFoundation
public static ScaffoldManifest.Foundation latestFoundation(ScaffoldManifest.Foundation baked, CandidateVersionResolver resolver) Resolve the latest released versions for every foundation pin and return aScaffoldManifest.Foundationcarrying 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 letsike: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 theike-parentit 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 zipresolver- resolves released versions for a coordinate- Returns:
- a foundation with each pin at the latest released version
-
rewrite
Rewrite thefoundation:block of a scaffold-manifest YAML document, applying everyFoundationBaker.Status.AHEADfinding. 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 contentfindings- the assessment fromassess(ScaffoldManifest.Foundation, CandidateVersionResolver)- Returns:
- the rewritten content; identical to the input when no
finding is
FoundationBaker.Status.AHEAD
-