Class BuildFailureScanner
- All Implemented Interfaces:
ExtensionPoint
Looks for Indications, trying to find the Cause of a problem.
- Author:
- Tomas Westling <thomas.westling@sonyericsson.com>
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The ordinal of this extension, one thousand below the GerritTrigger plugin.Fields inherited from class hudson.model.listeners.RunListener
LISTENERS, targetType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createSlackMessage
(List<FoundFailureCause> foundCauseList, boolean notifySlackOfAllFailures, List<String> slackFailureCauseCategories, String buildName, String buildNum, String buildUrl, PrintStream scanLog) Function to create the message for Slack using build and BFA information.static void
Creates the shared thread pool after extensions have been made available.void
onCompleted
(Run run, TaskListener listener) void
onStarted
(Run build, TaskListener listener) static void
scan
(Run build, PrintStream scanLog) Performs a scan of the build, adds theFailureCauseBuildAction
and reports to theStatisticsLogger
.static void
scanIfNotScanned
(Run build, PrintStream scanLog) Scans the build if it should be scanned and it has not already been scanned.Methods inherited from class hudson.model.listeners.RunListener
all, allowLoad, fireCompleted, fireDeleted, fireFinalized, fireInitialize, fireStarted, onDeleted, onFinalized, onInitialize, register, setUpEnvironment, unregister
-
Field Details
-
ORDINAL
public static final int ORDINALThe ordinal of this extension, one thousand below the GerritTrigger plugin.- See Also:
-
-
Constructor Details
-
BuildFailureScanner
public BuildFailureScanner()
-
-
Method Details
-
initThreadPool
Creates the shared thread pool after extensions have been made available. -
onStarted
- Overrides:
onStarted
in classRunListener<Run>
-
onCompleted
- Overrides:
onCompleted
in classRunListener<Run>
-
scanIfNotScanned
Scans the build if it should be scanned and it has not already been scanned. If configured, also reports successful builds to theStatisticsLogger
.- Parameters:
build
- the build to scanscanLog
- log to write information to
-
scan
Performs a scan of the build, adds theFailureCauseBuildAction
and reports to theStatisticsLogger
.- Parameters:
build
- the build to scanscanLog
- log to write information to.
-
createSlackMessage
public static String createSlackMessage(List<FoundFailureCause> foundCauseList, boolean notifySlackOfAllFailures, List<String> slackFailureCauseCategories, String buildName, String buildNum, String buildUrl, PrintStream scanLog) Function to create the message for Slack using build and BFA information.- Parameters:
foundCauseList
- - Build failure causes found in the buildnotifySlackOfAllFailures
- - Flag to indicate if all failures should be sent to SlackslackFailureCauseCategories
- - Failure causes for which to notify Slack (from BFA configuration)buildName
- - Name of the buildbuildNum
- - Build objectbuildUrl
- - Full URL of buildscanLog
- - PrintStream for the build log- Returns:
- String Slack message with failure name, category and description if message successfully created, null otherwise
-