Record Class DriftReport

java.lang.Object
java.lang.Record
network.ike.plugin.ws.reconcile.DriftReport
Record Components:
dimension - human-readable dimension name
hasDrift - true if reconciliation would change state
summary - one-line drift summary (empty when no drift)
detailLines - additional context lines (empty list ok)
defaultAction - one-line description of what apply would do
optOutCommand - exact copy-paste command to skip this dimension

public record DriftReport(String dimension, boolean hasDrift, String summary, List<String> detailLines, String defaultAction, String optOutCommand) extends Record
Report from a Reconciler.detect(WorkspaceContext) call describing what (if anything) the reconciler would change on scaffold-publish.

The optOutCommand is rendered inline beside the dimension in scaffold-draft output so users can copy-paste to opt out without first looking up the flag name elsewhere.

  • Constructor Details

    • DriftReport

      public DriftReport(String dimension, boolean hasDrift, String summary, List<String> detailLines, String defaultAction, String optOutCommand)
      Creates an instance of a DriftReport record class.
      Parameters:
      dimension - the value for the dimension record component
      hasDrift - the value for the hasDrift record component
      summary - the value for the summary record component
      detailLines - the value for the detailLines record component
      defaultAction - the value for the defaultAction record component
      optOutCommand - the value for the optOutCommand record component
  • Method Details

    • noDrift

      public static DriftReport noDrift(String dimension)
      Convenience constructor for the "no drift" case.
      Parameters:
      dimension - the dimension name
      Returns:
      a report with hasDrift = false
    • toMarkdown

      public String toMarkdown()
      Render this report as a Markdown fragment for a goal report file (IKE-Network/ike-issues#407).

      Shared renderer so reconciler drift looks the same in every report that includes it: a checkmark line when there is no drift, otherwise the dimension, summary, detail lines, default action, and the copy-paste opt-out command.

      Returns:
      a Markdown fragment, newline-terminated
    • toAppliedMarkdown

      public String toAppliedMarkdown()
      Render this report as a Markdown fragment describing what a scaffold-publish reconciler applied — the past-tense counterpart of toMarkdown() (IKE-Network/ike-issues#431).

      A reconciler's Reconciler.apply(WorkspaceContext) does exactly what its Reconciler.detect(WorkspaceContext) reported when the two are called back to back on an unchanged workspace, so the same detailLines (e.g. doc-example: ike-parent:66 → 67) describe the applied changes. The drift summary, defaultAction, and optOutCommand are future-tense and omitted here.

      Returns:
      a Markdown fragment, newline-terminated
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • dimension

      public String dimension()
      Returns the value of the dimension record component.
      Returns:
      the value of the dimension record component
    • hasDrift

      public boolean hasDrift()
      Returns the value of the hasDrift record component.
      Returns:
      the value of the hasDrift record component
    • summary

      public String summary()
      Returns the value of the summary record component.
      Returns:
      the value of the summary record component
    • detailLines

      public List<String> detailLines()
      Returns the value of the detailLines record component.
      Returns:
      the value of the detailLines record component
    • defaultAction

      public String defaultAction()
      Returns the value of the defaultAction record component.
      Returns:
      the value of the defaultAction record component
    • optOutCommand

      public String optOutCommand()
      Returns the value of the optOutCommand record component.
      Returns:
      the value of the optOutCommand record component