From e7dbe62d2ad2d204f62fb7a8e5c20ed27501a103 Mon Sep 17 00:00:00 2001 From: Eric Downing Date: Tue, 29 Sep 2026 21:49:22 -0700 Subject: [PATCH 1/7] updated full build with bazel clean --- agone_jenkins | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agone_jenkins b/agone_jenkins index e5a03ee..c002808 100644 --- a/agone_jenkins +++ b/agone_jenkins @@ -30,6 +30,9 @@ COVERITY_URL = 'http://coverity.etechtips.com' // 1. Clean previous Coverity intermediate directory sh 'rm -rf cov-int' + // Clean Bazel outputs + sh 'bazel clean' + // 2. Run full Bazel build wrapped in cov-build // --spawn_strategy=standalone ensures Coverity intercepts compiler processes sh ''' -- 2.54.0 From 4cb1102b5631cb4283e107eb59cc0c0dc644ee35 Mon Sep 17 00:00:00 2001 From: Eric Downing Date: Tue, 29 Sep 2026 22:02:12 -0700 Subject: [PATCH 2/7] merging main --- agone_jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agone_jenkins b/agone_jenkins index c002808..1ba930c 100644 --- a/agone_jenkins +++ b/agone_jenkins @@ -75,7 +75,7 @@ bazel build --spawn_strategy=standalone //:run script { echo "Starting agone-pr build..." echo "The current branch is: ${env.BRANCH_NAME}" - + // 1. Determine target branch and fetch changes def targetBranch = env.CHANGE_TARGET ?: 'main' sh "git fetch origin ${targetBranch}" -- 2.54.0 From 3734ceee3356b8f61a33117953768e12730cec8b Mon Sep 17 00:00:00 2001 From: Eric Downing Date: Tue, 29 Sep 2026 22:20:14 -0700 Subject: [PATCH 3/7] added bazel flag --- agone_jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agone_jenkins b/agone_jenkins index 1ba930c..9c1d736 100644 --- a/agone_jenkins +++ b/agone_jenkins @@ -36,7 +36,7 @@ COVERITY_URL = 'http://coverity.etechtips.com' // 2. Run full Bazel build wrapped in cov-build // --spawn_strategy=standalone ensures Coverity intercepts compiler processes sh ''' - cov-build --dir cov-int \ + cov-build --dir cov-int --bazel \ bazel build --spawn_strategy=standalone //:run ''' -- 2.54.0 From 339028b826079206a040be2d40c5f2c9a8435cac Mon Sep 17 00:00:00 2001 From: Eric Downing Date: Tue, 29 Sep 2026 22:26:00 -0700 Subject: [PATCH 4/7] fixed url for Coverity Connect --- agone_jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agone_jenkins b/agone_jenkins index 9c1d736..a711060 100644 --- a/agone_jenkins +++ b/agone_jenkins @@ -2,7 +2,7 @@ pipeline { agent any environment { -COVERITY_URL = 'http://coverity.etechtips.com' +COVERITY_URL = 'https://coverity.etechtips.com' COVERITY_STREAM = 'agone-full' // Add Coverity binaries to PATH if not globally set on the Jenkins agent PATH = "/opt/coverity/analysis/bin:${env.PATH}" -- 2.54.0 From d5dff17d10043467eea360e75aa833c33a9db235 Mon Sep 17 00:00:00 2001 From: Eric Downing Date: Tue, 29 Sep 2026 23:09:00 -0700 Subject: [PATCH 5/7] updated storing intdir from nightly for reuse --- agone_jenkins | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/agone_jenkins b/agone_jenkins index a711060..9265178 100644 --- a/agone_jenkins +++ b/agone_jenkins @@ -2,10 +2,17 @@ pipeline { agent any environment { -COVERITY_URL = 'https://coverity.etechtips.com' + COVERITY_URL = 'https://coverity.etechtips.com' COVERITY_STREAM = 'agone-full' + COVERITY_PR_STREAM = 'agone-pr' // Add Coverity binaries to PATH if not globally set on the Jenkins agent PATH = "/opt/coverity/analysis/bin:${env.PATH}" + + // Full-build baseline artifact + COVERITY_BASELINE_ARCHIVE = 'agone-full-cov-int.tar.gz' + + //For a Multibranch Pipeline + AGONE_FULL_JOB = 'agone/main' } options { @@ -57,6 +64,21 @@ bazel build --spawn_strategy=standalone //:run --password ${COV_PASSWORD} """ } + // 5. Package the completed full-build intermediate directory + sh ''' + rm -f "${COVERITY_BASELINE_ARCHIVE}" + tar -czvf "{COVERITY_BASELINE_ARCHIVE}" cov-int + test -s "${COVERITY_BASELINE_ARCHIVE}" + + ''' + + // 6. Store Baseline as a jenkins artifact + archiveArtifacts ( + artifacts: "${COVERITY_BASELINE_ARCHIVE}", + fingerprint: true, + onlyIfSuccessful: true + ) + } } } @@ -75,7 +97,7 @@ bazel build --spawn_strategy=standalone //:run script { echo "Starting agone-pr build..." echo "The current branch is: ${env.BRANCH_NAME}" - + // 1. Determine target branch and fetch changes def targetBranch = env.CHANGE_TARGET ?: 'main' sh "git fetch origin ${targetBranch}" @@ -109,12 +131,28 @@ bazel build --spawn_strategy=standalone //:run echo "Affected Bazel targets:\n${affectedTargets}" - // 4. Clean PR-specific Coverity directory - sh 'rm -rf cov-int-pr' + copyArtifacts ( + projectName: "${AGONE_FULL_JOB}", + selector: last_successful(), + filter: "${COVERITY_BASELINE_ARCHIVE}", + fingerprintArtifacts: true + ) + + // 4a. recover nightly pr + sh ''' + rm -rf cov-int-pr baseline-cov-int + mkdir baseline-cov-int + tar -xzf "${COVERITY_BASELINE_ARCHIVE}' \ + -C baseline-cov-int + test -d baseline-cov-int/cov-int + + mv baseline-cov-int/cov-int cov-int-pr + rmdir baseline-cov-int + ''' // 5. Build only the affected targets wrapped in cov-build sh """ - cov-build --dir cov-int-pr \ + cov-build --dir cov-int-pr --bazel \ bazel build --spawn_strategy=standalone ${affectedTargets.replaceAll('\n', ' ')} """ @@ -122,7 +160,7 @@ bazel build --spawn_strategy=standalone //:run sh """ cov-run-desktop --dir cov-int-pr \ --target-url ${COVERITY_URL} \ - --stream ${COVERITY_STREAM} \ + --stream ${COVERITY_PR_STREAM} \ ${changedFiles.replaceAll('\n', ' ')} """ } -- 2.54.0 From 4fb07a618d47e9d6fd58b360b31381807405bc00 Mon Sep 17 00:00:00 2001 From: Eric Downing Date: Tue, 29 Sep 2026 23:23:17 -0700 Subject: [PATCH 6/7] update interpolation --- agone_jenkins | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/agone_jenkins b/agone_jenkins index 9265178..0336da7 100644 --- a/agone_jenkins +++ b/agone_jenkins @@ -56,13 +56,13 @@ bazel build --spawn_strategy=standalone //:run passwordVariable: 'COV_PASSWORD', usernameVariable: 'COV_USER' )]) { - sh """ + sh ''' cov-commit-defects --dir cov-int \ - --url ${COVERITY_URL} \ - --stream ${COVERITY_STREAM} \ - --user ${COV_USER} \ - --password ${COV_PASSWORD} - """ + --url "${COVERITY_URL}" \ + --stream "${COVERITY_STREAM}" \ + --user "${COV_USER}" \ + --password "${COV_PASSWORD}" + ''' } // 5. Package the completed full-build intermediate directory sh ''' @@ -142,7 +142,7 @@ bazel build --spawn_strategy=standalone //:run sh ''' rm -rf cov-int-pr baseline-cov-int mkdir baseline-cov-int - tar -xzf "${COVERITY_BASELINE_ARCHIVE}' \ + tar -xzf "${COVERITY_BASELINE_ARCHIVE}" \ -C baseline-cov-int test -d baseline-cov-int/cov-int @@ -157,12 +157,12 @@ bazel build --spawn_strategy=standalone //:run """ // 6. Run fast desktop analysis on only changed files - sh """ + sh ''' cov-run-desktop --dir cov-int-pr \ - --target-url ${COVERITY_URL} \ - --stream ${COVERITY_PR_STREAM} \ + --target-url "${COVERITY_URL}" \ + --stream "${COVERITY_PR_STREAM}" \ ${changedFiles.replaceAll('\n', ' ')} - """ + ''' } } } -- 2.54.0 From 8bf5a6ff543ac2187d86c90912ae7abbc8176cbe Mon Sep 17 00:00:00 2001 From: Eric Downing Date: Tue, 29 Sep 2026 23:30:20 -0700 Subject: [PATCH 7/7] typo --- agone_jenkins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agone_jenkins b/agone_jenkins index 0336da7..a291590 100644 --- a/agone_jenkins +++ b/agone_jenkins @@ -67,7 +67,7 @@ bazel build --spawn_strategy=standalone //:run // 5. Package the completed full-build intermediate directory sh ''' rm -f "${COVERITY_BASELINE_ARCHIVE}" - tar -czvf "{COVERITY_BASELINE_ARCHIVE}" cov-int + tar -czf "${COVERITY_BASELINE_ARCHIVE}" cov-int test -s "${COVERITY_BASELINE_ARCHIVE}" ''' -- 2.54.0