Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
a2cf482
without sign
eray-felek-sonarsource Sep 30, 2025
a4d6b5b
Add Sign
eray-felek-sonarsource Sep 30, 2025
49b1b1e
Finish Build
eray-felek-sonarsource Sep 30, 2025
adf20f6
Add Mise
eray-felek-sonarsource Sep 30, 2025
2d272f4
SLE-1276 set Tycho project version (#943)
julien-carsique-sonarsource Oct 1, 2025
1b5c726
Add Validate
eray-felek-sonarsource Oct 1, 2025
edbba2d
Debug
eray-felek-sonarsource Oct 2, 2025
14cee64
Use temurin
eray-felek-sonarsource Oct 2, 2025
e43645f
revert
eray-felek-sonarsource Oct 2, 2025
e55b69a
Debug
eray-felek-sonarsource Oct 2, 2025
3782439
Fix
eray-felek-sonarsource Oct 2, 2025
0dfe472
Use sh
eray-felek-sonarsource Oct 6, 2025
6a6a742
QA
eray-felek-sonarsource Oct 8, 2025
4c87751
debug
eray-felek-sonarsource Oct 9, 2025
366e085
add dependencies
eray-felek-sonarsource Oct 9, 2025
06635e6
Increase wait time
eray-felek-sonarsource Oct 9, 2025
9b5ef40
implement cloud
eray-felek-sonarsource Oct 9, 2025
f1db958
disalbe test
eray-felek-sonarsource Oct 9, 2025
feb2168
ignore
eray-felek-sonarsource Oct 9, 2025
274ff88
Fix token
eray-felek-sonarsource Oct 9, 2025
44e5268
Add rest of the qas
eray-felek-sonarsource Oct 9, 2025
602c679
Add SonarQube
eray-felek-sonarsource Oct 10, 2025
1f75cab
use better machines
eray-felek-sonarsource Oct 13, 2025
64ede83
increase timeout and try analysis
eray-felek-sonarsource Oct 13, 2025
09d8a90
Make analysis work
eray-felek-sonarsource Oct 14, 2025
3cc7b39
Fix 403 error
eray-felek-sonarsource Oct 14, 2025
77f6033
Ignore flaky test
eray-felek-sonarsource Oct 14, 2025
f9cf93f
Disable flakes
eray-felek-sonarsource Oct 14, 2025
7d44b53
Set version explicitly
eray-felek-sonarsource Oct 14, 2025
0885fed
Add promote and dogfood
eray-felek-sonarsource Oct 15, 2025
df54747
Fix lines
eray-felek-sonarsource Oct 15, 2025
ecc0ee6
re-enable test
eray-felek-sonarsource Oct 15, 2025
43c477e
Increase timeout
eray-felek-sonarsource Oct 15, 2025
23d6ae1
Try old validate
eray-felek-sonarsource Oct 15, 2025
1af9dca
depend on build
eray-felek-sonarsource Oct 15, 2025
d09e012
save
eray-felek-sonarsource Oct 15, 2025
243b6c7
Decrease machine size
eray-felek-sonarsource Oct 15, 2025
9fc099e
Try sh scripts
eray-felek-sonarsource Oct 15, 2025
aa0a84e
Remove custom versioning and depend on build
eray-felek-sonarsource Oct 15, 2025
fa17ed2
Remove first config maven
eray-felek-sonarsource Oct 15, 2025
03576d7
add env skip
eray-felek-sonarsource Oct 15, 2025
1f78155
Final countdown
eray-felek-sonarsource Oct 15, 2025
1cb43f2
One more try
eray-felek-sonarsource Oct 15, 2025
79144eb
Two more time
eray-felek-sonarsource Oct 15, 2025
868b06e
add cache
eray-felek-sonarsource Oct 15, 2025
cbaf40f
SLE-1262 Unify Dogfooding
eray-felek-sonarsource Oct 16, 2025
ceeda4f
Deploy to make promote pass
eray-felek-sonarsource Oct 16, 2025
bd67696
Do not record analysis
eray-felek-sonarsource Oct 16, 2025
bdfe3b8
Add shadow scans
eray-felek-sonarsource Oct 16, 2025
456e5f7
Add organization
eray-felek-sonarsource Oct 16, 2025
04d9653
use v1
eray-felek-sonarsource Oct 20, 2025
6a8ef33
Apply the maven script fix
eray-felek-sonarsource Oct 22, 2025
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
166 changes: 83 additions & 83 deletions .cirrus.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,89 +187,89 @@ validate_task:
slack_notification_script: |
source slack-failure-notification "Cirrus CI build failure on pipeline: $CIRRUS_PIPELINE_NAME"

qa_connectedModeSonarQube_task:
# name: "Run ITs for Connected Mode with SonarQube"
depends_on:
- build
<<: *ONLY_IF_EXCEPT_NIGHTLY
eks_container:
<<: *BUILDER_CONTAINER_DEFINITION
cpu: 4
memory: 16G
type: m6a.large
env:
ARTIFACTORY_API_KEY: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token]
DISPLAY: :10
MAVEN_OPTS: -Xmx3072m
matrix:
- env:
SQ_VERSION: 'LATEST_RELEASE[9.9]'
QA_CATEGORY: 'LATEST_RELEASE_99'
- env:
SQ_VERSION: 'LATEST_RELEASE'
QA_CATEGORY: 'LATEST_RELEASE'
- env:
SQ_VERSION: 'DEV'
QA_CATEGORY: 'DEV'
<<: *SETUP_MAVEN_CACHE_QA
<<: *SETUP_ORCHESTRATOR_CACHE
download_staged_update_site_script: |
set -euo pipefail
source cirrus-env QA
source .cirrus/set_maven_build_version $BUILD_NUMBER
mvn -B -e -V dependency:unpack \
-Declipse.p2.mirrors=false \
-Dtycho.mode=maven \
-Dartifact=org.sonarsource.sonarlint.eclipse:org.sonarlint.eclipse.site:${PROJECT_VERSION}:zip \
-DoutputDirectory=${CIRRUS_WORKING_DIR}/staged-repository
prepare_background_script: |
set -euo pipefail
/etc/init.d/xvfb start
metacity --sm-disable --replace &
sleep 10 # give metacity some time to start
echo 'Recording tests on video'
ffmpeg -loglevel warning -f x11grab -video_size 1920x1080 -i ${DISPLAY} -codec:v libx264 -r 12 ${CIRRUS_WORKING_DIR}/recording_${QA_CATEGORY}.mp4
run_its_script: |
echo "Run Maven ITs for Connected Mode with SonarQube on Eclipse 2024-03 / 4.31 (latest Java 17) and Server ${SQ_VERSION}"
cd its/
mvn -B -e -V org.jacoco:jacoco-maven-plugin:prepare-agent verify \
-s ${HOME}/.m2/settings-public-auth.xml \
-P coverage,\!standaloneMode,\!connectedModeSc,\!cdtIntegration \
-Declipse.p2.mirrors=false \
-Dtarget.platform=latest-java-17_e431 \
-Dtycho.localArtifacts=ignore \
-Dsonarlint-eclipse.p2.url="file://${CIRRUS_WORKING_DIR}/staged-repository" \
-Dsonar.runtimeVersion=${SQ_VERSION} \
-Djacoco.append=true \
-Djacoco.destFile=${CIRRUS_WORKING_DIR}/it-coverage.exec
mv ${CIRRUS_WORKING_DIR}/it-coverage.exec ${CIRRUS_WORKING_DIR}/it-coverage-${QA_CATEGORY}.exec
cleanup_before_cache_script: cleanup_maven_repository
always:
stop_recording_script: |
pkill -SIGINT -f ffmpeg
while pgrep ffmpeg >/dev/null; do sleep 1; done
/etc/init.d/xvfb stop
test_recording_artifacts:
path: "${CIRRUS_WORKING_DIR}/recording_${QA_CATEGORY}.mp4"
jacoco_it_sq_artifacts:
path: "${CIRRUS_WORKING_DIR}/it-coverage*.exec"
mvn_startTestLog_artifacts:
path: "${CIRRUS_WORKING_DIR}/its/**/target/work/configuration/*.log"
mvn_runTestLog_artifacts:
path: "${CIRRUS_WORKING_DIR}/its/**/target/work/data/.metadata/.log"
on_failure:
xvfb_log_artifacts:
path: "${CIRRUS_WORKING_DIR}/Xvfb.out"
reports_artifacts:
path: "**/reports/**/*"
junit_artifacts:
paths:
- "**/test-results/**/*.xml"
- "**/target/surefire-reports/TEST-*.xml"
format: junit
slack_notification_script: |
source slack-failure-notification "Cirrus CI build failure on pipeline: $CIRRUS_PIPELINE_NAME"
#qa_connectedModeSonarQube_task:
# # name: "Run ITs for Connected Mode with SonarQube"
# depends_on:
# - build
# <<: *ONLY_IF_EXCEPT_NIGHTLY
# eks_container:
# <<: *BUILDER_CONTAINER_DEFINITION
# cpu: 4
# memory: 16G
# type: m6a.large
# env:
# ARTIFACTORY_API_KEY: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
# GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token]
# DISPLAY: :10
# MAVEN_OPTS: -Xmx3072m
# matrix:
# - env:
# SQ_VERSION: 'LATEST_RELEASE[9.9]'
# QA_CATEGORY: 'LATEST_RELEASE_99'
# - env:
# SQ_VERSION: 'LATEST_RELEASE'
# QA_CATEGORY: 'LATEST_RELEASE'
# - env:
# SQ_VERSION: 'DEV'
# QA_CATEGORY: 'DEV'
# <<: *SETUP_MAVEN_CACHE_QA
# <<: *SETUP_ORCHESTRATOR_CACHE
# download_staged_update_site_script: |
# set -euo pipefail
# source cirrus-env QA
# source .cirrus/set_maven_build_version $BUILD_NUMBER
# mvn -B -e -V dependency:unpack \
# -Declipse.p2.mirrors=false \
# -Dtycho.mode=maven \
# -Dartifact=org.sonarsource.sonarlint.eclipse:org.sonarlint.eclipse.site:${PROJECT_VERSION}:zip \
# -DoutputDirectory=${CIRRUS_WORKING_DIR}/staged-repository
# prepare_background_script: |
# set -euo pipefail
# /etc/init.d/xvfb start
# metacity --sm-disable --replace &
# sleep 10 # give metacity some time to start
# echo 'Recording tests on video'
# ffmpeg -loglevel warning -f x11grab -video_size 1920x1080 -i ${DISPLAY} -codec:v libx264 -r 12 ${CIRRUS_WORKING_DIR}/recording_${QA_CATEGORY}.mp4
# run_its_script: |
# echo "Run Maven ITs for Connected Mode with SonarQube on Eclipse 2024-03 / 4.31 (latest Java 17) and Server ${SQ_VERSION}"
# cd its/
# mvn -B -e -V org.jacoco:jacoco-maven-plugin:prepare-agent verify \
# -s ${HOME}/.m2/settings-public-auth.xml \
# -P coverage,\!standaloneMode,\!connectedModeSc,\!cdtIntegration \
# -Declipse.p2.mirrors=false \
# -Dtarget.platform=latest-java-17_e431 \
# -Dtycho.localArtifacts=ignore \
# -Dsonarlint-eclipse.p2.url="file://${CIRRUS_WORKING_DIR}/staged-repository" \
# -Dsonar.runtimeVersion=${SQ_VERSION} \
# -Djacoco.append=true \
# -Djacoco.destFile=${CIRRUS_WORKING_DIR}/it-coverage.exec
# mv ${CIRRUS_WORKING_DIR}/it-coverage.exec ${CIRRUS_WORKING_DIR}/it-coverage-${QA_CATEGORY}.exec
# cleanup_before_cache_script: cleanup_maven_repository
# always:
# stop_recording_script: |
# pkill -SIGINT -f ffmpeg
# while pgrep ffmpeg >/dev/null; do sleep 1; done
# /etc/init.d/xvfb stop
# test_recording_artifacts:
# path: "${CIRRUS_WORKING_DIR}/recording_${QA_CATEGORY}.mp4"
# jacoco_it_sq_artifacts:
# path: "${CIRRUS_WORKING_DIR}/it-coverage*.exec"
# mvn_startTestLog_artifacts:
# path: "${CIRRUS_WORKING_DIR}/its/**/target/work/configuration/*.log"
# mvn_runTestLog_artifacts:
# path: "${CIRRUS_WORKING_DIR}/its/**/target/work/data/.metadata/.log"
# on_failure:
# xvfb_log_artifacts:
# path: "${CIRRUS_WORKING_DIR}/Xvfb.out"
# reports_artifacts:
# path: "**/reports/**/*"
# junit_artifacts:
# paths:
# - "**/test-results/**/*.xml"
# - "**/target/surefire-reports/TEST-*.xml"
# format: junit
# slack_notification_script: |
# source slack-failure-notification "Cirrus CI build failure on pipeline: $CIRRUS_PIPELINE_NAME"

qa_connectedModeSonarCloud_task:
# name: "Run ITs for Connected Mode with SonarCloud"
Expand Down
61 changes: 61 additions & 0 deletions .cirrus/set_maven_build_version_github_action
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
# Tycho implementation instead of https://github.com/SonarSource/ci-github-actions/blob/master/config-maven/set_maven_project_version.sh
#
# Required environment variables (must be explicitly provided):
# - BUILD_NUMBER: Build number for versioning
#
# GitHub Actions auto-provided:
# - GITHUB_OUTPUT: Path to GitHub Actions output file
# - GITHUB_ENV: Path to GitHub Actions environment file

set -euo pipefail

: "${BUILD_NUMBER:?}"
: "${GITHUB_OUTPUT:?}" "${GITHUB_ENV:?}"

get_current_version() {
if ! mvn -q -N -Dtycho.mode=maven help:evaluate -Dexpression="project.version" -DforceStdout 2>/dev/null; then
echo "Failed to read project.version" >&2
mvn -X -N -Dtycho.mode=maven help:evaluate -Dexpression="project.version" -DforceStdout
return 1
fi
}

set_project_version() {
local current_version
if ! current_version=$(get_current_version 2>&1); then
echo -e "::error file=pom.xml,title=Maven project version::Could not get 'project.version' from Maven project\nERROR: $current_version"
return 1
fi

# Saving the snapshot version to the output and environment variables
# This is used by the sonar-scanner to set the value of sonar.projectVersion without the build number
echo "current-version=$current_version" >> "$GITHUB_OUTPUT"
echo "CURRENT_VERSION=$current_version" >> "$GITHUB_ENV"
echo "CURRENT_VERSION=${current_version} (from pom.xml)"
export CURRENT_VERSION="$current_version"

local release_version="${current_version%"-SNAPSHOT"}"
local dots="${release_version//[^.]/}"
local dots_count="${#dots}"

if [[ "$dots_count" -eq 0 ]]; then
release_version="${release_version}.0.0"
elif [[ "$dots_count" -eq 1 ]]; then
release_version="${release_version}.0"
elif [[ "$dots_count" -ne 2 ]]; then
echo "::error file=pom.xml,title=Maven project version::Unsupported version '$current_version' with $((dots_count + 1)) digits."
return 1
fi
release_version="${release_version}.${BUILD_NUMBER}"
echo "Replacing version ${current_version} with ${release_version}"
mvn -V org.eclipse.tycho:tycho-versions-plugin:3.0.5:set-version -Dtycho.mode=maven -DnewVersion=$release_version -DgenerateBackupPoms=false --batch-mode --no-transfer-progress --errors
echo "project-version=$release_version" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=$release_version" >> "$GITHUB_ENV"
echo "PROJECT_VERSION=${release_version}"
export PROJECT_VERSION="$release_version"
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
set_project_version
fi
Loading
Loading