Class CheatsheetReconciler

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

public class CheatsheetReconciler extends Object implements Reconciler
Keeps the workspace cheatsheets — GOALS.md and WS-REFERENCE.md — in lockstep with the goal set the plugin actually ships (IKE-Network/ike-issues#452).

Before this reconciler, those files were written only by SubprojectInitializer, which is constructed by exactly one mojo (ws:scaffold-init). After a plugin upgrade the cheatsheets stayed stale until someone remembered to re-run ws:scaffold-init — and ws:scaffold-draft did not even report the drift. Routing cheatsheet generation through the reconciler chain restores the "draft reports / publish heals" contract every other workspace dimension already enjoys.

Source-of-truth lives in SubprojectInitializer.generateGoalCheatsheet() and SubprojectInitializer.generateWorkspaceReference() — both already static so this reconciler can call them without any additional plumbing. A future iteration of those generators is planned to iterate WsGoal so the content cannot drift from the actual goal set.

Opt-out: -DupdateCheatsheets=false. Useful when the user has intentionally edited the cheatsheets and does not want ws:scaffold-publish to overwrite them.

  • Constructor Details

    • CheatsheetReconciler

      public CheatsheetReconciler()
  • 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