Package io.jenkins.plugins.explain_error
Class ConsoleExplainErrorAction
java.lang.Object
io.jenkins.plugins.explain_error.ConsoleExplainErrorAction
- All Implemented Interfaces:
Action,ModelObject,RunAction2
Action to add "Explain Error" functionality to console output pages.
This action needs to be manually added to builds.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoCheckBuildStatus(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) AJAX endpoint to check build status.voiddoExplainConsoleError(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) AJAX endpoint to explain error from console output.voiddoPreview(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Shows, as plain text, what the Explain Error button would send to the AI provider for this build: the log lines, with secrets masked.Whether the build has an explanation: "ready", "pending" or "none".Run<?, ?> getRun()booleanWhether an automatic explanation of this build has been requested and has not come back yet.voidonAttached(Run<?, ?> r) void
-
Constructor Details
-
ConsoleExplainErrorAction
-
-
Method Details
-
onAttached
- Specified by:
onAttachedin interfaceRunAction2
-
onLoad
- Specified by:
onLoadin interfaceRunAction2
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
doExplainConsoleError
public void doExplainConsoleError(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException AJAX endpoint to explain error from console output. Called via JavaScript from the console output page.- Throws:
IOException
-
doPreview
public void doPreview(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException Shows, as plain text, what the Explain Error button would send to the AI provider for this build: the log lines, with secrets masked. Nothing is sent and no quota is used. Anyone who can read the build's log can read this. POST only, as it reads and masks as many lines as the button may send.- Throws:
IOException
-
doCheckBuildStatus
public void doCheckBuildStatus(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) AJAX endpoint to check build status. Returns JSON with buildingStatus to determine if button should be shown. 0 - SUCCESS, 1 - RUNNING, 2 - FINISHED and FAILURE It also carries explanation, which says whether the build has one: "ready", "pending" (an automatic one has been requested and has not come back yet) or "none". -
getExplanationState
Whether the build has an explanation: "ready", "pending" or "none". -
isExplanationPending
public boolean isExplanationPending()Whether an automatic explanation of this build has been requested and has not come back yet. -
getRun
-