From 614a7be5212c333c9a2e03abe3d8f140aac5f9ab Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Fri, 6 Dec 2024 12:50:05 +0100 Subject: [PATCH 01/14] BUILD-7003 Set up Develocity --- .cirrus.yml | 13 ++- gradle.properties | 1 + gradle/verification-metadata.xml | 171 +++++++++++++++++++++++++++++++ settings.gradle.kts | 21 ++++ 4 files changed, 199 insertions(+), 7 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 612126bb5..28395097b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,8 +1,4 @@ env: - CIRRUS_VAULT_URL: https://vault.sonar.build:8200 - CIRRUS_VAULT_AUTH_PATH: jwt-cirrusci - CIRRUS_VAULT_ROLE: cirrusci-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME} - ARTIFACTORY_URL: VAULT[development/kv/data/repox data.url] ARTIFACTORY_PRIVATE_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader @@ -18,6 +14,9 @@ env: ORG_GRADLE_PROJECT_signingPassword: VAULT[development/kv/data/sign data.passphrase] ORG_GRADLE_PROJECT_signingKeyId: 0x7DCD4258 + DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token] + DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN} + # Use bash (instead of sh on linux or cmd.exe on windows) CIRRUS_SHELL: bash @@ -81,7 +80,7 @@ gradle_its_template: &GRADLE_ITS_TEMPLATE git submodule update --init --depth 1 "${GIT_SUB_MODULE}" fi - source cirrus-env QA - - ./gradlew "${GRADLE_TASK}" "-P${ITS_PROJECT}" + - ./gradlew "${GRADLE_TASK}" "-P${ITS_PROJECT}" -Dscan.tag.CI -Dscan.tag.${ITS_PROJECT} -Dscan.tag.SQ_${SQ_VERSION} "-Dsonar.runtimeVersion=${SQ_VERSION}" "-DbuildNumber=$BUILD_NUMBER" --info --console plain --no-daemon --build-cache @@ -146,7 +145,7 @@ ws_scan_task: folder: ${CIRRUS_WORKING_DIR}/.m2/repository whitesource_script: - source cirrus-env QA - - ./gradlew clean assemble + - ./gradlew clean assemble -Dscan.tag.WS_BUILD - source ./export_ws_variables.sh - source ws_scan.sh allow_failures: "true" @@ -202,7 +201,7 @@ qa_ruling_kotlin_compiler_task: git submodule update --init --depth 1 "${GIT_SUB_MODULE}" fi - source cirrus-env QA - - ./gradlew :its:ruling:test --tests "org.sonarsource.slang.SlangRulingTest.test_kotlin_compiler" -Pruling + - ./gradlew :its:ruling:test --tests "org.sonarsource.slang.SlangRulingTest.test_kotlin_compiler" -Pruling -Dscan.tag.CI -Dscan.tag.ruling -Dscan.tag.kotlin-compiler "-Dsonar.runtimeVersion=${SQ_VERSION}" "-DbuildNumber=$BUILD_NUMBER" --info --console plain --no-daemon --build-cache diff --git a/gradle.properties b/gradle.properties index a11f35367..e0e26c319 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,3 +4,4 @@ description=Code Analyzer for Kotlin projectTitle=Kotlin kotlinVersion=2.0.21 org.gradle.jvmargs=-Xmx4096M +org.gradle.caching=true diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 2ee32e075..f6a0c0052 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -220,6 +220,11 @@ + + + + + @@ -745,6 +750,11 @@ + + + + + @@ -855,6 +865,11 @@ + + + + + @@ -865,6 +880,11 @@ + + + + + @@ -875,11 +895,21 @@ + + + + + + + + + + @@ -895,6 +925,11 @@ + + + + + @@ -910,6 +945,11 @@ + + + + + @@ -940,6 +980,11 @@ + + + + + @@ -955,6 +1000,11 @@ + + + + + @@ -970,6 +1020,11 @@ + + + + + @@ -995,6 +1050,11 @@ + + + + + @@ -1010,6 +1070,11 @@ + + + + + @@ -1025,6 +1090,11 @@ + + + + + @@ -1046,6 +1116,14 @@ + + + + + + + + @@ -1061,6 +1139,11 @@ + + + + + @@ -1076,6 +1159,11 @@ + + + + + @@ -1091,6 +1179,11 @@ + + + + + @@ -1106,6 +1199,11 @@ + + + + + @@ -1121,6 +1219,11 @@ + + + + + @@ -1136,6 +1239,11 @@ + + + + + @@ -1186,6 +1294,11 @@ + + + + + @@ -1196,6 +1309,11 @@ + + + + + @@ -1206,6 +1324,11 @@ + + + + + @@ -1226,6 +1349,11 @@ + + + + + @@ -1241,6 +1369,11 @@ + + + + + @@ -1256,6 +1389,11 @@ + + + + + @@ -1271,6 +1409,11 @@ + + + + + @@ -1286,6 +1429,11 @@ + + + + + @@ -1322,6 +1470,14 @@ + + + + + + + + @@ -1425,6 +1581,11 @@ + + + + + @@ -1440,6 +1601,11 @@ + + + + + @@ -1455,6 +1621,11 @@ + + + + + diff --git a/settings.gradle.kts b/settings.gradle.kts index 31d509284..d88a96df2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -93,3 +93,24 @@ dependencyResolutionManagement { } } } + +plugins { + id("com.gradle.develocity") version("3.18.2") +} + +develocity { + server = "https://develocity.sonar.build" + +} + +val isCI: Boolean = System.getenv("CI") != null + +buildCache { + local { + isEnabled = !isCI + } + remote(develocity.buildCache) { + isEnabled = true + isPush = isCI + } +} From af6ef29dc5e6a4eb85489586979607482720f198 Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Fri, 6 Dec 2024 14:45:12 +0100 Subject: [PATCH 02/14] Add CI tags --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 28395097b..f2d4ab249 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -105,7 +105,7 @@ build_task: DEPLOY_PULL_REQUEST: true build_script: - source cirrus-env BUILD-PRIVATE - - regular_gradle_build_deploy_analyze -x test -x sonar + - regular_gradle_build_deploy_analyze -x test -x sonar -Dscan.tag.CI -Dscan.tag.build on_failure: error_log_artifacts: path: "hs_err_pid*.log" @@ -124,7 +124,7 @@ build_test_analyze_task: DEPLOY_PULL_REQUEST: true build_script: - source cirrus-env BUILD-PRIVATE - - regular_gradle_build_deploy_analyze -x artifactoryPublish + - regular_gradle_build_deploy_analyze -x artifactoryPublish -Dscan.tag.CI -Dscan.tag.test-analyze on_failure: error_log_artifacts: path: "hs_err_pid*.log" From 286aa04052835f6ccde5b6e4fcd5fef144064b2a Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Mon, 9 Dec 2024 12:04:56 +0100 Subject: [PATCH 03/14] Trigger CI From a4f6b8a8b25e82e5c167ade5aff016bf4a8503a0 Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Mon, 9 Dec 2024 12:19:25 +0100 Subject: [PATCH 04/14] Try fix flaky inputs for Compile tasks --- gradle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle.properties b/gradle.properties index e0e26c319..a813d17bf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,3 +5,4 @@ projectTitle=Kotlin kotlinVersion=2.0.21 org.gradle.jvmargs=-Xmx4096M org.gradle.caching=true +kotlin.build.archivesTaskOutputAsFriendModule=false From 69ebba24ca1cdf698ba362da96fc57e5c11ededc Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Mon, 9 Dec 2024 12:25:36 +0100 Subject: [PATCH 05/14] Trigger CI From 969333377e6c86ce7e47114d614c553c6c853d0b Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Mon, 9 Dec 2024 14:18:35 +0100 Subject: [PATCH 06/14] Disable upload in background --- .cirrus.yml | 2 +- settings.gradle.kts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index f2d4ab249..3f13646b9 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -212,7 +212,7 @@ build_win_task: <<: *WINDOWS_16_CPU_32G <<: *SETUP_GRADLE_CACHE build_script: - - ./gradlew build --info --console plain --no-daemon --build-cache + - ./gradlew build --info --console plain --no-daemon --build-cache -Dscan.tag.CI -Dscan.tag.build-win on_failure: error_log_artifacts: path: "hs_err_pid*.log" diff --git a/settings.gradle.kts b/settings.gradle.kts index d88a96df2..08cd5a7c9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -98,13 +98,16 @@ plugins { id("com.gradle.develocity") version("3.18.2") } +val isCI: Boolean = System.getenv("CI") != null + develocity { server = "https://develocity.sonar.build" + buildScan { + uploadInBackground.set(!isCI) + } } -val isCI: Boolean = System.getenv("CI") != null - buildCache { local { isEnabled = !isCI From 5d4d5fb5609151ddc5fa534be27d38910cace28d Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Mon, 9 Dec 2024 15:55:54 +0100 Subject: [PATCH 07/14] Trigger CI From 4cc96c2206e689d4a4d1ba48067900e42b0b675f Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Mon, 9 Dec 2024 16:28:40 +0100 Subject: [PATCH 08/14] Split test and analyze --- .cirrus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3f13646b9..fbfb82aa2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -124,7 +124,8 @@ build_test_analyze_task: DEPLOY_PULL_REQUEST: true build_script: - source cirrus-env BUILD-PRIVATE - - regular_gradle_build_deploy_analyze -x artifactoryPublish -Dscan.tag.CI -Dscan.tag.test-analyze + - ./gradlew build -Dscan.tag.CI -Dscan.tag.test + - regular_gradle_build_deploy_analyze -x build -x artifactoryPublish -Dscan.tag.CI -Dscan.tag.analyze on_failure: error_log_artifacts: path: "hs_err_pid*.log" From 9802c6abcf6e3ac230753fe74f9c45394b92570a Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Mon, 9 Dec 2024 16:36:12 +0100 Subject: [PATCH 09/14] Trigger CI From 92d13b885644d0de7309ef6ff0f692083f5c35ba Mon Sep 17 00:00:00 2001 From: Margarita Nedzelska Date: Thu, 12 Dec 2024 15:48:00 +0100 Subject: [PATCH 10/14] Add input normalization --- build.gradle.kts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index e12330f28..021cfc00b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -225,6 +225,20 @@ subprojects { gradle.taskGraph.hasTask(":artifactoryPublish") } } + normalization { + runtimeClasspath { + metaInf { + ignoreAttribute("Implementation-Version") + ignoreAttribute("Version") + ignoreAttribute("Implementation-Build") + ignoreAttribute("Build-Time") + ignoreAttribute("Plugin-BuildDate") + ignoreAttribute("Plugin-Display-Version") + ignoreAttribute("Plugin-Version") + ignoreAttribute("Plugin-RequirePlugins") + } + } + } } sonarqube { From 829a7160298ae3d2a7a3e90bc943580f19c1a636 Mon Sep 17 00:00:00 2001 From: Margarita Nedzelska Date: Thu, 12 Dec 2024 16:35:49 +0100 Subject: [PATCH 11/14] TRIGGER CI From ab5bd5ae1efad916b4b4a57e86eeaab72812d1b9 Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Fri, 13 Dec 2024 09:28:11 +0100 Subject: [PATCH 12/14] Add common-custom-user-data-gradle-plugin --- gradle/verification-metadata.xml | 5 +++++ settings.gradle.kts | 1 + 2 files changed, 6 insertions(+) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index f6a0c0052..a655bceee 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -220,6 +220,11 @@ + + + + + diff --git a/settings.gradle.kts b/settings.gradle.kts index 08cd5a7c9..82e42f7b6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -96,6 +96,7 @@ dependencyResolutionManagement { plugins { id("com.gradle.develocity") version("3.18.2") + id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.2" } val isCI: Boolean = System.getenv("CI") != null From d1c0712e8ad5c2180818798527bab2dd99e9aea8 Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Fri, 13 Dec 2024 09:50:14 +0100 Subject: [PATCH 13/14] Trigger CI From 3b943ec5bfd29638709e15dc3441dcb9722449b7 Mon Sep 17 00:00:00 2001 From: Marharyta Nedzelska Date: Wed, 8 Jan 2025 17:31:00 +0100 Subject: [PATCH 14/14] Trigger CI