From 9ab6ee675742c1feec1a28456e4800965d0a0398 Mon Sep 17 00:00:00 2001 From: daz Date: Fri, 15 Nov 2024 14:10:13 -0700 Subject: [PATCH 1/3] Bump to version 2.0.2 of CCUDGP --- .github/workflow-samples/groovy-dsl/settings.gradle | 2 +- .github/workflow-samples/kotlin-dsl/settings.gradle.kts | 2 +- .github/workflows/integ-test-inject-develocity.yml | 6 +++--- sources/src/develocity/build-scan.ts | 2 +- sources/test/init-scripts/settings.gradle | 2 +- .../com/gradle/gradlebuildaction/BaseInitScriptTest.groovy | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflow-samples/groovy-dsl/settings.gradle b/.github/workflow-samples/groovy-dsl/settings.gradle index 1ef22e9..123e2d4 100644 --- a/.github/workflow-samples/groovy-dsl/settings.gradle +++ b/.github/workflow-samples/groovy-dsl/settings.gradle @@ -1,6 +1,6 @@ plugins { id "com.gradle.develocity" version "3.18.2" - id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.1" + id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.2" } develocity { diff --git a/.github/workflow-samples/kotlin-dsl/settings.gradle.kts b/.github/workflow-samples/kotlin-dsl/settings.gradle.kts index 033c989..42af587 100644 --- a/.github/workflow-samples/kotlin-dsl/settings.gradle.kts +++ b/.github/workflow-samples/kotlin-dsl/settings.gradle.kts @@ -1,6 +1,6 @@ plugins { id("com.gradle.develocity") version "3.18.2" - id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.1" + id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.2" } develocity { diff --git a/.github/workflows/integ-test-inject-develocity.yml b/.github/workflows/integ-test-inject-develocity.yml index c05265e..daef6e2 100644 --- a/.github/workflows/integ-test-inject-develocity.yml +++ b/.github/workflows/integ-test-inject-develocity.yml @@ -29,7 +29,7 @@ jobs: DEVELOCITY_INJECTION_ENABLED: true DEVELOCITY_URL: https://ge.solutions-team.gradle.com DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }} - DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0' + DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2' ${{matrix.accessKeyEnv}}: ${{ secrets.DEVELOCITY_ACCESS_KEY }} strategy: fail-fast: false @@ -76,7 +76,7 @@ jobs: DEVELOCITY_INJECTION_ENABLED: true DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com' DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }} - DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0' + DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2' strategy: fail-fast: false matrix: @@ -117,7 +117,7 @@ jobs: DEVELOCITY_INJECTION_ENABLED: true DEVELOCITY_URL: 'https://localhost:3333/' DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }} - DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0' + DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2' # Access key also set as an env var, we want to check it does not leak GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} diff --git a/sources/src/develocity/build-scan.ts b/sources/src/develocity/build-scan.ts index c8b49bf..b78fcce 100644 --- a/sources/src/develocity/build-scan.ts +++ b/sources/src/develocity/build-scan.ts @@ -8,7 +8,7 @@ export async function setup(config: BuildScanConfig): Promise { if (config.getBuildScanPublishEnabled()) { maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true') maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.18.2') - maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0') + maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0.2') maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl()) maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree()) } diff --git a/sources/test/init-scripts/settings.gradle b/sources/test/init-scripts/settings.gradle index 5f8f79c..cb540fd 100644 --- a/sources/test/init-scripts/settings.gradle +++ b/sources/test/init-scripts/settings.gradle @@ -1,6 +1,6 @@ plugins { id "com.gradle.develocity" version "3.18.2" - id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.1" + id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.2" } develocity { diff --git a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy index d05bf3a..4c1bffa 100644 --- a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy +++ b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest.groovy @@ -17,7 +17,7 @@ import java.util.zip.GZIPOutputStream class BaseInitScriptTest extends Specification { static final String DEVELOCITY_PLUGIN_VERSION = '3.18.2' - static final String CCUD_PLUGIN_VERSION = '2.0.1' + static final String CCUD_PLUGIN_VERSION = '2.0.2' static final TestGradleVersion GRADLE_3_X = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9) static final TestGradleVersion GRADLE_4_X = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10) From 2aa49bf6a94af584a7eef5ca428468b12ac23fca Mon Sep 17 00:00:00 2001 From: daz Date: Fri, 15 Nov 2024 14:31:56 -0700 Subject: [PATCH 2/3] Set the correct env var for develocity-ccud-plugin-version Fixes #446 --- sources/src/develocity/build-scan.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/src/develocity/build-scan.ts b/sources/src/develocity/build-scan.ts index b78fcce..f4e163f 100644 --- a/sources/src/develocity/build-scan.ts +++ b/sources/src/develocity/build-scan.ts @@ -19,6 +19,7 @@ export async function setup(config: BuildScanConfig): Promise { maybeExportVariableNotEmpty('DEVELOCITY_CAPTURE_FILE_FINGERPRINTS', config.getDevelocityCaptureFileFingerprints()) maybeExportVariableNotEmpty('DEVELOCITY_ENFORCE_URL', config.getDevelocityEnforceUrl()) maybeExportVariableNotEmpty('DEVELOCITY_PLUGIN_VERSION', config.getDevelocityPluginVersion()) + maybeExportVariableNotEmpty('DEVELOCITY_CCUD_PLUGIN_VERSION', config.getDevelocityCcudPluginVersion()) maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl()) maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername()) maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword()) From 333e9d97507751ffcc4387e25b260d74b5d06c3e Mon Sep 17 00:00:00 2001 From: daz Date: Fri, 15 Nov 2024 14:32:34 -0700 Subject: [PATCH 3/3] Do not ignore input parameters when `build-scan-publish` is enabled Fixes #447 --- sources/src/develocity/build-scan.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sources/src/develocity/build-scan.ts b/sources/src/develocity/build-scan.ts index f4e163f..1f4f584 100644 --- a/sources/src/develocity/build-scan.ts +++ b/sources/src/develocity/build-scan.ts @@ -5,13 +5,6 @@ import {setupToken} from './short-lived-token' export async function setup(config: BuildScanConfig): Promise { maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle') maybeExportVariable('DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE', 'gradle-actions') - if (config.getBuildScanPublishEnabled()) { - maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true') - maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.18.2') - maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0.2') - maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl()) - maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree()) - } maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_ENABLED', config.getDevelocityInjectionEnabled()) maybeExportVariableNotEmpty('DEVELOCITY_URL', config.getDevelocityUrl()) @@ -24,6 +17,17 @@ export async function setup(config: BuildScanConfig): Promise { maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername()) maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword()) + // If build-scan-publish is enabled, ensure the environment variables are set + // The DEVELOCITY_PLUGIN_VERSION and DEVELOCITY_CCUD_PLUGIN_VERSION are set to the latest versions + // except if they are defined in the configuration + if (config.getBuildScanPublishEnabled()) { + maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true') + maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.18.2') + maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0.2') + maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl()) + maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree()) + } + return setupToken(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry()) }