Build Failure Analyzer

compared with
Current by Robert Sandell
on Nov 25, 2015 10:21.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (8)

View Page History
Plugin developers can add new Indication types and more are planned to be added to the plugin itself.
The Build Log Indication searches through the build log, one line at a time, for a regular expression.
It uses Pattern.match, so the regular expression needs to match the whole line, e.g. \*.*some .\**some words in the middle of a line.\**

_Adding new failure causes and indications to the knowledge base._

From version 1.3.1 of the plugin, regular expressions can be tested on the Failure Cause Management page, in two different ways:

* Writing a text in the text field shown above and testing against that.
* Writing a URL to a build log in the text field. The plugin then runs through the log trying to match the regexp.

When accessing the Failure Cause Management page from a build, the URL will be added to the text field automatically.

The plugin comes with two ways of saving the knowledge base:
* Local knowledge base. Saves the knowledge base in memory and serializes it as an xml file on the local Jenkins server (i.e. the "standard" Jenkins way of saving information).
h3. Statistics

If MongoDB or some knowledge base type that supports MongoDB statistics is used, statistics will be saved to that database. The same information
that is shown on the build page is saved to the database.

* Concurrent scans - To speed up the scanning, each build will get a threadpool of this number of threads, with each thread handling one indication. For a small system, 3 is usually enough.

h2. Token Macro integration

h3. Usage:

$\{BUILD_FAILURE_ANALYZER, includeTitle=true, includeIndications=true, useHtmlFormat=true, noFailureText="Sometext"}

h3. Parameters (=default):

* *includeTitle (=true)* \-\- When true, the "Identified problems:" title will appear over the causes.
* *includeIndications (=true)* \-\- When true, the indication numbers and links into the console log are included in the token replacement text.
* *useHtmlFormat (=false)* \-\- When true, the replacement will be an HTML snippet.
* *wrapWidth (=0)* \-\- Wrap long lines at this width. If wrapWidth is 0, the text isn't wrapped. Only applies if useHtmlFormat == false.
* *noFailureText (="")* \-\- Text to provide if there are no found failures.

h2. Placeholders in description

Replace description placeholders from captured expressions in found indications

Substitutions may be made within the description with placeholders of the form *$\{I,G}*, where *I* is the indication number and *G* is the captured group within the indication expression. e.g., *$\{1,1}* would be replaced with the first indication's first captured group and *$\{1,2}* would be replaced with the first indication's second captured group.

h2. Tips & Tricks

h3. Aggregate statistics to Graphite

If you are using the MongoDB KnowledgeBase, you can use these scripts in a cron job to aggregate the statistics into Graphite.

* [Known vs. Unknown Failures per hour|]
* [Failure Categories per hour|]

h2. Change Log

h4. Version 1.13.2 (released Nov 25, 2015)

* Fixed a issue when testing expressions on build logs located in folders. ([Pull #36|])

h4. Version 1.13.1 (released Sept 25, 2015)

* [JENKINS-30643|]. ([Pull #38|])
* Small UI text fix ([Pull #37|])

h4. Version 1.13.0 (released Apr 10, 2015)

* Add to build log if a known cause was found. ([Pull #35|])
* Noting []. ([Pull # 34|])
* Make error message readable on List View. ([Pull #33|])

h4. Version 1.12.1 (released Jan 16, 2015)

* Found downstream builds fix. ([Pull #27|])

h4. Version 1.12.0 (released Jan 15, 2015)

* [JENKINS-24434|] fix trim() usage. ([Pull #29|])
* Configurable anonymous access to the list of failure causes. ([Pull #31|])
* Having the token expand into some text when no failure cause is identified. ([Pull #32|])

h4. Version 1.11.0 (released Nov 27, 2014)

* Failed Tests can be shown as failure causes, _but not counted in the statistics_ ([Pull #25|])
* \[UI\] Added space between indication links. ([Pull #26|])

h4. Version 1.10.3 (released Oct 13, 2014)

* One more fix for icons not correctly displayed ([Pull #24|])

h4. Version 1.10.2 (released Oct 7, 2014)

* [JENKINS-23409|] Fixed correctly exporting FailureCauseDisplayData to the Http Api ([Commit #96bf0ef|])

h4. Version 1.10.1 (released Sep 30, 2014)

* Fixed an issue reading a property from MongoDB ([Commit #f3626c5|])

h4. Version 1.10.0 (released Sep 19, 2014)

* [JENKINS-24059|] Fixed NullPointerException on missing downstream project ([pull #23|])
* Added Modifications + LastOccurred as admin fields
* Placeholders in description ([pull #20|])
* [JENKINS-17658|] BUILD_FAILURE_ANALYZER TokenMacro ([pull #22|])

h4. Version 1.9.1 (released Jun 25, 2014)

* "Failure Scan Options" is not hidden for users without build or configure permissions, it also hides when scanning is turned off.

h4. Version 1.9.0 (released Jun 18, 2014)

* Statistics upstream link - added upstream link info to statistics.
* [JENKINS-18518|] Red highlights not showing when clicking on indications ([pull #21|])
* BuildFlow Dependencies And Nested Failure Causes in Gerrit ([pull #18|])
* Address multiline "Match Text" failure ([pull #17|])

h4. Version 1.8.1 (released May 22, 2014)

* Address NPE in getNotScannedBuilds() ([pull #16|])

h4. Version 1.8.0 (released May 19, 2014)

* Project page shows last build failure cause
* Failure Cause Management link hidden for projects with disabled scanning

h4. Version 1.7.0 (released Apr 1, 2014)

* Multi line build log indications
* Optionally store statistics about successful builds

h4. Version 1.6.0 (released Mar 10, 2014)

* Ability to re-scan non scanned builds (for new installations) and all builds for a project
* Graphs on projects, slaves and master(s) if using a statistics logging enabled knowledge base (like the MongoDB Knowledge base)
* Shows failure causes from downstream builds directly on the upstream build page.
* ListView column showing the failure cause of the last build, if there is one.

h4. Version 1.5.1 (released Nov 19, 2013)

* Fixed an XSS vulnerability

h4. Version 1.5.0 (released Apr 24, 2013)

h5. New Features

* The found failure cause is exposed to the REST Api (jobX/1/api).

h4. Version 1.4.1 (released Mar 14, 2013)

h5. Bugs fixed

* [JENKINS-16868|] Icons are not displayed with a reverse proxy

h4. Version 1.4.0 (released Feb 15, 2013)

h5. New Features

* Possibility to test regexps on a build log

h5. Bugs fixed

* Log annotation bugfixes.
* [JENKINS-15948|] Build Failure Analyzer icons aren't displayed if Jenkins isn't installed at root context.(again)
* [JENKINS-15926|] Build Failure Analyzer with Timestamper output ugly.(again)
* [JENKINS-16596|] Repeat/double loggin issue due to Build failure Analyzer.
* [JENKINS-16104|] Build Failure Analyzer: Ugly output from plugin.
* NPE fix when a slave is taken offline during a build.
* Fix for internal serialization of matrix aggregated indications.
* Small UI fix in failure cause management page.

h4. Version 1.3.0 (released Dec 06, 2012)

h5. New Features

* Possibility to test regexp on a line of text when editing BuildLogIndications
* Output from Build Failure Analyzer shown in normal console.

h5. Bugs fixed

* [JENKINS-15986|] Cannot save job configuration pages on Jenkins 1.463 or newer.
* [JENKINS-15948|] Build Failure Analyzer icons aren't displayed if Jenkins isn't installed at root context.
* [JENKINS-15926|] Build Failure Analyzer with Timestamper output ugly.

h5. Other

* Updated Gerrit Trigger optional dependency: 2.7.0

h4. Version 1.2.0 (released Nov 22, 2012)