Class ResultAction
java.lang.Object
io.jenkins.plugins.analysis.core.model.ResultAction
- All Implemented Interfaces:
Action,HealthReportingAction,ModelObject,Serializable,RunAction2,SimpleBuildStep.LastBuildAction,org.kohsuke.stapler.StaplerProxy
public class ResultAction
extends Object
implements HealthReportingAction, SimpleBuildStep.LastBuildAction, RunAction2, org.kohsuke.stapler.StaplerProxy, Serializable
Controls the life cycle of the analysis results in a job. This action persists the results of a build and displays a
summary on the build page. The actual visualization of the results is defined in the matching
summary.jelly
file. This action also provides access to the static analysis details: these are rendered using a new IssuesDetail instance.- Author:
- Ullrich Hafner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionResultAction(Run<?, ?> owner, AnalysisResult result, HealthDescriptor healthDescriptor, String id, String name, String icon, Charset charset, TrendChartType trendChartType) Creates a new instance ofResultAction. -
Method Summary
Modifier and TypeMethodDescriptionReturns the build history for this action.booleanGets the absolute path to the build from the owner.getId()Returns the ID (and URL) of this action.Returns theStaticAnalysisLabelProviderfor this action.Returns the URL of the 48x48 image used in the build summary.getName()Returns the name of the static analysis tool.Run<?,?> getOwner()Returns the associated build/run that created the static analysis result.Collection<? extends Action>io.jenkins.plugins.util.QualityGateResultReturns the URL of this action, relative to the context root of Jenkins.Returns the URL of the 24x24 image used in the build link.Returns the URL of the 24x24 image used in the build link.Returns the model for the summary of the static analysis run.Returns the detail view for issues for all Stapler requests.inthashCode()booleanReturns whether a large image is defined.booleanReturns whether the static analysis result is considered successfully with respect to the evaluated quality gates.voidonAttached(Run<?, ?> r) voidprotected ObjectCalled after deserialization to retain backward compatibility.Empty method as workaround for Stapler bug: JavaScript method in the target object is not found.toString()
-
Constructor Details
-
ResultAction
public ResultAction(Run<?, ?> owner, AnalysisResult result, HealthDescriptor healthDescriptor, String id, String name, String icon, Charset charset, TrendChartType trendChartType) Creates a new instance ofResultAction.- Parameters:
owner- the associated build/run that created the static analysis resultresult- the result of the static analysis runhealthDescriptor- the health descriptor of the static analysis runid- the ID of the resultsname- the optional name of the resultsicon- the optional icon of the resultscharset- the charset to use to display source filestrendChartType- determines if the trend chart will be shown
-
-
Method Details
-
readResolve
Called after deserialization to retain backward compatibility.- Returns:
- this
-
getId
Returns the ID (and URL) of this action.- Returns:
- the ID
-
getQualityGateResult
public io.jenkins.plugins.util.QualityGateResult getQualityGateResult() -
getName
Returns the name of the static analysis tool.- Returns:
- the ID
-
getOwner
Returns the associated build/run that created the static analysis result.- Returns:
- the run
-
createBuildHistory
Returns the build history for this action.- Returns:
- the history
-
onAttached
- Specified by:
onAttachedin interfaceRunAction2
-
onLoad
- Specified by:
onLoadin interfaceRunAction2
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
getRelativeUrl
Returns the URL of this action, relative to the context root of Jenkins.- Returns:
- the relative URL, like job/foo/32/analysis/
-
getAbsoluteUrl
Gets the absolute path to the build from the owner. This is needed for testing due toRun.getAbsoluteUrl()being final and therefore not mockable.- Returns:
- the absolute url to the job
-
getBuildHealth
- Specified by:
getBuildHealthin interfaceHealthReportingAction
-
getProjectActions
- Specified by:
getProjectActionsin interfaceSimpleBuildStep.LastBuildAction
-
getResult
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
equals
-
hashCode
public int hashCode() -
hasLargeImage
public boolean hasLargeImage()Returns whether a large image is defined.- Returns:
trueif a large image is defined,falseotherwise
-
getLargeImageName
Returns the URL of the 48x48 image used in the build summary.- Returns:
- the URL of the image
-
getSmallImageName
Returns the URL of the 24x24 image used in the build link.- Returns:
- the URL of the image
-
getSmallImage
Returns the URL of the 24x24 image used in the build link.- Returns:
- the URL of the image
-
getSummaryModel
Returns the model for the summary of the static analysis run. This model is used as input in the 'summary.jelly' view.- Returns:
- model to build the summary message on the client side
-
isSuccessful
public boolean isSuccessful()Returns whether the static analysis result is considered successfully with respect to the evaluated quality gates.- Returns:
trueif the result is successful,falseif the result has been set toResult.UNSTABLEorResult.FAILURE.
-
toString
-
getLabelProvider
Returns theStaticAnalysisLabelProviderfor this action.- Returns:
- the label provider for this tool
-
getTarget
Returns the detail view for issues for all Stapler requests.- Specified by:
getTargetin interfaceorg.kohsuke.stapler.StaplerProxy- Returns:
- the detail view for issues
-
resetReference
Empty method as workaround for Stapler bug: JavaScript method in the target object is not found.- Returns:
- unused string (since Firefox requires that Ajax calls return something)
-