Class FeatureVersionReconciler

java.lang.Object
network.ike.plugin.ws.reconcile.FeatureVersionReconciler
All Implemented Interfaces:
Reconciler

public class FeatureVersionReconciler extends Object implements Reconciler
Reconciler that branch-qualifies each subproject's own Maven version to match the branch it tracks (IKE-Network/ike-issues#574).

On a feature branch every subproject's version must carry the branch slug (<base>-<slug>-SNAPSHOT) so feature builds are isolated from main SNAPSHOTs. ws:feature-start applies this once, at branch-creation; a subproject added later (via ws:add) — or otherwise left un-qualified — stays un-isolated and its feature build collides with its own main SNAPSHOT. This reconciler self-heals that on scaffold-publish.

Scope is each subproject's own version across its whole module tree — the root POM's <version>, every child's in-tree <parent><version>, and any child's redundant own <version> (IKE-Network/ike-issues#1051, via QualificationCascade) — plus the denormalized version field in workspace.yaml. Detection likewise sees a tree whose root is already qualified but whose children were left at the base version, the state a root-only read could not see (#1051). Propagating the new version into consumers' dependency references is left to AlignmentReconciler, which runs after this one in ReconcilerRegistry.

The target branch is read from the manifest (branch: per subproject), not git, so the reconciler is deterministic and branch-coherent. It is a no-op for main-tracking subprojects and for members already qualified — VersionSupport.branchQualifiedVersion(String, String) strips any existing slug before re-applying, so repeated runs converge.

  • Constructor Details

    • FeatureVersionReconciler

      public FeatureVersionReconciler()
  • Method Details

    • dimension

      public String dimension()
      Description copied from interface: Reconciler
      Human-readable name of the dimension this reconciler owns. Used as the heading in scaffold-draft output.
      Specified by:
      dimension in interface Reconciler
      Returns:
      the dimension label, e.g. "Denormalized YAML fields"
    • optOutFlag

      public String optOutFlag()
      Description copied from interface: Reconciler
      The Maven property name (without the -D prefix) that opts out of this reconciler's apply pass. Setting the property to "false" skips this dimension on a given scaffold-publish invocation.
      Specified by:
      optOutFlag in interface Reconciler
      Returns:
      the opt-out flag name, e.g. "updateFields"
    • detect

      public DriftReport detect(WorkspaceContext ctx)
      Description copied from interface: Reconciler
      Inspect the workspace and report any drift this reconciler would correct. Read-only — must not mutate the workspace.
      Specified by:
      detect in interface Reconciler
      Parameters:
      ctx - the workspace context
      Returns:
      drift report; DriftReport.noDrift(String) if nothing to do
    • apply

      public void apply(WorkspaceContext ctx)
      Description copied from interface: Reconciler
      Apply reconciliation. Caller is responsible for checking ReconcilerOptions.isOptedOut(String) before invoking; implementations may also re-check defensively.
      Specified by:
      apply in interface Reconciler
      Parameters:
      ctx - the workspace context