Enum Class PreflightCondition
- All Implemented Interfaces:
Serializable, Comparable<PreflightCondition>, Constable
ws:* goals can
require before they mutate workspace state. Each entry declares a
human-readable description and a check(PreflightContext)
implementation that returns Optional.empty() on success or a
remediation message on failure.
Drafts and publishes invoke the same PreflightCondition
sequence via Preflight; whether failure is a warning (draft)
or a hard error (publish) is decided at the call site via
PreflightResult.requirePassed(WsGoal) vs
PreflightResult.warnIfFailed(Log, WsGoal).
New conditions are added here as goals adopt the contract from
issue #154. Each new entry must stay self-contained: it does not
depend on the mojo instance, only on the shared PreflightContext.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEvery cloned subproject's three branch axes agree: theworkspace.yamlbranch:declaration, the on-disk checkout, and the.ike/vcs-staterecord.No.mvn/jvm.configfile in the workspace root or any subproject may contain a line starting with#.No releasing member's POMs — every module, profiles included — may carry a literal-SNAPSHOTversion on a dependency, parent, or plugin reference the mission does not itself resolve (ike-issues#1022).No subproject's<properties>block may declare a locally-overriding value for any IKE-foundation property name (#346, surfaced by theits/pom property-shadowing in the v150 cascade).No on-disk gh-pages-style site output leaks at<projectDir>/<artifactId>/<artifactId>/index.html— whether or not git tracks them.No subproject root POM (nor the workspace root) declares a<distributionManagement><site><url>starting withscpexe://— that wagon was retired in ike-issues#304 in favor of the GitHub Pages publish path (https://ike.network/<repo>/via the org CNAME).No<properties>entry in any subproject root POM may hold a value ending in-SNAPSHOT.When a subproject's<parent>declares the same GA as the workspace aggregator's own<parent>, enforce the two coherence rules from #324:<parent><version>matches the workspace's.<parent>block includes an empty<relativePath/>to prevent the Maven 4 parent-mission error.Every member with anoriginremote — and the workspace root itself — must accept a push from this operator, established by agit push --dry-runthat transfers nothing and creates no refs (IKE-Network/ike-issues#960).Every workspace subproject's root POM must either declare<distributionManagement>locally or have a<parent>block to inherit from (#346, surfaced by #343 whenits/was missing both).Every subproject working tree (and the workspace root itself, if it is a git repo) must have no uncommitted changes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSpecial marker used when the workspace root itself has uncommitted changes. -
Method Summary
Modifier and TypeMethodDescriptioncheck(PreflightContext ctx) Evaluate the condition against the given context.Short human description of what this condition enforces.static PreflightConditionReturns the enum constant of this class with the specified name.static PreflightCondition[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WORKING_TREE_CLEAN
Every subproject working tree (and the workspace root itself, if it is a git repo) must have no uncommitted changes. Any draft or publish goal that creates branches, edits POMs, or otherwise mutates files requires this. -
NO_SNAPSHOT_PROPERTIES
No<properties>entry in any subproject root POM may hold a value ending in-SNAPSHOT. Maven 4's consumer POM flattener resolves properties and promotes<pluginManagement>into<plugins>when writing the released artifact — a SNAPSHOT property value would then be baked in as a literal and break downstream consumers (e.g.<ike-tooling.version>112-SNAPSHOTleaking into releasedike-parent-105.pom). This check forces the release operator to bump the property to a released version before cutting the release. -
NO_EXTERNAL_SNAPSHOT_DEPENDENCIES
No releasing member's POMs — every module, profiles included — may carry a literal-SNAPSHOTversion on a dependency, parent, or plugin reference the mission does not itself resolve (ike-issues#1022).The property channel is guarded by
NO_SNAPSHOT_PROPERTIES; this is the literal channel. A released POM naming an external SNAPSHOT is not repository-true: it builds only where a local repository happens to cache the snapshot — which is how komet-desktop shipped two releases pinningdev.ikm.jpms:rocksdbjni-jpms 10.4.2-r1-SNAPSHOT, an artifact that never released anywhere (ike-issues#1021), while warm caches kept every machine green and the cold CI agent alone resolved honestly.Exempt, because the mission resolves them before anything deploys: references to artifacts this mission's release plan de-qualifies (retargeted by the version pass), and references to coordinates produced inside the same repository (the member's own version pass moves those). Bystanders' POMs are not scanned — they do not deploy this mission. Without a release set the condition is inert: development trees legitimately reference snapshots.
-
JVM_CONFIG_NO_HASH_COMMENTS
No.mvn/jvm.configfile in the workspace root or any subproject may contain a line starting with#.Maven parses
.mvn/jvm.configas raw JVM arguments — one token per line, with no comment syntax. A#at column 0 is passed to the JVM launcher as a main-class name and IntelliJ surfaces it asError: Could not find or load main class #. The fix is to delete the offending line; comments belong in.mvn/jvm.config.notesor similar adjacent files.This is the gate referenced in ike-issues#217. The check fires before the bad file can propagate to git or Syncthing — Maven's own
validatephase can't catch this in the project that contains the bad file because the JVM dies before plugin code runs. -
SUBPROJECT_HAS_DISTRIBUTION_MANAGEMENT
Every workspace subproject's root POM must either declare<distributionManagement>locally or have a<parent>block to inherit from (#346, surfaced by #343 whenits/was missing both).Site goals — specifically
site:stage, which the workspace release cascade runs — fail with "Missing distribution management in project ..." when neither is present. That failure surfaces deep inside the release flow, after some subprojects have already tagged. This preflight catches the missing declaration upfront so the release-draft is authoritative. -
NO_FOUNDATION_PROPERTY_SHADOWING
No subproject's<properties>block may declare a locally-overriding value for any IKE-foundation property name (#346, surfaced by theits/pom property-shadowing in the v150 cascade).Foundation properties (
ike-tooling.version,ike-docs.version,ike-platform.version) are set byike-parent's inheritance chain. Local overrides silently shadow the workspace's intended versions and pin plugins to old releases that may lack newer goals. Preferred discipline: namespace local overrides underit.*,local.*, or a project-specific prefix that doesn't collide with the foundation set. -
NO_ON_DISK_GHPAGES_LEAK
No on-disk gh-pages-style site output leaks at<projectDir>/<artifactId>/<artifactId>/index.html— whether or not git tracks them.Why this exists despite
WORKING_TREE_CLEANalready detecting committed leaks: once an operator adds.gitignoreentries (the standing workaround in ike-issues#358), the leak files are no longer reported bygit status, soWORKING_TREE_CLEANthinks the tree is clean — but the files keep getting regenerated under the working tree on every release flow. This check scans the filesystem directly so the operator sees the leak even when git has been told to ignore it.Pattern: a directory named exactly the same as a known cascade artifactId living inside another directory named the same, containing an
index.html— signature of anmvn siterender that escapedtarget/. We check both the workspace root (where workspace-root and subproject artifactIds can both shadow) and each subproject root. ike-issues#358. -
NO_SCPEXE_SITE_URLS
No subproject root POM (nor the workspace root) declares a<distributionManagement><site><url>starting withscpexe://— that wagon was retired in ike-issues#304 in favor of the GitHub Pages publish path (https://ike.network/<repo>/via the org CNAME).A surviving
scpexe://is a silent release-blocker: the goal that consumes the URL only fails at the step that tries to use the wagon, after subproject releases have already started. This check catches it at draft time so the operator fixes the URL before any tags ship.ike-issues#372.
-
PARENT_COHERENCE
When a subproject's<parent>declares the same GA as the workspace aggregator's own<parent>, enforce the two coherence rules from #324:<parent><version>matches the workspace's.<parent>block includes an empty<relativePath/>to prevent the Maven 4 parent-mission error.
This preflight is the release-gate analog of
ws:scaffold-draft's coherence check (#324; folded from the retiredws:verifyper #393). The scaffold-draft check warns; the preflight blocks. Composed via Preflight so release-draft surfaces it as a warning and release-publish promotes it to a hard error. -
BRANCH_COHERENCE
Every cloned subproject's three branch axes agree: theworkspace.yamlbranch:declaration, the on-disk checkout, and the.ike/vcs-staterecord. The three drifted silently for a week on ike-starter-set — manifest declared a feature branch while checkout and state file sat onmain, and the VCS-bridge sync actively enforced the state file OVER the manifest (IKE-Network/ike-issues#904). Surfaced warn-only on every goal byAbstractWorkspaceMojo;ws:lintreports it with the rest of the conditions. -
PUSH_ACCESS
Every member with anoriginremote — and the workspace root itself — must accept a push from this operator, established by agit push --dry-runthat transfers nothing and creates no refs (IKE-Network/ike-issues#960).Every other condition here inspects local state. This one alone asks the remote a question only the remote can answer, because a goal that ends in "push every member" can otherwise discover unwritability only after it has already squashed, rewritten
workspace.yaml, committed, and pushed the members it could write — which is exactly how afeature-finish-squash-publishagainstike-komet-wsrstranded a half-landed working set. A mixed-org working set (members under one org, the root under another) makes partial-permission the normal case, not an exotic one.Read probes cannot substitute:
ls-remoteand theremoteSha()calls already in the finish path authenticate and prove read access, which on a public repo succeeds for an operator who cannot write — reporting green on a run that cannot complete.Costs one network round-trip per member, so it belongs on goals that are about to do far more network work anyway.
-
-
Field Details
-
WORKSPACE_ROOT_NAME
Special marker used when the workspace root itself has uncommitted changes.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
description
Short human description of what this condition enforces. -
check
Evaluate the condition against the given context.- Parameters:
ctx- the preflight context- Returns:
Optional.empty()if the condition is satisfied; a remediation message otherwise
-