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 SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe ordinal of this extension, one thousand below the GerritTrigger plugin.Fields inherited from class hudson.model.listeners.RunListenerLISTENERS, targetType
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringcreateSlackMessage(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 voidCreates the shared thread pool after extensions have been made available.voidonCompleted(Run run, TaskListener listener) voidonStarted(Run build, TaskListener listener) static voidscan(Run build, PrintStream scanLog) Performs a scan of the build, adds theFailureCauseBuildActionand reports to theStatisticsLogger.static voidscanIfNotScanned(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.RunListenerall, allowLoad, fireCompleted, fireDeleted, fireFinalized, fireInitialize, fireStarted, onDeleted, onFinalized, onInitialize, register, setUpEnvironment, unregister
- 
Field Details- 
ORDINALpublic static final int ORDINALThe ordinal of this extension, one thousand below the GerritTrigger plugin.- See Also:
 
 
- 
- 
Constructor Details- 
BuildFailureScannerpublic BuildFailureScanner()
 
- 
- 
Method Details- 
initThreadPoolCreates the shared thread pool after extensions have been made available.
- 
onStarted- Overrides:
- onStartedin class- RunListener<Run>
 
- 
onCompleted- Overrides:
- onCompletedin class- RunListener<Run>
 
- 
scanIfNotScannedScans 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 scan
- scanLog- log to write information to
 
- 
scanPerforms a scan of the build, adds theFailureCauseBuildActionand reports to theStatisticsLogger.- Parameters:
- build- the build to scan
- scanLog- log to write information to.
 
- 
createSlackMessagepublic 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 build
- notifySlackOfAllFailures- - Flag to indicate if all failures should be sent to Slack
- slackFailureCauseCategories- - Failure causes for which to notify Slack (from BFA configuration)
- buildName- - Name of the build
- buildNum- - Build object
- buildUrl- - Full URL of build
- scanLog- - PrintStream for the build log
- Returns:
- String Slack message with failure name, category and description if message successfully created, null otherwise
 
 
-