From f3c0dc78dfe1cf9d5bc8bdc25e86737cd20b347f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 13:28:59 +0000 Subject: [PATCH 1/4] Initial plan From 6661a08b5e760df49946abdd42f487cf38a01b46 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 13:31:00 +0000 Subject: [PATCH 2/4] Fix JaCoCo workflow: update action version and add fork/dependabot support Co-authored-by: wajda <795479+wajda@users.noreply.github.com> --- .github/workflows/ci-check-jacoco.yml | 38 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-check-jacoco.yml b/.github/workflows/ci-check-jacoco.yml index 31463ec88..d8d81d271 100644 --- a/.github/workflows/ci-check-jacoco.yml +++ b/.github/workflows/ci-check-jacoco.yml @@ -8,6 +8,9 @@ on: jobs: test: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - name: Checkout code uses: actions/checkout@v4 @@ -19,7 +22,9 @@ jobs: run: mvn verify -Dcode-coverage - name: Add coverage to PR id: jacoco - uses: madrapps/jacoco-report@v1.3 + # Only comment on PR if we have write permissions (not from fork or dependabot) + if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' + uses: madrapps/jacoco-report@v1.7.2 with: paths: > ${{ github.workspace }}/admin/target/site/jacoco/jacoco.xml, @@ -40,12 +45,37 @@ jobs: min-coverage-changed-files: 80.0 title: JaCoCo code coverage report update-comment: true + - name: Add coverage to workflow summary (for forks/dependabot) + id: jacoco-summary + # Only run this step if we couldn't comment on PR (fork or dependabot) + if: github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' + uses: madrapps/jacoco-report@v1.7.2 + with: + paths: > + ${{ github.workspace }}/admin/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/arangodb-foxx-api/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/commons/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/consumer-rest-core/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/consumer-services/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/kafka-gateway/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/persistence/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-model/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-model-mapper/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-rest-core/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-services/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/rest-gateway/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/test-data-generator/target/site/jacoco/jacoco.xml + token: ${{ secrets.GITHUB_TOKEN }} + min-coverage-overall: 0.0 + min-coverage-changed-files: 80.0 + title: JaCoCo code coverage report + comment-type: summary - name: Get the Coverage info run: | - echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}" - echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}" + echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall || steps.jacoco-summary.outputs.coverage-overall }}" + echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files || steps.jacoco-summary.outputs.coverage-changed-files }}" - name: Fail PR if changed files coverage is less than 80% - if: ${{ steps.jacoco.outputs.coverage-changed-files < 80.0 }} + if: ${{ (steps.jacoco.outputs.coverage-changed-files || steps.jacoco-summary.outputs.coverage-changed-files) < 80.0 }} uses: actions/github-script@v6 with: script: | From dbd3dba624e9aa09e6e6a7483da7ec222eed1650 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 13:32:43 +0000 Subject: [PATCH 3/4] Address code review feedback: improve conditions and add documentation Co-authored-by: wajda <795479+wajda@users.noreply.github.com> --- .github/workflows/ci-check-jacoco.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-check-jacoco.yml b/.github/workflows/ci-check-jacoco.yml index d8d81d271..7f333b1b3 100644 --- a/.github/workflows/ci-check-jacoco.yml +++ b/.github/workflows/ci-check-jacoco.yml @@ -48,6 +48,7 @@ jobs: - name: Add coverage to workflow summary (for forks/dependabot) id: jacoco-summary # Only run this step if we couldn't comment on PR (fork or dependabot) + # This writes the report to workflow summary instead of PR comments if: github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' uses: madrapps/jacoco-report@v1.7.2 with: @@ -69,13 +70,21 @@ jobs: min-coverage-overall: 0.0 min-coverage-changed-files: 80.0 title: JaCoCo code coverage report + # Use workflow summary for PRs without write permissions comment-type: summary - name: Get the Coverage info run: | - echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall || steps.jacoco-summary.outputs.coverage-overall }}" - echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files || steps.jacoco-summary.outputs.coverage-changed-files }}" + if [ -n "${{ steps.jacoco.outputs.coverage-overall }}" ]; then + echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}" + echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}" + else + echo "Total coverage ${{ steps.jacoco-summary.outputs.coverage-overall }}" + echo "Changed Files coverage ${{ steps.jacoco-summary.outputs.coverage-changed-files }}" + fi - name: Fail PR if changed files coverage is less than 80% - if: ${{ (steps.jacoco.outputs.coverage-changed-files || steps.jacoco-summary.outputs.coverage-changed-files) < 80.0 }} + if: | + (steps.jacoco.conclusion == 'success' && steps.jacoco.outputs.coverage-changed-files < 80.0) || + (steps.jacoco-summary.conclusion == 'success' && steps.jacoco-summary.outputs.coverage-changed-files < 80.0) uses: actions/github-script@v6 with: script: | From 28189385b69e99cf80504538016444a998ffb0e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 13:33:54 +0000 Subject: [PATCH 4/4] Refactor: extract paths to env var and use step conclusion checks Co-authored-by: wajda <795479+wajda@users.noreply.github.com> --- .github/workflows/ci-check-jacoco.yml | 49 +++++++++++---------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci-check-jacoco.yml b/.github/workflows/ci-check-jacoco.yml index 7f333b1b3..326e467ce 100644 --- a/.github/workflows/ci-check-jacoco.yml +++ b/.github/workflows/ci-check-jacoco.yml @@ -11,6 +11,21 @@ jobs: permissions: contents: read pull-requests: write + env: + JACOCO_PATHS: > + ${{ github.workspace }}/admin/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/arangodb-foxx-api/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/commons/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/consumer-rest-core/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/consumer-services/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/kafka-gateway/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/persistence/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-model/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-model-mapper/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-rest-core/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/producer-services/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/rest-gateway/target/site/jacoco/jacoco.xml, + ${{ github.workspace }}/test-data-generator/target/site/jacoco/jacoco.xml steps: - name: Checkout code uses: actions/checkout@v4 @@ -26,20 +41,7 @@ jobs: if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' uses: madrapps/jacoco-report@v1.7.2 with: - paths: > - ${{ github.workspace }}/admin/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/arangodb-foxx-api/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/commons/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/consumer-rest-core/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/consumer-services/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/kafka-gateway/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/persistence/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-model/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-model-mapper/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-rest-core/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-services/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/rest-gateway/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/test-data-generator/target/site/jacoco/jacoco.xml + paths: ${{ env.JACOCO_PATHS }} token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 0.0 min-coverage-changed-files: 80.0 @@ -52,20 +54,7 @@ jobs: if: github.event.pull_request.head.repo.full_name != github.repository || github.actor == 'dependabot[bot]' uses: madrapps/jacoco-report@v1.7.2 with: - paths: > - ${{ github.workspace }}/admin/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/arangodb-foxx-api/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/commons/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/consumer-rest-core/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/consumer-services/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/kafka-gateway/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/persistence/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-model/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-model-mapper/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-rest-core/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/producer-services/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/rest-gateway/target/site/jacoco/jacoco.xml, - ${{ github.workspace }}/test-data-generator/target/site/jacoco/jacoco.xml + paths: ${{ env.JACOCO_PATHS }} token: ${{ secrets.GITHUB_TOKEN }} min-coverage-overall: 0.0 min-coverage-changed-files: 80.0 @@ -74,10 +63,10 @@ jobs: comment-type: summary - name: Get the Coverage info run: | - if [ -n "${{ steps.jacoco.outputs.coverage-overall }}" ]; then + if [ "${{ steps.jacoco.conclusion }}" == "success" ]; then echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}" echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}" - else + elif [ "${{ steps.jacoco-summary.conclusion }}" == "success" ]; then echo "Total coverage ${{ steps.jacoco-summary.outputs.coverage-overall }}" echo "Changed Files coverage ${{ steps.jacoco-summary.outputs.coverage-changed-files }}" fi