Enum Class PreflightCondition

java.lang.Object
java.lang.Enum<PreflightCondition>
network.ike.plugin.ws.preflight.PreflightCondition
All Implemented Interfaces:
Serializable, Comparable<PreflightCondition>, Constable

public enum PreflightCondition extends Enum<PreflightCondition>
Closed vocabulary of preflight checks that 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 Constants
    Enum Constant
    Description
    Every cloned subproject's three branch axes agree: the workspace.yaml branch: declaration, the on-disk checkout, and the .ike/vcs-state record.
    No .mvn/jvm.config file 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 -SNAPSHOT version 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 the its/ 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 with scpexe:// — 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 an origin remote — and the workspace root itself — must accept a push from this operator, established by a git push --dry-run that 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 when its/ 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Special marker used when the workspace root itself has uncommitted changes.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Optional<String>
    Evaluate the condition against the given context.
    Short human description of what this condition enforces.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • WORKING_TREE_CLEAN

      public static final PreflightCondition 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

      public static final PreflightCondition 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-SNAPSHOT leaking into released ike-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

      public static final PreflightCondition NO_EXTERNAL_SNAPSHOT_DEPENDENCIES
      No releasing member's POMs — every module, profiles included — may carry a literal -SNAPSHOT version 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 pinning dev.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

      public static final PreflightCondition JVM_CONFIG_NO_HASH_COMMENTS
      No .mvn/jvm.config file in the workspace root or any subproject may contain a line starting with #.

      Maven parses .mvn/jvm.config as 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 as Error: Could not find or load main class #. The fix is to delete the offending line; comments belong in .mvn/jvm.config.notes or 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 validate phase can't catch this in the project that contains the bad file because the JVM dies before plugin code runs.

    • SUBPROJECT_HAS_DISTRIBUTION_MANAGEMENT

      public static final PreflightCondition 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 when its/ 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

      public static final PreflightCondition NO_FOUNDATION_PROPERTY_SHADOWING
      No subproject's <properties> block may declare a locally-overriding value for any IKE-foundation property name (#346, surfaced by the its/ pom property-shadowing in the v150 cascade).

      Foundation properties ( ike-tooling.version, ike-docs.version, ike-platform.version) are set by ike-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 under it.*, local.*, or a project-specific prefix that doesn't collide with the foundation set.

    • NO_ON_DISK_GHPAGES_LEAK

      public static final PreflightCondition 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_CLEAN already detecting committed leaks: once an operator adds .gitignore entries (the standing workaround in ike-issues#358), the leak files are no longer reported by git status, so WORKING_TREE_CLEAN thinks 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 an mvn site render that escaped target/. 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

      public static final PreflightCondition NO_SCPEXE_SITE_URLS
      No subproject root POM (nor the workspace root) declares a <distributionManagement><site><url> starting with scpexe:// — 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

      public static final PreflightCondition 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:
      1. <parent><version> matches the workspace's.
      2. <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 retired ws:verify per #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

      public static final PreflightCondition BRANCH_COHERENCE
      Every cloned subproject's three branch axes agree: the workspace.yaml branch: declaration, the on-disk checkout, and the .ike/vcs-state record. The three drifted silently for a week on ike-starter-set — manifest declared a feature branch while checkout and state file sat on main, and the VCS-bridge sync actively enforced the state file OVER the manifest (IKE-Network/ike-issues#904). Surfaced warn-only on every goal by AbstractWorkspaceMojo; ws:lint reports it with the rest of the conditions.
    • PUSH_ACCESS

      public static final PreflightCondition PUSH_ACCESS
      Every member with an origin remote — and the workspace root itself — must accept a push from this operator, established by a git push --dry-run that 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 a feature-finish-squash-publish against ike-komet-wsr stranded 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-remote and the remoteSha() 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

      public static final String WORKSPACE_ROOT_NAME
      Special marker used when the workspace root itself has uncommitted changes.
      See Also:
  • Method Details

    • values

      public static PreflightCondition[] 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

      public static PreflightCondition valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • description

      public String description()
      Short human description of what this condition enforces.
    • check

      public abstract Optional<String> check(PreflightContext ctx)
      Evaluate the condition against the given context.
      Parameters:
      ctx - the preflight context
      Returns:
      Optional.empty() if the condition is satisfied; a remediation message otherwise