Reporters

Reporters are like publishers but only applicable to Maven projects.

Component: reporters
Macro:

reporter

Entry Point:

jenkins_jobs.reporters

Example:

job:
  name: test_job
  project-type: maven

  reporters:
    - email:
        recipients: breakage@example.com
class reporters.Reporters(registry)
component_list_type = 'reporters'

The component list type will be used to look up possible implementations of the component type via entry points (entry points provide a list of components, so it should be plural). Set both component_type and component_list_type to None if module doesn’t have components.

component_type = 'reporter'

The component type for components of this module. This will be used to look for macros (they are defined singularly, and should not be plural). Set both component_type and component_list_type to None if module doesn’t have components.

gen_xml(xml_parent, data)

Update the XML element tree based on YAML data. Override this method to add elements to the XML output. Create new Element objects and add them to the xml_parent. The YAML data structure must not be modified.

:arg class:xml.etree.ElementTree xml_parent: the parent XML element :arg dict data: the YAML data structure

sequence = 55

The sequence number for the module. Modules are invoked in the order of their sequence number in order to produce consistently ordered XML output.

reporters.email(registry, xml_parent, data)

yaml: email Email notifications on build failure.

Parameters:
  • recipients (str) – Recipient email addresses

  • notify-every-unstable-build (bool) – Send an email for every unstable build (default true)

  • send-to-individuals (bool) – Send an email to the individual who broke the build (default false)

  • notify-for-each-module (bool) – Send an email for each module (e.g. failed, unstable). (default true)

Example:

reporters:
  - email:
      recipients: breakage@example.com
reporters.findbugs(registry, xml_parent, data)

yaml: findbugs FindBugs reporting for builds

Requires the Jenkins FindBugs Plugin (https://github.com/jenkinsci/findbugs-plugin).

Parameters:
  • rank-priority (bool) – Use rank as priority (default false)

  • include-files (str) – Comma separated list of files to include. (Optional)

  • exclude-files (str) – Comma separated list of files to exclude. (Optional)

  • can-run-on-failed (bool) – Weather or not to run plug-in on failed builds (default false)

  • healthy (int) – Sunny threshold (optional)

  • unhealthy (int) – Stormy threshold (optional)

  • health-threshold (str) – Threshold priority for health status (‘low’, ‘normal’ or ‘high’, defaulted to ‘low’)

  • dont-compute-new (bool) – If set to false, computes new warnings based on the reference build (default true)

  • use-delta-values (bool) – Use delta for new warnings. (default false)

  • use-previous-build-as-reference (bool) – If set then the number of new warnings will always be calculated based on the previous build. Otherwise the reference build. (default false)

  • use-stable-build-as-reference (bool) – The number of new warnings will be calculated based on the last stable build, allowing reverts of unstable builds where the number of warnings was decreased. (default false)

  • thresholds (dict) –

    thresholds:
    • unstable (dict)
      unstable:
      • total-all (int)

      • total-high (int)

      • total-normal (int)

      • total-low (int)

      • new-all (int)

      • new-high (int)

      • new-normal (int)

      • new-low (int)

    • failed (dict)
      failed:
      • total-all (int)

      • total-high (int)

      • total-normal (int)

      • total-low (int)

      • new-all (int)

      • new-high (int)

      • new-normal (int)

      • new-low (int)

Minimal Example:

project-type: maven
reporters:
    - findbugs

Full Example:

project-type: maven
reporters:
    - findbugs:
        rank-priority: true
        include-files: 'f,d,e,.*'
        exclude-files: 'a,c,d,.*'
        can-run-on-failed: true
        healthy: 80
        unhealthy: 10
        use-delta-values: true
        health-threshold: 'high'
        thresholds:
            unstable:
                total-all: 90
                total-high: 80
                total-normal: 50
                total-low: 20
                new-all: 95
                new-high: 85
                new-normal: 55
                new-low: 25
            failed:
                total-all: 80
                total-high: 70
                total-normal: 40
                total-low: 10
                new-all: 85
                new-high: 75
                new-normal: 45
                new-low: 15
        dont-compute-new: false
        use-delta-values: true
        use-previous-build-as-reference: true
        use-stable-build-as-reference: true