From 2bad5c0629f130e09acb0225df6abfacfc760969 Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Mon, 28 Aug 2023 21:13:07 -0700 Subject: [PATCH] CI!: Create variable for jacoco exclusion pattern 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 --- docs/jjb/lf-maven-jobs.rst | 2 ++ jjb/lf-macros.yaml | 2 +- jjb/lf-maven-jobs.yaml | 16 ++++++++++++---- .../notes/param-jacoco-x-pattern-b71be32ff34158e0.yaml | 11 +++++++++++ 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/param-jacoco-x-pattern-b71be32ff34158e0.yaml diff --git a/docs/jjb/lf-maven-jobs.rst b/docs/jjb/lf-maven-jobs.rst index 00c6313b..8e4c6c26 100644 --- a/docs/jjb/lf-maven-jobs.rst +++ b/docs/jjb/lf-maven-jobs.rst @@ -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) diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index bf76f3b0..2d7a1fe3 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -684,7 +684,7 @@ 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: diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index abc6d0fd..dec111f3 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -733,6 +733,7 @@ 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 @@ -794,7 +795,8 @@ publishers: - findbugs - - lf-jacoco-report + - lf-jacoco-report: + exclude-pattern: "{jacoco-exclude-pattern}" - lf-infra-publish - trigger-parameterized-builds: "{obj:post_build_trigger}" @@ -1316,6 +1318,7 @@ 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 @@ -1398,7 +1401,8 @@ notbuilt: true publishers: - - lf-jacoco-report + - lf-jacoco-report: + exclude-pattern: "{jacoco-exclude-pattern}" - findbugs - lf-infra-publish @@ -1710,6 +1714,7 @@ 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 @@ -1765,7 +1770,8 @@ publishers: - findbugs - - lf-jacoco-report + - lf-jacoco-report: + exclude-pattern: "{jacoco-exclude-pattern}" - lf-infra-publish - job-template: @@ -1950,6 +1956,7 @@ 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 @@ -1995,7 +2002,8 @@ 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 index 00000000..e5dfdfff --- /dev/null +++ b/releasenotes/notes/param-jacoco-x-pattern-b71be32ff34158e0.yaml @@ -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. -- 2.16.6