From c77e4b99514e9110a590f58db427d1f7478e205b Mon Sep 17 00:00:00 2001 From: "Philipp.Stahlberg" <131917964+PhilippStahlbergGit@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:44:03 +0200 Subject: [PATCH 1/7] chore(ci): add sonarqube to ci --- .github/workflows/ci-cd.yaml | 27 ++++++++++++++++++++++----- sonar-project.properties | 8 ++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index f98b8ae..ef8bc18 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -10,11 +10,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: install uv uses: astral-sh/setup-uv@v3 with: version: "0.11.14" + - run: uv lock --locked + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: @@ -31,23 +36,35 @@ jobs: - name: initialize the file first using configlock run: configlock init project_info.yaml + - name: check locked file run: configlock lock project_info.yaml - name: linting run: uvx ruff check . + - name: formatting run: uvx ruff format --check . + - name: type_consitency run: uv run pyright . + - name: complexity check - run: uvx radon cc -s -a . - - name: tests - run: uv run pytest -v --durations=0 --cov --cov-report=xml + run: uvx radon cc -s -a . + + - name: tests with coverage + run: uv run pytest -v --durations=0 --cov=src/configlock --cov-report=xml:coverage.xml + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - + files: coverage.xml + + - name: SonarQube Cloud scan + uses: SonarSource/sonarqube-scan-action@v8.2.0 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: build - run: uv build + run: uv build \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..75fa085 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,8 @@ +# sonar-project.properties +sonar.organization=YOUR_SONAR_ORG_KEY +sonar.projectKey=YOUR_PROJECT_KEY + +sonar.sources=src/configlock +sonar.tests=tests +sonar.python.coverage.reportPaths=coverage.xml +sonar.sourceEncoding=UTF-8 \ No newline at end of file From 74126992f7114dd43408d2aef600f0fdbafba542 Mon Sep 17 00:00:00 2001 From: "Philipp.Stahlberg" <131917964+PhilippStahlbergGit@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:49:15 +0200 Subject: [PATCH 2/7] fix: fix properties for sonarcube --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 75fa085..d39ee00 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ # sonar-project.properties -sonar.organization=YOUR_SONAR_ORG_KEY -sonar.projectKey=YOUR_PROJECT_KEY +sonar.organization=phalberg_configlock +sonar.projectKey=phalberg sonar.sources=src/configlock sonar.tests=tests From 2607d1d42f370c35e2e0d8ac2ff311aaf56878d6 Mon Sep 17 00:00:00 2001 From: "Philipp.Stahlberg" <131917964+PhilippStahlbergGit@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:52:36 +0200 Subject: [PATCH 3/7] fix: file to be discovered by codecov --- .github/workflows/ci-cd.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index ef8bc18..c814a34 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -53,8 +53,10 @@ jobs: run: uvx radon cc -s -a . - name: tests with coverage - run: uv run pytest -v --durations=0 --cov=src/configlock --cov-report=xml:coverage.xml - + run: | + uv run pytest -v --durations=0 --cov=configlock --cov-report=term-missing --cov-report=xml:coverage.xml + ls -lah coverage.xml + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: From f35d21159d0538cda445f39571a3cdc165460bd2 Mon Sep 17 00:00:00 2001 From: "Philipp.Stahlberg" <131917964+PhilippStahlbergGit@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:57:24 +0200 Subject: [PATCH 4/7] fix(ci): adjust path for coverage --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index c814a34..a9c885c 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -54,7 +54,7 @@ jobs: - name: tests with coverage run: | - uv run pytest -v --durations=0 --cov=configlock --cov-report=term-missing --cov-report=xml:coverage.xml + uv run pytest -v --durations=0 --cov=src/configlock --cov-report=term-missing --cov-report=xml:coverage.xml ls -lah coverage.xml - name: Upload coverage reports to Codecov From ce38b818057d2eabd8be60960648619bdad27752 Mon Sep 17 00:00:00 2001 From: "Philipp.Stahlberg" <131917964+PhilippStahlbergGit@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:00:55 +0200 Subject: [PATCH 5/7] fix(ci): try fixing the coverage file --- .github/workflows/ci-cd.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index a9c885c..ccc55fd 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -53,15 +53,12 @@ jobs: run: uvx radon cc -s -a . - name: tests with coverage - run: | - uv run pytest -v --durations=0 --cov=src/configlock --cov-report=term-missing --cov-report=xml:coverage.xml - ls -lah coverage.xml + run: uv run pytest -v --durations=0 --cov --cov-report=xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: coverage.xml - name: SonarQube Cloud scan uses: SonarSource/sonarqube-scan-action@v8.2.0 From 0cd26211f45ad04fcdb8373b6cd877a40867c298 Mon Sep 17 00:00:00 2001 From: "Philipp.Stahlberg" <131917964+PhilippStahlbergGit@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:03:18 +0200 Subject: [PATCH 6/7] fix(ci): change to correct dir --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index d39ee00..a438dcb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.organization=phalberg_configlock sonar.projectKey=phalberg -sonar.sources=src/configlock +sonar.sources=src/cfglock sonar.tests=tests sonar.python.coverage.reportPaths=coverage.xml sonar.sourceEncoding=UTF-8 \ No newline at end of file From 9f59dbe2ad2fa1e88914b0b311518916501fcc70 Mon Sep 17 00:00:00 2001 From: "Philipp.Stahlberg" <131917964+PhilippStahlbergGit@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:05:24 +0200 Subject: [PATCH 7/7] fix(ci): change namings in projectkey --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index a438dcb..77656a0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ # sonar-project.properties -sonar.organization=phalberg_configlock -sonar.projectKey=phalberg +sonar.projectKey=phalberg_configlock +sonar.organization=phalberg sonar.sources=src/cfglock sonar.tests=tests