Skip to content

fix: avoid OptionSet.getOptions() N+1 in analytics metadata resolution [DHIS2-21975] #61526

fix: avoid OptionSet.getOptions() N+1 in analytics metadata resolution [DHIS2-21975]

fix: avoid OptionSet.getOptions() N+1 in analytics metadata resolution [DHIS2-21975] #61526

Workflow file for this run

name: SonarQube analysis
env:
# This is to make sure Maven don't timeout fetching dependencies. See: https://github.com/actions/virtual-environments/issues/1499
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125
# PR → quiet (unless ci-verbose label), push/schedule → info, workflow_dispatch → user choice
MAVEN_ARGS: ${{ (inputs.maven_log == 'debug' && '-X') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-verbose') && '-q') || (inputs.maven_log == 'quiet' && '-q') || '' }}
# Controls log4j2 suppression of expected test errors. ci-verbose label sets to error to show them.
TEST_LOG_SUPPRESSED_LEVEL: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci-verbose') && 'error') || (inputs.maven_log == 'debug' && 'error') || 'off' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.DHIS2_BOT_SONARCLOUD_TOKEN }}
on:
push:
branches:
- "2.3[1-9]"
- "2.4[0-9]"
pull_request:
branches:
- master
- "2.3[1-9]"
- "2.4[0-9]"
workflow_dispatch:
inputs:
maven_log:
description: "Maven log verbosity"
required: false
default: "quiet"
type: choice
options:
- quiet
- info
- debug
concurrency:
group: ${{ github.workflow}}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
sonarqube:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
cache: maven
- name: Check Sonar token
run: |
if [ -z "${{ secrets.DHIS2_BOT_SONARCLOUD_TOKEN }}" ]; then
echo "SONAR_TOKEN is not set"
exit 1
fi
- name: Analyse PR
env:
BASE_BRANCH: ${{ github.base_ref }}
BRANCH: ${{ github.ref }}
PR: ${{ github.event.number }}
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event_name == 'pull_request'
run: |
mvn -f dhis-2/pom.xml clean install --threads 2C --batch-mode --update-snapshots --no-transfer-progress -DskipTests
mvn -f dhis-2/pom.xml sonar:sonar -Dsonar.internal.analysis.dbd=false --batch-mode --no-transfer-progress -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} -Dsonar.projectKey=dhis2_dhis2-core
- name: Analyse long-living branch
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
mvn -f dhis-2/pom.xml clean install --threads 2C --batch-mode --update-snapshots --no-transfer-progress -DskipTests
mvn -f dhis-2/pom.xml sonar:sonar -Dsonar.internal.analysis.dbd=false --batch-mode --no-transfer-progress -Dsonar.branch.name=${GITHUB_REF#refs/heads/} -Dsonar.projectKey=dhis2_dhis2-core