@Extension @Symbol(value="buildFailureAnalyzer") public class PluginImpl extends GlobalConfiguration
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
ExtensionPoint.LegacyInstancesAreScopedToHudson
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.
|
protected static int |
MINIMUM_NR_OF_SCAN_THREADS
Minimum allowed value for
nrOfScanThreads . |
static PermissionGroup |
PERMISSION_GROUP
The permission group for all permissions related to this plugin.
|
static Permission |
REMOVE_PERMISSION
Permission to remove causes.
|
static Permission |
UPDATE_PERMISSION
Permission to update the causes.
|
static Permission |
VIEW_PERMISSION
Permission to view the causes.
|
clazz
Constructor and Description |
---|
PluginImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
configure(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject o) |
AutoCompletionCandidates |
doAutoCompleteFallbackCategoriesAsString(String value)
Does the auto completion for categories, matching with any category already present in the knowledge base.
|
AutoCompletionCandidates |
getCategoryAutoCompletionCandidates(String prefix)
Does the auto completion for categories, matching with any category already present in the knowledge base.
|
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() |
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.
|
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.
|
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.
|
static boolean |
isSizeInLimit(Run build)
Checks that log size is in limits.
|
boolean |
isTestResultParsingEnabled()
If failed test cases should be represented as failure causes.
|
static boolean |
needToAnalyze(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 |
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 |
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(Job project)
Checks if the specified project should be scanned or not.
|
static boolean |
shouldScan(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 PermissionGroup PERMISSION_GROUP
public static final Permission UPDATE_PERMISSION
CauseManagement
.public static final Permission VIEW_PERMISSION
CauseManagement
.public static final Permission REMOVE_PERMISSION
protected static final int MINIMUM_NR_OF_SCAN_THREADS
nrOfScanThreads
.protected Object readResolve()
public XmlFile getConfigFile()
getConfigFile
in class Descriptor<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 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()
public void setDoNotAnalyzeAbortedJob(boolean doNotAnalyzeAbortedJob)
doNotAnalyzeAbortedJob
- on or off.public void setGlobalEnabled(Boolean globalEnabled)
globalEnabled
- on or off. null == on.public void setTestResultParsingEnabled(Boolean testResultParsingEnabled)
testResultParsingEnabled
- on or off. null == off.public void setTestResultCategories(String testResultCategories)
testResultCategories
- Space-separated string with categoriespublic boolean isGerritTriggerEnabled()
public void setGerritTriggerEnabled(Boolean gerritTriggerEnabled)
gerritTriggerEnabled
- on or off. null == on.public int getNrOfScanThreads()
BuildFailureScanner
.
Will return nothing less than MINIMUM_NR_OF_SCAN_THREADS
.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.public void setMaxLogSize(int maxLogSize)
maxLogSize
- valuepublic int getMaxLogSize()
public static boolean needToAnalyze(Result result)
result
- the resultpublic static boolean shouldScan(Run build)
build
- the buildshouldScan(Job)
public static boolean isSizeInLimit(Run build)
build
- the buildpublic static boolean shouldScan(Job project)
isGlobalEnabled()
and if the
project has ScannerJobProperty.isDoNotScan()
.project
- the projectpublic KnowledgeBase getKnowledgeBase()
public 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 GlobalConfiguration
public AutoCompletionCandidates getCategoryAutoCompletionCandidates(String prefix)
prefix
- the input prefix.public AutoCompletionCandidates doAutoCompleteFallbackCategoriesAsString(@QueryParameter String value)
value
- the input value.Copyright © 2016–2019. All rights reserved.