Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONARJAVA-5244 Onboard sonar-java on Develocity #4963

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token]
GRADLE_ENTERPRISE_USERNAME: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.username]
GRADLE_ENTERPRISE_PASSWORD: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.password]
GRADLE_ENTERPRISE_URL: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.url]
GRADLE_ENTERPRISE_KEY: VAULT[development/team/sonarqube/kv/data/gradle-enterprise data.access-key]
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
# Allows to run builds for the 50 last commits in a branch:
Expand Down Expand Up @@ -47,6 +45,10 @@
only_sonarsource_qa: &ONLY_SONARSOURCE_QA
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")

log_develocity_url_script: &log_develocity_url_script |
echo "Develocity URL: https://develocity.sonar.build/scans?search.publicHostnames=cirrus-ci-task-${CIRRUS_TASK_ID}"


common_build_definition: &COMMON_BUILD_DEFINITION
eks_container:
<<: *CONTAINER_DEFINITION
Expand Down Expand Up @@ -82,13 +84,15 @@
build_task:
<<: *COMMON_BUILD_DEFINITION
build_script:
- *log_develocity_url_script
- source cirrus-env BUILD
- regular_mvn_build_deploy_analyze -Dmaven.test.skip=true -Dsonar.skip=true -pl '!java-checks-test-sources/default,!java-checks-test-sources/aws'
cleanup_before_cache_script: cleanup_maven_repository

test_analyze_task:
<<: *COMMON_BUILD_DEFINITION
build_script:
- *log_develocity_url_script
- source cirrus-env BUILD
# ignore duplications in the SE engine plugin, as it will be moved away from sonar-java at some point
- PULL_REQUEST_SHA=$GIT_SHA1 regular_mvn_build_deploy_analyze -P-deploy-sonarsource,-release,-sign -Dmaven.deploy.skip=true -Dsonar.analysisCache.enabled=true -Dsonar.cpd.exclusions=java-symbolic-execution/**
Expand Down Expand Up @@ -128,6 +132,7 @@
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
build_script:
- *log_develocity_url_script
- source cirrus-env CI
- mvn.cmd clean verify
cleanup_before_cache_script: cleanup_maven_repository
Expand Down Expand Up @@ -157,6 +162,7 @@
submodules_script:
- git submodule update --init --recursive
qa_script:
- *log_develocity_url_script
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- cd its/plugin
Expand All @@ -175,6 +181,7 @@
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
sanity_script:
- *log_develocity_url_script
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- cd java-checks-test-sources
Expand Down Expand Up @@ -205,6 +212,7 @@
- PROFILE: without-sonarqube-project
- PROFILE: only-sonarqube-project
ruling_script:
- *log_develocity_url_script
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- cd its/ruling
Expand Down Expand Up @@ -232,6 +240,7 @@
- PROFILE: without-sonarqube-project
- PROFILE: only-sonarqube-project
ruling_script:
- *log_develocity_url_script
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- init_git_submodules its/sources
Expand All @@ -258,6 +267,7 @@
orchestrator_LATEST_RELEASE_cache:
<<: *ORCHESTRATOR_CACHE_ELEMENTS_DEFINITION
autoscan_script:
- *log_develocity_url_script
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- cd java-checks-test-sources
Expand All @@ -269,7 +279,7 @@
actual_artifacts:
path: "${CIRRUS_WORKING_DIR}/its/autoscan/target/actual/**/*"

promote_task:

Check warning on line 282 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L282

task "promote" depends on task "ws_scan", but their only_if conditions are different

Check warning on line 282 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L282

task "promote" depends on task "ws_scan", but their only_if conditions are different

Check warning on line 282 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L282

task "promote" depends on task "ws_scan", but their only_if conditions are different

Check warning on line 282 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L282

task "promote" depends on task "ws_scan", but their only_if conditions are different

Check warning on line 282 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L282

task "promote" depends on task "ws_scan", but their only_if conditions are different
depends_on:
- build
- test_analyze
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ Desktop.ini

.java-version
.mvn/.gradle-enterprise/gradle-enterprise-workspace-id
.mvn/.develocity/
13 changes: 13 additions & 0 deletions .mvn/develocity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<develocity>
<server>
<url>https://develocity.sonar.build</url>
</server>
<buildCache>
<local>
<storeEnabled>#{env['CI'] == null}</storeEnabled>
</local>
<remote>
<storeEnabled>#{env['CI'] != null}</storeEnabled>
</remote>
</buildCache>
</develocity>
4 changes: 2 additions & 2 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<extensions>
<extension>
<groupId>com.gradle</groupId>
<artifactId>gradle-enterprise-maven-extension</artifactId>
<version>1.19.3</version>
<artifactId>develocity-maven-extension</artifactId>
<version>1.22.2</version>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an open question and we can delay if necessary but did we try with version 1.23.0?

</extension>
<extension>
<groupId>com.gradle</groupId>
Expand Down
14 changes: 0 additions & 14 deletions .mvn/gradle-enterprise.xml

This file was deleted.

Loading