CI!: Create variable for jacoco exclusion pattern 70/72070/1
authorEric Ball <eball@linuxfoundation.org>
Tue, 29 Aug 2023 04:13:07 +0000 (21:13 -0700)
committerEric Ball <eball@linuxfoundation.org>
Tue, 29 Aug 2023 04:16:44 +0000 (21:16 -0700)
This changes the signature of lf-jacoco-report macro. All
implementations within global-jjb have been updated, but any uses of
this macro outside of global-jjb will need to be updated.

Issue: RELENG-4856
Change-Id: I3db8ab048fb9d79d4503f455e967a4a26a4a0411
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
docs/jjb/lf-maven-jobs.rst
jjb/lf-macros.yaml
jjb/lf-maven-jobs.yaml
releasenotes/notes/param-jacoco-x-pattern-b71be32ff34158e0.yaml [new file with mode: 0644]

index 00c6313..8e4c6c2 100644 (file)
@@ -371,6 +371,8 @@ This job uses the following strategy to deploy jobs to Nexus:
         one may want to provide more than 1 cron timer. (default: 'H H * * 0'
         to run weekly)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    :jacoco-exclude-pattern: Ant-style patterns to exclude from Jacoco coverage
+        report. (default: ``"**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"``)
     :java-version: Version of Java to use for the build. (default: openjdk11)
     :mvn-global-settings: The name of the Maven global settings to use for
         Maven configuration. (default: global-settings)
index bf76f3b..2d7a1fe 100644 (file)
           class-pattern: "**/classes"
           source-pattern: "**/src/main/java"
           # yamllint disable-line rule:line-length
-          exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
+          exclusion-pattern: "{exclude-pattern}"
           status-update: true
           targets:
             - branch:
index abc6d0f..dec111f 100644 (file)
     disable-job: false
     git-url: "$GIT_URL/$PROJECT"
     github-url: "https://github.com"
+    jacoco-exclude-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
     java-version: openjdk11
     mvn-global-settings: global-settings
     mvn-goals: clean deploy
 
     publishers:
       - findbugs
-      - lf-jacoco-report
+      - lf-jacoco-report:
+          exclude-pattern: "{jacoco-exclude-pattern}"
       - lf-infra-publish
       - trigger-parameterized-builds: "{obj:post_build_trigger}"
 
     disable-job: false
     git-url: "$GIT_URL/$PROJECT"
     github-url: "https://github.com"
+    jacoco-exclude-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
     java-version: openjdk11
     java-opts: ""
     mvn-global-settings: global-settings
             notbuilt: true
 
     publishers:
-      - lf-jacoco-report
+      - lf-jacoco-report:
+          exclude-pattern: "{jacoco-exclude-pattern}"
       - findbugs
       - lf-infra-publish
 
     disable-job: false
     git-url: "$GIT_URL/$PROJECT"
     github-url: "https://github.com"
+    jacoco-exclude-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
     java-version: openjdk11
     mvn-global-settings: global-settings
     mvn-goals: clean deploy
 
     publishers:
       - findbugs
-      - lf-jacoco-report
+      - lf-jacoco-report:
+          exclude-pattern: "{jacoco-exclude-pattern}"
       - lf-infra-publish
 
 - job-template:
     disable-job: false
     git-url: "$GIT_URL/$PROJECT"
     github-url: "https://github.com"
+    jacoco-exclude-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
     java-version: openjdk11
     mvn-global-settings: global-settings
     mvn-goals: clean deploy
 
     publishers:
       - findbugs
-      - lf-jacoco-report
+      - lf-jacoco-report:
+          exclude-pattern: "{jacoco-exclude-pattern}"
       - lf-infra-publish
 
 - job-template:
diff --git a/releasenotes/notes/param-jacoco-x-pattern-b71be32ff34158e0.yaml b/releasenotes/notes/param-jacoco-x-pattern-b71be32ff34158e0.yaml
new file mode 100644 (file)
index 0000000..e5dfdff
--- /dev/null
@@ -0,0 +1,11 @@
+---
+upgrade:
+  - |
+    ``lf-jacoco-report`` publisher now uses the ``exclude-pattern`` variable to set
+    the exclusion pattern. Any job implementing this publisher needs to define
+    this variable.
+
+    Additionally, all ``lf-maven`` job templates that utilize the ``lf-jacoco-report``
+    publisher define the exclusion pattern with the variable ``jacoco-exclude-pattern``.
+    This can be overwritten by the calling project definition/template in order
+    to set a custom exclusion pattern.