Class BitBucketPPRPipelineLibrarySCMAction
- All Implemented Interfaces:
Action,ModelObject
Run, the Git remotes seen by the build, split by the role
they played:
libraryRemotes— checkouts done under a Pipeline shared-library workspace (<job-workspace>@libs/<dir>, recognised byBitBucketPPRSCMCheckoutListener).nonLibraryRemotes— every other Git checkout the build performed (the job's main source SCM, explicitcheckoutsteps, etc.).
The probe consults classify(GitSCM) to decide whether to skip a webhook match.
The result is tri-state (BitBucketPPRPipelineLibrarySCMAction.Classification.ONLY_LIBRARY, BitBucketPPRPipelineLibrarySCMAction.Classification.NON_LIBRARY_OR_MIXED, BitBucketPPRPipelineLibrarySCMAction.Classification.UNKNOWN) so the probe can
distinguish "this build proves the SCM is exclusively a library" from "this build has no
opinion" — the latter is what enables the scan-window logic to fall back to an older build
without having a newer build's NON_LIBRARY verdict silently shadowed by an older
ONLY_LIBRARY verdict.
Stored URIs are sanitized to host + path: that is the only subset GitStatus.looselyMatches(URIish, URIish) actually consults, and we deliberately do not
duplicate scheme/user/password into a separate action on the Run.
Thread-safety: writes happen from build executor threads (parallel-stage library/checkout
steps fire concurrently) while reads happen from the webhook HTTP dispatch thread; all methods
that touch the internal lists are synchronized on the action instance.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPer-build verdict on whether a queriedGitSCMwas exclusively a Pipeline shared library in this build, also a real (non-library) checkout, or simply not seen. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclassify(hudson.plugins.git.GitSCM scm) Returns this build's verdict onscm:BitBucketPPRPipelineLibrarySCMAction.Classification.NON_LIBRARY_OR_MIXEDwhenscmis multi-remote (by construction not a library — preserves #378) OR any of its URIs matches a recorded non-library URI;BitBucketPPRPipelineLibrarySCMAction.Classification.ONLY_LIBRARYwhen at least one URI matches a library URI AND no URI matches a non-library URI;BitBucketPPRPipelineLibrarySCMAction.Classification.UNKNOWNwhen none of the URIs has been seen in this build.voidrecordLibrary(Iterable<org.eclipse.jgit.transport.URIish> uris) Records the given URIs as Pipeline shared-library checkouts.voidrecordNonLibrary(Iterable<org.eclipse.jgit.transport.URIish> uris) Records the given URIs as non-library (explicit) checkouts.Methods inherited from class hudson.model.InvisibleAction
getDisplayName, getIconFileName, getUrlName
-
Constructor Details
-
BitBucketPPRPipelineLibrarySCMAction
public BitBucketPPRPipelineLibrarySCMAction()
-
-
Method Details
-
recordLibrary
Records the given URIs as Pipeline shared-library checkouts. -
recordNonLibrary
Records the given URIs as non-library (explicit) checkouts. -
classify
Returns this build's verdict onscm:BitBucketPPRPipelineLibrarySCMAction.Classification.NON_LIBRARY_OR_MIXEDwhenscmis multi-remote (by construction not a library — preserves #378) OR any of its URIs matches a recorded non-library URI;BitBucketPPRPipelineLibrarySCMAction.Classification.ONLY_LIBRARYwhen at least one URI matches a library URI AND no URI matches a non-library URI;BitBucketPPRPipelineLibrarySCMAction.Classification.UNKNOWNwhen none of the URIs has been seen in this build.
This three-valued return is what allows the probe to honour the most-recent build's verdict instead of OR-ing across the window: a more recent build that returns
NON_LIBRARY_OR_MIXEDmust shadow an older build that returnedONLY_LIBRARY.Scoping: the multi-remote shortcut returns
NON_LIBRARY_OR_MIXEDunconditionally, including when none of the queried URIs is actually in either recorded list. That is intentional but only meaningful in the probe's call chain —classifyis consulted AFTERBitBucketPPRJobProbe.matchGitScmhas already established thatscm's URL overlaps the webhook payload, so an irrelevant multi-remote SCM never reaches this method in production. The shortcut is what lets the probe's scan stop at the most recent "this is a real source" verdict instead of regressing to an older library-only entry for one of the multi-remote URIs.
-