@Extension
@Symbol(value="buildFailureAnalyzer")
public class PluginImpl
extends jenkins.model.GlobalConfiguration
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ICON_NAME
Convenience constant for the default icon size.
|
static String |
DEFAULT_ICON_SIZE
Convenience constant for the 24x24 icon size.
|
static int |
DEFAULT_MAX_LOG_SIZE
Default max size of log to be scanned ('0' disables check).
|
static int |
DEFAULT_NR_OF_SCAN_THREADS
Default number of concurrent scan threads.
|
static String |
DEFAULT_SLACK_CHANNEL
Default slack channel to use.
|
static String |
DEFAULT_SLACK_FAILURE_CATEGORIES
Default value for which failure categories to notify slack.
|
protected static int |
MINIMUM_NR_OF_SCAN_THREADS
Minimum allowed value for
nrOfScanThreads . |
static hudson.security.PermissionGroup |
PERMISSION_GROUP
The permission group for all permissions related to this plugin.
|
static hudson.security.Permission |
REMOVE_PERMISSION
Permission to remove causes.
|
static hudson.security.Permission |
UPDATE_PERMISSION
Permission to update the causes.
|
static hudson.security.Permission |
VIEW_PERMISSION
Permission to view the causes.
|
Constructor and Description |
---|
PluginImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
configure(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject o) |
hudson.model.AutoCompletionCandidates |
doAutoCompleteFallbackCategoriesAsString(String value)
Does the auto completion for categories, matching with any category already present in the knowledge base.
|
hudson.model.AutoCompletionCandidates |
getCategoryAutoCompletionCandidates(String prefix)
Does the auto completion for categories, matching with any category already present in the knowledge base.
|
hudson.XmlFile |
getConfigFile() |
static String |
getDefaultIcon()
The default icon to be used throughout this plugin.
|
List<String> |
getFallbackCategories()
Get the categories that are considered generic.
|
String |
getFallbackCategoriesAsString()
Fallback categories.
|
static String |
getFullImageUrl(String size,
String name)
Get the full url to an image, including rootUrl and context path.
|
static String |
getImageUrl(String name)
Provides a Jenkins relative url to a plugin internal image of
DEFAULT_ICON_SIZE size. |
static String |
getImageUrl(String size,
String name)
Provides a Jenkins relative url to a plugin internal image.
|
static PluginImpl |
getInstance()
Returns the singleton instance.
|
KnowledgeBase |
getKnowledgeBase()
The knowledge base containing all causes.
|
KnowledgeBase.KnowledgeBaseDescriptor |
getKnowledgeBaseDescriptor(String descString)
Gets the KnowledgeBaseDescriptor that matches the name descString.
|
hudson.ExtensionList<KnowledgeBase.KnowledgeBaseDescriptor> |
getKnowledgeBaseDescriptors()
Convenience method to reach the list from jelly.
|
int |
getMaxLogSize()
Returns the maximum log size that should be scanned.
|
String |
getNoCausesMessage()
Getter for the no causes message.
|
int |
getNrOfScanThreads()
The number of threads to have in the pool for each build.
|
String |
getSlackChannelName()
Get configured slack channel.
|
String |
getSlackFailureCategories()
Get configured slack failure cause categories.
|
ScanOnDemandVariables |
getSodVariables()
Getter sodVariable.
|
static String |
getStaticImagesBase()
Returns the base relative URI for static images packaged in webapp.
|
static String |
getStaticResourcesBase()
Returns the base relative URI for static resources packaged in webapp.
|
String |
getTestResultCategories()
Get categories to be assigned to failure causes representing failed test cases.
|
boolean |
isDoNotAnalyzeAbortedJob()
If this feature is enabled or not.
|
boolean |
isGerritTriggerEnabled()
Send notifications to Gerrit-Trigger-plugin.
|
boolean |
isGlobalEnabled()
If this feature is enabled or not.
|
boolean |
isGraphsEnabled()
If graphs are enabled or not.
|
boolean |
isNoCausesEnabled()
Whether to display in the build page when no causes are identified.
|
static boolean |
isSizeInLimit(hudson.model.Run build)
Checks that log size is in limits.
|
boolean |
isSlackNotifEnabled()
Send notifications to Slack.
|
boolean |
isTestResultParsingEnabled()
If failed test cases should be represented as failure causes.
|
static boolean |
needToAnalyze(hudson.model.Result result)
Checks if the build with certain result should be analyzed or not.
|
protected Object |
readResolve() |
void |
setDoNotAnalyzeAbortedJob(boolean doNotAnalyzeAbortedJob)
Sets if this feature is enabled or not.
|
void |
setFallbackCategoriesAsString(String categories)
Sets the categories to be considered as generic.
|
void |
setGerritTriggerEnabled(boolean gerritTriggerEnabled)
Sets if this feature is enabled or not.
|
void |
setGlobalEnabled(boolean globalEnabled)
Sets if this feature is enabled or not.
|
void |
setGraphsEnabled(boolean graphsEnabled)
Sets if graphs are enabled.
|
void |
setKnowledgeBase(KnowledgeBase knowledgeBase)
Sets the knowledge base.
|
void |
setMaxLogSize(int maxLogSize)
Set the maximum log size that should be scanned.
|
void |
setNoCausesEnabled(boolean noCausesEnabled)
Sets whether the "no indications found" message should be shown in the job page when no causes are found.
|
void |
setNoCausesMessage(String noCausesMessage)
Sets the no causes message.
|
void |
setNrOfScanThreads(int nrOfScanThreads)
The number of threads to have in the pool for each build.
|
void |
setSlackChannelName(String slackChannelName)
Set configured slack channel.
|
void |
setSlackFailureCategories(String slackFailureCategories)
Set configured slack failure cause categories.
|
void |
setSlackNotifEnabled(boolean slackNotifEnabled)
Sets if this feature is enabled or not.
|
void |
setSodVariables(ScanOnDemandVariables sodVariables)
Sets the scan on demand variables.
|
void |
setTestResultCategories(String testResultCategories)
Set categories to be assigned to failure causes representing failed test cases.
|
void |
setTestResultParsingEnabled(boolean testResultParsingEnabled)
Sets if failed test cases should be represented as failure causes or not.
|
static boolean |
shouldScan(hudson.model.Job project)
Checks if the specified project should be scanned or not.
|
static boolean |
shouldScan(hudson.model.Run build)
Checks if the specified build should be scanned or not.
|
void |
start()
Starts the knowledge base.
|
void |
stop()
Run on Jenkins shutdown.
|
all, getDescriptor, getGlobalConfigPage
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
public static final String DEFAULT_ICON_SIZE
getImageUrl(String, String)
.public static final String DEFAULT_ICON_NAME
getImageUrl(String, String)
.public static final int DEFAULT_NR_OF_SCAN_THREADS
public static final int DEFAULT_MAX_LOG_SIZE
public static final String DEFAULT_SLACK_CHANNEL
public static final String DEFAULT_SLACK_FAILURE_CATEGORIES
public static final hudson.security.PermissionGroup PERMISSION_GROUP
public static final hudson.security.Permission UPDATE_PERMISSION
CauseManagement
.public static final hudson.security.Permission VIEW_PERMISSION
CauseManagement
.public static final hudson.security.Permission REMOVE_PERMISSION
protected static final int MINIMUM_NR_OF_SCAN_THREADS
nrOfScanThreads
.protected Object readResolve()
public hudson.XmlFile getConfigFile()
getConfigFile
in class hudson.model.Descriptor<jenkins.model.GlobalConfiguration>
@Initializer(after=EXTENSIONS_AUGMENTED) public void start()
@Terminator public void stop()
public static String getStaticResourcesBase()
public ScanOnDemandVariables getSodVariables()
public static String getStaticImagesBase()
getStaticResourcesBase()
public static String getImageUrl(String size, String name)
size
- the size of the image (the sub directory of images).name
- the name of the image file.public static String getFullImageUrl(String size, String name)
size
- the size of the image (the sub directory of images).name
- the name of the image file.public static String getImageUrl(String name)
DEFAULT_ICON_SIZE
size.name
- the name of the image.getImageUrl(String, String)
public static String getDefaultIcon()
getImageUrl(String)
,
getImageUrl(String, String)
@Nonnull public static PluginImpl getInstance()
public String getNoCausesMessage()
public boolean isNoCausesEnabled()
@DataBoundSetter public void setNoCausesEnabled(boolean noCausesEnabled)
noCausesEnabled
- on or off.public boolean isGlobalEnabled()
public boolean isDoNotAnalyzeAbortedJob()
public boolean isGraphsEnabled()
@DataBoundSetter public void setGraphsEnabled(boolean graphsEnabled)
graphsEnabled
- the graph flag@DataBoundSetter public void setNoCausesMessage(String noCausesMessage)
noCausesMessage
- the no causes message@DataBoundSetter public void setKnowledgeBase(KnowledgeBase knowledgeBase)
knowledgeBase
- the knowledge base@DataBoundSetter public void setSodVariables(ScanOnDemandVariables sodVariables)
sodVariables
- the variables@DataBoundSetter public void setFallbackCategoriesAsString(String categories)
categories
- The space separated list of generic categoriespublic String getFallbackCategoriesAsString()
public boolean isTestResultParsingEnabled()
public String getTestResultCategories()
public List<String> getFallbackCategories()
@DataBoundSetter public void setDoNotAnalyzeAbortedJob(boolean doNotAnalyzeAbortedJob)
doNotAnalyzeAbortedJob
- on or off.@DataBoundSetter public void setGlobalEnabled(boolean globalEnabled)
globalEnabled
- on or off.@DataBoundSetter public void setTestResultParsingEnabled(boolean testResultParsingEnabled)
testResultParsingEnabled
- on or off.@DataBoundSetter public void setTestResultCategories(String testResultCategories)
testResultCategories
- Space-separated string with categoriespublic boolean isGerritTriggerEnabled()
public boolean isSlackNotifEnabled()
public String getSlackChannelName()
public String getSlackFailureCategories()
@DataBoundSetter public void setGerritTriggerEnabled(boolean gerritTriggerEnabled)
gerritTriggerEnabled
- on or off.@DataBoundSetter public void setSlackNotifEnabled(boolean slackNotifEnabled)
slackNotifEnabled
- on or off. null == off.@DataBoundSetter public void setSlackChannelName(String slackChannelName)
slackChannelName
- null = DEFAULT_SLACK_CHANNEL@DataBoundSetter public void setSlackFailureCategories(String slackFailureCategories)
slackFailureCategories
- - Space seperated list of failure cause categories.public int getNrOfScanThreads()
BuildFailureScanner
.
Will return nothing less than MINIMUM_NR_OF_SCAN_THREADS
.@DataBoundSetter public void setNrOfScanThreads(int nrOfScanThreads)
BuildFailureScanner
.
Will throw an IllegalArgumentException
if the parameter is less than MINIMUM_NR_OF_SCAN_THREADS
.nrOfScanThreads
- the number of scan threads.@DataBoundSetter public void setMaxLogSize(int maxLogSize)
maxLogSize
- valuepublic int getMaxLogSize()
public static boolean needToAnalyze(hudson.model.Result result)
result
- the resultpublic static boolean shouldScan(hudson.model.Run build)
build
- the buildshouldScan(Job)
public static boolean isSizeInLimit(hudson.model.Run build)
build
- the buildpublic static boolean shouldScan(hudson.model.Job project)
isGlobalEnabled()
and if the
project has ScannerJobProperty.isDoNotScan()
.project
- the projectpublic KnowledgeBase getKnowledgeBase()
public hudson.ExtensionList<KnowledgeBase.KnowledgeBaseDescriptor> getKnowledgeBaseDescriptors()
public KnowledgeBase.KnowledgeBaseDescriptor getKnowledgeBaseDescriptor(String descString)
descString
- either name of a KnowledgeBaseDescriptor or the fully qualified name.public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject o)
configure
in class jenkins.model.GlobalConfiguration
public hudson.model.AutoCompletionCandidates getCategoryAutoCompletionCandidates(String prefix)
prefix
- the input prefix.public hudson.model.AutoCompletionCandidates doAutoCompleteFallbackCategoriesAsString(@QueryParameter String value)
value
- the input value.Copyright © 2016–2021. All rights reserved.