The openstack-cron job email report. 91/65191/11
authorAric Gardner <agardner@linuxfoundation.org>
Tue, 25 Aug 2020 18:28:47 +0000 (14:28 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Mon, 31 Aug 2020 20:33:37 +0000 (16:33 -0400)
The openstack-cron job should report to LF staff when it fails

Upgrade notes:
Will require all projects to add:
failure-notification: "releng+PROJECTCODE@linuxfoundation.org"
failure-notification-prefix: "[releng]"
to jjb/defaults.yaml

Issue-ID: IT-20409
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I0f4f9ad5f6e810898b9815d7ff66784557e2fc71

.jjb-test/defaults.yaml
docs/jjb/lf-macros.rst
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml
releasenotes/notes/global-jjb-email-notification-24186fedba802540.yaml [new file with mode: 0644]

index f7d8894..34027eb 100644 (file)
@@ -27,3 +27,5 @@
     project: releng/ciman
     stream: latest
     build-node: build-vm
+    failure-notification: "fake@example.org"
+    failure-notification-prefix: "[releng]"
index 3d1b39e..4280cb8 100644 (file)
@@ -530,3 +530,10 @@ lf-infra-wrappers-windows
 
 Provides lf-infra recommended wrappers for use in every job-template targetting
 Windows systems.
+
+
+global-jjb-email-notification
+-----------------------------
+
+Provides a publisher macro that ties into the lf-openstack-cron job
+to alert admins if this job fails.
index a7d2ced..39ebc8f 100644 (file)
 
     publishers:
       - lf-infra-publish
+      - global-jjb-email-notification:
+          email-recipients: "{failure-notification}"
+          email-prefix: "{failure-notification-prefix}"
 
 - job-template:
     name: "{project-name}-openstack-cron"
index 8726760..511e51d 100644 (file)
             - "**/*.jenkins-trigger"
           fail-build: false
 
+- publisher:
+    name: global-jjb-email-notification
+    publishers:
+      - email-ext:
+          recipients: "{email-recipients}"
+          reply-to: ""
+          content-type: default
+          subject: "{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!"
+          body: |
+            $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
+
+            Please refer to the logs server URL for console logs when possible
+            and use the Jenkins Build URL as a last resort.
+
+            Jenkins Build URL:
+            $BUILD_URL
+          unstable: true
+          fixed: true
+          send-to:
+            - recipients
+
 #######
 # SCM #
 #######
diff --git a/releasenotes/notes/global-jjb-email-notification-24186fedba802540.yaml b/releasenotes/notes/global-jjb-email-notification-24186fedba802540.yaml
new file mode 100644 (file)
index 0000000..d04c772
--- /dev/null
@@ -0,0 +1,15 @@
+---
+prelude: >
+  Provides method to notify administrators if important jobs are failing.
+features:
+  - |
+    Allows customization of email address and email prefix.
+    failure-notification-prefix
+    failure-notification
+upgrade:
+  - |
+    Updating to this version of JJB will _require_ updating
+    jjb/defaults.yaml in the same patchset.
+    The following will need to be defined:
+    failure-notification: "foo@bar.org"
+    failure-notification-prefix: "[Some Prefix]"