From b9d610a9e522d71a89d2daeb6f71b2bc2a71cdf7 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Thu, 14 Mar 2024 22:10:28 +1000 Subject: [PATCH] Fix: Workaround for yaml multiline string Fix JaCoCo exclude patterns format. JJB 6.x does not process the job config when double quotes are used and returns the following error. Error: requests.exceptions.HTTPError: 500 Server Error: Server Error for url: https://jenkins.opendaylight.org/releng/job/distribution-\ merge-managed-argon/config.xml Using YAML multiline '>-' introduces spaces between lines that causes JJB updates to fail when the job exists on Jenkins. Therefore as workaround use double-quoted string with newline escape. Using '>-' introduces space that causes consecutive JJB updates to fail with the same 500 internal error. Expected pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**" Generated by JJB with YAML multiline '>-': "**/gen/**, **/generated-sources/**, **/yang-gen**, **/pax/**" Therefore use the workaround of double quoted string with newline escape. Issue: RELENG-5118 Change-Id: Id26a78280768dbc43a74d3d393907da946c15dd4 Signed-off-by: Anil Belur --- jjb/lf-maven-jobs.yaml | 36 ++++++++++------------ ...-exclusion-pattern-format-1a034b6d3d0508e5.yaml | 15 +++++++++ 2 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/workaround-fix-exclusion-pattern-format-1a034b6d3d0508e5.yaml diff --git a/jjb/lf-maven-jobs.yaml b/jjb/lf-maven-jobs.yaml index 61743770..59cb8932 100644 --- a/jjb/lf-maven-jobs.yaml +++ b/jjb/lf-maven-jobs.yaml @@ -733,11 +733,10 @@ disable-job: false git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" - jacoco-exclude-pattern: >- - **/gen/**, - **/generated-sources/**, - **/yang-gen**, - **/pax/**, + jacoco-exclude-pattern: "**/gen/**,\ + **/generated-sources/**,\ + **/yang-gen**,\ + **/pax/**" java-version: openjdk11 mvn-global-settings: global-settings mvn-goals: clean deploy @@ -1330,11 +1329,10 @@ disable-job: false git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" - jacoco-exclude-pattern: >- - **/gen/**, - **/generated-sources/**, - **/yang-gen**, - **/pax/**, + jacoco-exclude-pattern: "**/gen/**,\ + **/generated-sources/**,\ + **/yang-gen**,\ + **/pax/**" java-version: openjdk11 java-opts: "" mvn-global-settings: global-settings @@ -1729,11 +1727,10 @@ disable-job: false git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" - jacoco-exclude-pattern: >- - **/gen/**, - **/generated-sources/**, - **/yang-gen**, - **/pax/** + jacoco-exclude-pattern: "**/gen/**,\ + **/generated-sources/**,\ + **/yang-gen**,\ + **/pax/**" java-version: openjdk11 mvn-global-settings: global-settings mvn-goals: clean deploy @@ -1975,11 +1972,10 @@ disable-job: false git-url: "$GIT_URL/$PROJECT" github-url: "https://github.com" - jacoco-exclude-pattern: >- - **/gen/**, - **/generated-sources/**, - **/yang-gen**, - **/pax/** + jacoco-exclude-pattern: "**/gen/**,\ + **/generated-sources/**,\ + **/yang-gen**,\ + **/pax/**" java-version: openjdk11 mvn-global-settings: global-settings mvn-goals: clean deploy diff --git a/releasenotes/notes/workaround-fix-exclusion-pattern-format-1a034b6d3d0508e5.yaml b/releasenotes/notes/workaround-fix-exclusion-pattern-format-1a034b6d3d0508e5.yaml new file mode 100644 index 00000000..41b4201d --- /dev/null +++ b/releasenotes/notes/workaround-fix-exclusion-pattern-format-1a034b6d3d0508e5.yaml @@ -0,0 +1,15 @@ +--- +fixes: + - | + Fix JaCoCo exclude patterns format. JJB 6.x does not process + the job config when double quotes are used and returns the + following error. + + Error: + requests.exceptions.HTTPError: 500 Server Error: Server Error for url: + https://jenkins.opendaylight.org/releng/job/distribution-\ + merge-managed-argon/config.xml + + Using YAML multiline introduces spaces between lines that causes JJB + updates to fail when the job exists on Jenkins. Therefore, as workaround + use double-quoted string with newline escape. -- 2.16.6