Class ReleaseStatusInspector
java.lang.Object
network.ike.plugin.ws.ReleaseStatusInspector
Pure inference logic for
WsReleaseStatusMojo — given a
snapshot of git observations for one subproject, classifies the
subproject's release state.
This class is git-only and side-effect free. The mojo is
responsible for collecting an ReleaseStatusInspector.Observation from the live
repository (via git subprocesses); this class encapsulates
the rules that turn that observation into a ReleaseStatusInspector.Finding.
The split exists so that the classification rules can be
exercised without building a real git repository on disk for every
scenario — see WsReleaseStatusInspectorTest. End-to-end
coverage that spans real git tag, git branch, and
remote interaction lives in WsReleaseStatusIntegrationTest.
See issue #187.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordClassification result for a single subproject.static final recordRaw git observations for a single subproject.static enumHigh-level summary of a subproject's release state, derived from git artifacts alone. -
Method Summary
Modifier and TypeMethodDescriptionApply the classification rules to a single observation.
-
Method Details
-
classify
Apply the classification rules to a single observation.Rules, in order of precedence:
- If the subproject is not checked out, return
ReleaseStatusInspector.Status.ABSENT. - If a
release/*branch is present locally and the correspondingv<version>tag is already onorigin, returnReleaseStatusInspector.Status.DIVERGED— the release happened elsewhere; the local branch is debris. - If any
release/*branch exists locally, or any localv*tag is missing from the remote (and the remote was reachable), returnReleaseStatusInspector.Status.IN_FLIGHT. - Otherwise return
ReleaseStatusInspector.Status.CLEAN.
- Parameters:
obs- the git observation snapshot for one subproject- Returns:
- the classification result
- If the subproject is not checked out, return
-