Class FiniteStateExecutionFramework
Every analysis runs through the public v0 REST API flow (executeViaApi(io.jenkins.plugins.finitestate.BaseFiniteStateRecorder, hudson.model.Run<?, ?>, hudson.FilePath, hudson.model.TaskListener, java.lang.String, java.lang.String)): resolve the
token, compute the target version, locate the workspace file, run the scan on the agent
(FiniteStateScanCallable) and translate the ScanResult into a build outcome.
Binary uploads use the mb-api upload façade (POST /scans/upload), a single contract
served by both the legacy backend (natively) and the current backend (as a façade). This lets one
published plugin work against either backend with no job configuration change — a job keeps
working through a backend migration by only updating the plugin. See HELIX-422.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanexecuteAnalysis(BaseFiniteStateRecorder recorder, AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) Backward-compatible shim for freestyle builds usingAbstractBuildAPI.static booleanexecuteAnalysis(BaseFiniteStateRecorder recorder, Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) Execute a Finite State analysis via the public v0 REST API with common error handling and logging.
-
Method Details
-
executeAnalysis
public static boolean executeAnalysis(BaseFiniteStateRecorder recorder, Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOExceptionExecute a Finite State analysis via the public v0 REST API with common error handling and logging.- Parameters:
recorder- Recorder that encapsulates analysis configuration and helpersrun- Jenkins run/build context used for environment and loggingworkspace- Workspace directory where the scan file is accessedlauncher- Jenkins launcher (part of the publisher contract; unused by the REST transport)listener- Build/task listener for console logging- Returns:
- true when the analysis succeeded (or was accepted, when not waiting); false on failure
- Throws:
InterruptedException- if execution is interruptedIOException- if file I/O fails
-
executeAnalysis
public static boolean executeAnalysis(BaseFiniteStateRecorder recorder, AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOExceptionBackward-compatible shim for freestyle builds usingAbstractBuildAPI.- Throws:
InterruptedExceptionIOException
-