From 4bedb9291f14d6474bff6183cb62a93e792d0548 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 7 Aug 2025 16:34:43 +0200 Subject: [PATCH 01/67] Enhance code quality pipeline with coverage reporting and job execution improvements --- .github/workflows/fe-code-quality.yml | 11 ++++++++++- tools/scripts/run-many/run-many.ts | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 250c138b..0227cfa1 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -9,6 +9,7 @@ jobs: matrix: target: [ 'test' ] jobIndex: [ 1, 2, 3,4 ] + fail-fast: false # Ensure all jobs run even if one fails env: jobCount: 4 steps: @@ -37,10 +38,18 @@ jobs: run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} || true - name: Unit Tests - uses: collaborationFactory/github-actions/.github/actions/run-many@master + uses: collaborationFactory/github-actions/.github/actions/run-many@poc/code-coverage-in-code-quality-pr-pipeline with: target: ${{ matrix.target }} jobIndex: ${{ matrix.jobIndex }} jobCount: ${{ env.jobCount }} base: ${{ github.event.pull_request.base.ref }} ref: ${{ github.event.pull_request.head.ref }} + + - name: Upload Coverage Reports + uses: actions/upload-artifact@v4 + with: + name: coverage-reports + path: | + coverage/ + retention-days: 7 diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index c8a9cc34..a1f8108d 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -64,6 +64,14 @@ function main() { cmd = getE2ECommand(cmd, base); } + // Add coverage flag if enabled and target is test + if (target.includes('test')) { + core.info('Coverage gate is enabled'); + // Add coverage reporters for HTML, JSON, and JUnit output + // Note: Using individual project coverage directories + cmd += ' --coverage --coverageReporters=json,lcov,text,clover,html,json-summary --reporters=default,jest-junit'; + } + if (projects.length > 0) { runCommand(cmd); } else { From 43e640fe99a5af138cfe3e045c5bb206fbf2c52b Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 7 Aug 2025 20:42:01 +0200 Subject: [PATCH 02/67] Add coverage report merging and SonarCloud integration to CI pipeline --- .github/workflows/fe-code-quality.yml | 23 +++ package-lock.json | 253 ++++++++++++++++++++++++-- package.json | 1 + tools/scripts/run-many/run-many.ts | 2 +- 4 files changed, 267 insertions(+), 12 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 0227cfa1..f91d2796 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -46,6 +46,9 @@ jobs: base: ${{ github.event.pull_request.base.ref }} ref: ${{ github.event.pull_request.head.ref }} + - name: Merge Coverage Reports + run: ./node_modules/.bin/lcov-result-merger 'coverage/libs/**/lcov.info' 'coverage/lcov.info' + - name: Upload Coverage Reports uses: actions/upload-artifact@v4 with: @@ -53,3 +56,23 @@ jobs: path: | coverage/ retention-days: 7 + + sonar: + name: SonarCloud + needs: code-quality + runs-on: ubuntu-latest + steps: + - name: download source + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: download coverage report + uses: actions/download-artifact@v3 + with: + name: coverage-report + path: coverage + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/package-lock.json b/package-lock.json index b963d2a5..53558eb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "@types/jest": "29.5.14", "@types/node": "^22.15.0", "jest": "29.7.0", + "lcov-result-merger": "^5.0.1", "luxon": "^3.3.0", "prettier": "2.8.1", "ts-jest": "29.1.1", @@ -2415,6 +2416,44 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -2948,12 +2987,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -3451,12 +3491,39 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -3467,10 +3534,11 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3580,6 +3648,19 @@ "node": "*" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -3710,6 +3791,16 @@ "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/is-electron/-/is-electron-2.2.2.tgz", "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==" }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -3728,11 +3819,25 @@ "node": ">=6" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -5381,6 +5486,64 @@ "node": ">=6" } }, + "node_modules/lcov-result-merger": { + "version": "5.0.1", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/lcov-result-merger/-/lcov-result-merger-5.0.1.tgz", + "integrity": "sha512-i53RjTYfqbHgerqGtuJjDfARDU340zNxXrJudQZU3o8ak9rrx8FDQUKf38Cjm6MtbqonqiDFmoKuUe++uZbvOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.2.11", + "yargs": "^16.2.0" + }, + "bin": { + "lcov-result-merger": "bin/lcov-result-merger.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/lcov-result-merger/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/lcov-result-merger/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lcov-result-merger/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/leven/-/leven-3.1.0.tgz", @@ -5489,13 +5652,24 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -5871,6 +6045,27 @@ "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", "dev": true }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/react-is/-/react-is-18.2.0.tgz", @@ -6015,6 +6210,41 @@ "node": ">= 4" } }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -6233,6 +6463,7 @@ "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, diff --git a/package.json b/package.json index a1185037..989201c6 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@types/jest": "29.5.14", "@types/node": "^22.15.0", "jest": "29.7.0", + "lcov-result-merger": "^5.0.1", "luxon": "^3.3.0", "prettier": "2.8.1", "ts-jest": "29.1.1", diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index a1f8108d..bd27cec2 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -65,7 +65,7 @@ function main() { } // Add coverage flag if enabled and target is test - if (target.includes('test')) { + if (target === 'test') { core.info('Coverage gate is enabled'); // Add coverage reporters for HTML, JSON, and JUnit output // Note: Using individual project coverage directories From 88390a536111485de2c3c1e1c0b0a9823f79080b Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 7 Aug 2025 20:47:37 +0200 Subject: [PATCH 03/67] Refine coverage reporting in CI by updating reporters to lcov and html --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index bd27cec2..7e5b3471 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -69,7 +69,7 @@ function main() { core.info('Coverage gate is enabled'); // Add coverage reporters for HTML, JSON, and JUnit output // Note: Using individual project coverage directories - cmd += ' --coverage --coverageReporters=json,lcov,text,clover,html,json-summary --reporters=default,jest-junit'; + cmd += ' --coverage --coverageReporters=lcov,html'; } if (projects.length > 0) { From c07d5d24c1ad0d458c7d895d31ca9a657185dec9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 7 Aug 2025 21:13:12 +0200 Subject: [PATCH 04/67] Update coverage report merging command to use npx for improved execution --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index f91d2796..fb303269 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -47,7 +47,7 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} - name: Merge Coverage Reports - run: ./node_modules/.bin/lcov-result-merger 'coverage/libs/**/lcov.info' 'coverage/lcov.info' + run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'coverage/lcov.info' - name: Upload Coverage Reports uses: actions/upload-artifact@v4 From 8d74b274d836324bb6c1795223ef9385e667000f Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 7 Aug 2025 21:31:56 +0200 Subject: [PATCH 05/67] Update coverage report artifact naming for better differentiation in CI --- .github/workflows/fe-code-quality.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index fb303269..0a69bb68 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -52,7 +52,7 @@ jobs: - name: Upload Coverage Reports uses: actions/upload-artifact@v4 with: - name: coverage-reports + name: coverage-reports-${{ matrix.jobIndex }} path: | coverage/ retention-days: 7 @@ -69,8 +69,7 @@ jobs: - name: download coverage report uses: actions/download-artifact@v3 with: - name: coverage-report - path: coverage + name: coverage-reports-1 - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From fd2419e90dc8e7956747a801f68cdb18fa2acad9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 04:38:01 +0200 Subject: [PATCH 06/67] Update coverage report download and merging process in CI pipeline --- .github/workflows/fe-code-quality.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 0a69bb68..5c956f0a 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -67,9 +67,13 @@ jobs: with: fetch-depth: 0 - name: download coverage report - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v5 with: - name: coverage-reports-1 + path: coverage/matrix/ + pattern: coverage-reports-* + merge-multiple: true + - name: Merge matrix coverage reports + run: npx lcov-result-merger 'coverage/matrix/**/lcov.info' 'coverage/lcov.info' - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From a33192d190f0b3a44eba22f45b4707ee45fa5e02 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 04:39:39 +0200 Subject: [PATCH 07/67] Update GitHub Actions checkout action to version 4 --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 5c956f0a..e1824c6b 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest steps: - name: download source - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: download coverage report From 01b758f26cc31685c80bbb61d6aa9d2899337a52 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 05:03:02 +0200 Subject: [PATCH 08/67] Update Node.js setup action to version 4 and enhance caching in CI pipeline --- .github/workflows/fe-code-quality.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index e1824c6b..16ec282b 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -18,7 +18,7 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 22.15.0 - name: Cache Node Modules @@ -66,6 +66,15 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 22.15.0 + - name: Cache Node Modules + id: npm-cache + uses: actions/cache@v4 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} - name: download coverage report uses: actions/download-artifact@v5 with: From a13cfce0ee49a06bdacd200d615251908fc9cef7 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 05:50:39 +0200 Subject: [PATCH 09/67] Add checkout step and install dependencies in CI pipeline --- .github/workflows/fe-code-quality.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 16ec282b..674782ac 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -62,7 +62,7 @@ jobs: needs: code-quality runs-on: ubuntu-latest steps: - - name: download source + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 @@ -75,6 +75,8 @@ jobs: with: path: '**/node_modules' key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} + - name: Install Dependencies + run: npm ci - name: download coverage report uses: actions/download-artifact@v5 with: From 85446edc23a6f4919abf135e2ca229819a32ea68 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 06:35:18 +0200 Subject: [PATCH 10/67] Remove Node.js setup and caching steps from CI pipeline --- .github/workflows/fe-code-quality.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 674782ac..358cdb35 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -66,17 +66,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: 22.15.0 - - name: Cache Node Modules - id: npm-cache - uses: actions/cache@v4 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} - - name: Install Dependencies - run: npm ci - name: download coverage report uses: actions/download-artifact@v5 with: From 02b90c4b255641c0310d75944af9f4e30c6b8e14 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 06:36:18 +0200 Subject: [PATCH 11/67] Install lcov-result-merger in CI pipeline for coverage report merging --- .github/workflows/fe-code-quality.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 358cdb35..689f609a 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -72,6 +72,8 @@ jobs: path: coverage/matrix/ pattern: coverage-reports-* merge-multiple: true + - name: Install lcov-result-merger + run: npm install -g lcov-result-merger - name: Merge matrix coverage reports run: npx lcov-result-merger 'coverage/matrix/**/lcov.info' 'coverage/lcov.info' - name: SonarCloud Scan From 589d69b8529664a34ef18e1d1189525327e04d63 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 07:01:53 +0200 Subject: [PATCH 12/67] Add step to display structure of downloaded coverage files in CI pipeline --- .github/workflows/fe-code-quality.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 689f609a..ef1c2f31 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -72,6 +72,8 @@ jobs: path: coverage/matrix/ pattern: coverage-reports-* merge-multiple: true + - name: Display structure of downloaded files + run: ls -R coverage/matrix/ - name: Install lcov-result-merger run: npm install -g lcov-result-merger - name: Merge matrix coverage reports From 093920b4361f47a2ab4f5057a189b4ac2f69b59b Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 07:48:14 +0200 Subject: [PATCH 13/67] Refactor coverage report paths in CI pipeline for clarity and organization --- .github/workflows/fe-code-quality.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index ef1c2f31..ca52df4d 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -47,14 +47,14 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} - name: Merge Coverage Reports - run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'coverage/lcov.info' + run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov.info' - name: Upload Coverage Reports uses: actions/upload-artifact@v4 with: name: coverage-reports-${{ matrix.jobIndex }} path: | - coverage/ + merger-coverage/ retention-days: 7 sonar: @@ -69,15 +69,15 @@ jobs: - name: download coverage report uses: actions/download-artifact@v5 with: - path: coverage/matrix/ + path: merger-coverage/ pattern: coverage-reports-* merge-multiple: true - name: Display structure of downloaded files - run: ls -R coverage/matrix/ + run: ls -R merger-coverage/ - name: Install lcov-result-merger run: npm install -g lcov-result-merger - name: Merge matrix coverage reports - run: npx lcov-result-merger 'coverage/matrix/**/lcov.info' 'coverage/lcov.info' + run: npx lcov-result-merger 'merger-coverage/**/lcov.info' 'coverage/overall/lcov.info' - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From e8dd3f65fac1e812ab85d6c5cb700c0e4c21e17a Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 08:15:57 +0200 Subject: [PATCH 14/67] Install lcov-result-merger in CI pipeline for coverage report merging --- .github/workflows/fe-code-quality.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index ca52df4d..f9673005 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -46,6 +46,9 @@ jobs: base: ${{ github.event.pull_request.base.ref }} ref: ${{ github.event.pull_request.head.ref }} + - name: Install lcov-result-merger + run: npm install -g lcov-result-merger + - name: Merge Coverage Reports run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov.info' From 20e561550c0dbcc8239ee140e28982338fd30366 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 08:38:57 +0200 Subject: [PATCH 15/67] Install lcov-result-merger in CI pipeline for coverage report merging --- .github/workflows/fe-code-quality.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index f9673005..b90f113a 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -46,6 +46,9 @@ jobs: base: ${{ github.event.pull_request.base.ref }} ref: ${{ github.event.pull_request.head.ref }} + - name: Display structure of downloaded files + run: ls -R coverage/ + - name: Install lcov-result-merger run: npm install -g lcov-result-merger From d8cc53a44c89d080463a7d0b99066a4f8f83c331 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 11:41:22 +0200 Subject: [PATCH 16/67] Add jest-junit and update lcov-result-merger installation in CI pipeline --- .github/workflows/fe-code-quality.yml | 12 ++++----- package-lock.json | 37 +++++++++++++++++++++++++++ package.json | 1 + tools/scripts/run-many/run-many.ts | 2 +- 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index b90f113a..b132f091 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -37,6 +37,9 @@ jobs: - name: Fetch base branch run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} || true + - name: Install lcov-result-merger and jest-junit + run: npm install -g lcov-result-merger@5.0.1, jest-junit@16.0.0 + - name: Unit Tests uses: collaborationFactory/github-actions/.github/actions/run-many@poc/code-coverage-in-code-quality-pr-pipeline with: @@ -47,10 +50,7 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} - name: Display structure of downloaded files - run: ls -R coverage/ - - - name: Install lcov-result-merger - run: npm install -g lcov-result-merger + run: find coverage/ -name "*.info" - name: Merge Coverage Reports run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov.info' @@ -79,9 +79,9 @@ jobs: pattern: coverage-reports-* merge-multiple: true - name: Display structure of downloaded files - run: ls -R merger-coverage/ + run: find merger-coverage/ -name "*.info" - name: Install lcov-result-merger - run: npm install -g lcov-result-merger + run: npm install -g lcov-result-merger@5.0.1 - name: Merge matrix coverage reports run: npx lcov-result-merger 'merger-coverage/**/lcov.info' 'coverage/overall/lcov.info' - name: SonarCloud Scan diff --git a/package-lock.json b/package-lock.json index 53558eb1..45ed1992 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "@types/jest": "29.5.14", "@types/node": "^22.15.0", "jest": "29.7.0", + "jest-junit": "^16.0.0", "lcov-result-merger": "^5.0.1", "luxon": "^3.3.0", "prettier": "2.8.1", @@ -4522,6 +4523,22 @@ "fsevents": "^2.3.2" } }, + "node_modules/jest-junit": { + "version": "16.0.0", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -5716,6 +5733,19 @@ "node": "*" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -6755,6 +6785,13 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true, + "license": "MIT" + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 989201c6..d58c8e29 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@types/jest": "29.5.14", "@types/node": "^22.15.0", "jest": "29.7.0", + "jest-junit": "^16.0.0", "lcov-result-merger": "^5.0.1", "luxon": "^3.3.0", "prettier": "2.8.1", diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 7e5b3471..f4310031 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -69,7 +69,7 @@ function main() { core.info('Coverage gate is enabled'); // Add coverage reporters for HTML, JSON, and JUnit output // Note: Using individual project coverage directories - cmd += ' --coverage --coverageReporters=lcov,html'; + cmd += ' --coverage --coverageReporters=lcov,html --reporters=default,jest-junit'; } if (projects.length > 0) { From eaa6ad47592342fb1ec2002109f468735da3e9bb Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 12:19:46 +0200 Subject: [PATCH 17/67] Fix installation command for lcov-result-merger and jest-junit in CI pipeline --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index b132f091..db7b986c 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -38,7 +38,7 @@ jobs: run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} || true - name: Install lcov-result-merger and jest-junit - run: npm install -g lcov-result-merger@5.0.1, jest-junit@16.0.0 + run: npm install -g lcov-result-merger@5.0.1 jest-junit@16.0.0 - name: Unit Tests uses: collaborationFactory/github-actions/.github/actions/run-many@poc/code-coverage-in-code-quality-pr-pipeline From 22cd8d32dd4d111beb1e727721d74ec5ed1d436b Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 12:50:18 +0200 Subject: [PATCH 18/67] Separate installation of lcov-result-merger and jest-junit in CI pipeline --- .github/workflows/fe-code-quality.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index db7b986c..835c1d3e 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -37,8 +37,11 @@ jobs: - name: Fetch base branch run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} || true - - name: Install lcov-result-merger and jest-junit - run: npm install -g lcov-result-merger@5.0.1 jest-junit@16.0.0 + - name: Install lcov-result-merger + run: npm install -g lcov-result-merger + + - name: Install jest-junit + run: npm install -g jest-junit - name: Unit Tests uses: collaborationFactory/github-actions/.github/actions/run-many@poc/code-coverage-in-code-quality-pr-pipeline From 733fc65df3883f38aba65924f9b5e3d97157358e Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 13:05:26 +0200 Subject: [PATCH 19/67] Update coverage command to use new reporter format in CI pipeline --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index f4310031..d91228b4 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -69,7 +69,7 @@ function main() { core.info('Coverage gate is enabled'); // Add coverage reporters for HTML, JSON, and JUnit output // Note: Using individual project coverage directories - cmd += ' --coverage --coverageReporters=lcov,html --reporters=default,jest-junit'; + cmd += ' --code-coverage --coverageReporters="lcov,html" --reporters="default" --reporters=["jest-junit", "--outputDirectory=./reports/junit", "--outputName=junit.xml"]'; } if (projects.length > 0) { From 457f224d1b4616683ea0c527cbab351381052c84 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 13:28:06 +0200 Subject: [PATCH 20/67] Refactor coverage command to include jest-junit reporter in CI pipeline --- tools/scripts/run-many/run-many.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index d91228b4..ecdb9039 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -66,10 +66,9 @@ function main() { // Add coverage flag if enabled and target is test if (target === 'test') { - core.info('Coverage gate is enabled'); - // Add coverage reporters for HTML, JSON, and JUnit output + // Add coverage reporters for HTML, lcov and JUnit output // Note: Using individual project coverage directories - cmd += ' --code-coverage --coverageReporters="lcov,html" --reporters="default" --reporters=["jest-junit", "--outputDirectory=./reports/junit", "--outputName=junit.xml"]'; + cmd += ' --code-coverage --coverageReporters="lcov,html" --reporters="default,jest-junit"'; } if (projects.length > 0) { From c3a29e4e97f80822f6ecab1c103a15d58e68be7d Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 13:59:52 +0200 Subject: [PATCH 21/67] Remove redundant installation steps for lcov-result-merger and jest-junit in CI pipeline --- .github/workflows/fe-code-quality.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 835c1d3e..a17fe7bd 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -37,12 +37,6 @@ jobs: - name: Fetch base branch run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} || true - - name: Install lcov-result-merger - run: npm install -g lcov-result-merger - - - name: Install jest-junit - run: npm install -g jest-junit - - name: Unit Tests uses: collaborationFactory/github-actions/.github/actions/run-many@poc/code-coverage-in-code-quality-pr-pipeline with: @@ -83,8 +77,6 @@ jobs: merge-multiple: true - name: Display structure of downloaded files run: find merger-coverage/ -name "*.info" - - name: Install lcov-result-merger - run: npm install -g lcov-result-merger@5.0.1 - name: Merge matrix coverage reports run: npx lcov-result-merger 'merger-coverage/**/lcov.info' 'coverage/overall/lcov.info' - name: SonarCloud Scan From 80de71d7031a9b99671ebfe04bf151e912b0e7e8 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 8 Aug 2025 14:51:15 +0200 Subject: [PATCH 22/67] Remove jest-junit reporter from coverage command in CI pipeline --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index ecdb9039..4f8d94ba 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -68,7 +68,7 @@ function main() { if (target === 'test') { // Add coverage reporters for HTML, lcov and JUnit output // Note: Using individual project coverage directories - cmd += ' --code-coverage --coverageReporters="lcov,html" --reporters="default,jest-junit"'; + cmd += ' --code-coverage --coverageReporters="lcov,html"'; } if (projects.length > 0) { From 1c617cc617924f22eb1a233eafb7b4e659cc2fbc Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 10 Aug 2025 03:07:44 +0200 Subject: [PATCH 23/67] Update coverage command to include all reporters for test target --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 4f8d94ba..4e11cbd9 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -68,7 +68,7 @@ function main() { if (target === 'test') { // Add coverage reporters for HTML, lcov and JUnit output // Note: Using individual project coverage directories - cmd += ' --code-coverage --coverageReporters="lcov,html"'; + cmd += ' --all --coverage --coverageReporters="lcov,html" --reporters=default,jest-junit'; } if (projects.length > 0) { From 60459735a9fe50e253b86cebfc72a12c597376e4 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 10 Aug 2025 06:13:04 +0200 Subject: [PATCH 24/67] Update coverage report merging to include job index in output filename --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index a17fe7bd..b472d7ac 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -50,7 +50,7 @@ jobs: run: find coverage/ -name "*.info" - name: Merge Coverage Reports - run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov.info' + run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov-${{ matrix.jobIndex }}.info' - name: Upload Coverage Reports uses: actions/upload-artifact@v4 From 99cb9ff2fec459505f797b3ebbd753fa2b791bce Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 10 Aug 2025 06:28:29 +0200 Subject: [PATCH 25/67] Add step to display structure of merged coverage files --- .github/workflows/fe-code-quality.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index b472d7ac..d78356b6 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -51,6 +51,8 @@ jobs: - name: Merge Coverage Reports run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov-${{ matrix.jobIndex }}.info' + - name: Display structure of merged files + run: find merger-coverage/ -name "*.info" - name: Upload Coverage Reports uses: actions/upload-artifact@v4 From fdaec11e6b8e7b3f80d3bb77b40498b9374d0044 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 10 Aug 2025 06:39:17 +0200 Subject: [PATCH 26/67] Ensure directory creation before merging coverage reports --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index d78356b6..f01c5202 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -50,7 +50,7 @@ jobs: run: find coverage/ -name "*.info" - name: Merge Coverage Reports - run: npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov-${{ matrix.jobIndex }}.info' + run: mkdir -p merger-coverage && npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov-${{ matrix.jobIndex }}.info' - name: Display structure of merged files run: find merger-coverage/ -name "*.info" From aefae4edc813e597033b2173a5afa610ad78adcf Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 10 Aug 2025 07:10:04 +0200 Subject: [PATCH 27/67] Ensure coverage directory exists before merging matrix coverage reports --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index f01c5202..5a3c6c88 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -80,7 +80,7 @@ jobs: - name: Display structure of downloaded files run: find merger-coverage/ -name "*.info" - name: Merge matrix coverage reports - run: npx lcov-result-merger 'merger-coverage/**/lcov.info' 'coverage/overall/lcov.info' + run: mkdir -p coverage/overall && npx lcov-result-merger 'merger-coverage/**/lcov.info' 'coverage/overall/lcov.info' - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: From 56dfdc19dbc8c415cfd82848dd238897972776f1 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Mon, 11 Aug 2025 02:59:52 +0200 Subject: [PATCH 28/67] Enhance SonarQube integration by adding environment variable loading and project properties generation --- .github/workflows/fe-code-quality.yml | 39 ++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 5a3c6c88..855c877e 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -81,8 +81,41 @@ jobs: run: find merger-coverage/ -name "*.info" - name: Merge matrix coverage reports run: mkdir -p coverage/overall && npx lcov-result-merger 'merger-coverage/**/lcov.info' 'coverage/overall/lcov.info' - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + + - name: Load environment variables + uses: collaborationFactory/cplace-gh-workflows/.github/actions/load-env-variables@release/1.0 + with: + secrets: ${{ toJson(secrets) }} + vars: ${{ toJson(vars) }} + env: + REPO_NAME: '.' + + - name: Create sonar-project.properties + id: sonar_generate_properties + run: .github/scripts/sonar_generate_properties.sh + env: + REPO_NAME: ${{ github.event.repository.name }} + SONAR_QUALITYGATE_TIMEOUT: ${{ env.CB_SONAR_QUALITYGATE_TIMEOUT }} + SONAR_QUALITYGATE_WAIT: ${{ env.CB_SONAR_QUALITYGATE_WAIT }} + SONAR_VERBOSE: ${{ env.CB_SONAR_VERBOSE }} + SONAR_PROJECT_KEY: ${{ inputs.sq_project_key }} + SONAR_UPDATE_BASE_LINE: ${{ inputs.sq_update_base_line }} + + - name: Dump sonar-project.properties + if: ${{ inputs.enable_trace_log == 'true' }} + run: cat sonar-project.properties + + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@v4 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ env.CB_SONAR_HOST_URL }} + + - name: Set baseline for sonar scan + if: always() && inputs.sq_update_base_line == 'true' + uses: collaborationFactory/cplace-gh-workflows/.github/actions/sonar-pin-baseline@release/1.0 + with: + sonar_token: ${{ secrets.SONAR_TOKEN }} + sonar_host_url: ${{ env.CB_SONAR_HOST_URL }} + project_key: ${{ env.PROJECT_KEY }} + project_version: ${{ env.PROJECT_VERSION }} From 9d6d6c5f41d6ae58d20a9b54720e11a58e5d420a Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Mon, 11 Aug 2025 03:53:10 +0200 Subject: [PATCH 29/67] Remove conditional checks for trace logging and baseline update in SonarQube steps --- .github/workflows/fe-code-quality.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 855c877e..f1f41435 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -102,7 +102,6 @@ jobs: SONAR_UPDATE_BASE_LINE: ${{ inputs.sq_update_base_line }} - name: Dump sonar-project.properties - if: ${{ inputs.enable_trace_log == 'true' }} run: cat sonar-project.properties - name: SonarQube Scan @@ -112,7 +111,6 @@ jobs: SONAR_HOST_URL: ${{ env.CB_SONAR_HOST_URL }} - name: Set baseline for sonar scan - if: always() && inputs.sq_update_base_line == 'true' uses: collaborationFactory/cplace-gh-workflows/.github/actions/sonar-pin-baseline@release/1.0 with: sonar_token: ${{ secrets.SONAR_TOKEN }} From bebbd0698772ca1868aa8dad7080d9c2deb2060d Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Mon, 11 Aug 2025 09:11:33 +0200 Subject: [PATCH 30/67] Remove SonarQube integration steps from frontend code quality workflow --- .github/workflows/fe-code-quality.yml | 56 --------------------------- 1 file changed, 56 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index f1f41435..7bc645d6 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -61,59 +61,3 @@ jobs: path: | merger-coverage/ retention-days: 7 - - sonar: - name: SonarCloud - needs: code-quality - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: download coverage report - uses: actions/download-artifact@v5 - with: - path: merger-coverage/ - pattern: coverage-reports-* - merge-multiple: true - - name: Display structure of downloaded files - run: find merger-coverage/ -name "*.info" - - name: Merge matrix coverage reports - run: mkdir -p coverage/overall && npx lcov-result-merger 'merger-coverage/**/lcov.info' 'coverage/overall/lcov.info' - - - name: Load environment variables - uses: collaborationFactory/cplace-gh-workflows/.github/actions/load-env-variables@release/1.0 - with: - secrets: ${{ toJson(secrets) }} - vars: ${{ toJson(vars) }} - env: - REPO_NAME: '.' - - - name: Create sonar-project.properties - id: sonar_generate_properties - run: .github/scripts/sonar_generate_properties.sh - env: - REPO_NAME: ${{ github.event.repository.name }} - SONAR_QUALITYGATE_TIMEOUT: ${{ env.CB_SONAR_QUALITYGATE_TIMEOUT }} - SONAR_QUALITYGATE_WAIT: ${{ env.CB_SONAR_QUALITYGATE_WAIT }} - SONAR_VERBOSE: ${{ env.CB_SONAR_VERBOSE }} - SONAR_PROJECT_KEY: ${{ inputs.sq_project_key }} - SONAR_UPDATE_BASE_LINE: ${{ inputs.sq_update_base_line }} - - - name: Dump sonar-project.properties - run: cat sonar-project.properties - - - name: SonarQube Scan - uses: sonarsource/sonarqube-scan-action@v4 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ env.CB_SONAR_HOST_URL }} - - - name: Set baseline for sonar scan - uses: collaborationFactory/cplace-gh-workflows/.github/actions/sonar-pin-baseline@release/1.0 - with: - sonar_token: ${{ secrets.SONAR_TOKEN }} - sonar_host_url: ${{ env.CB_SONAR_HOST_URL }} - project_key: ${{ env.PROJECT_KEY }} - project_version: ${{ env.PROJECT_VERSION }} From 067adce4256c725cb961823d0e2327e1473478d9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 13 Aug 2025 08:16:48 +0200 Subject: [PATCH 31/67] Refactor coverage report merging and upload steps in code quality workflow --- .github/workflows/fe-code-quality.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 7bc645d6..24e3d7b3 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -49,15 +49,9 @@ jobs: - name: Display structure of downloaded files run: find coverage/ -name "*.info" - - name: Merge Coverage Reports - run: mkdir -p merger-coverage && npx lcov-result-merger 'coverage/libs/**/lcov.info' 'merger-coverage/lcov-${{ matrix.jobIndex }}.info' - - name: Display structure of merged files - run: find merger-coverage/ -name "*.info" - - name: Upload Coverage Reports uses: actions/upload-artifact@v4 with: - name: coverage-reports-${{ matrix.jobIndex }} - path: | - merger-coverage/ + name: coverage-${{ matrix.jobIndex }} + path: merger-coverage/ retention-days: 7 From fd07a2da30057005e92475fb3fc90ddbe85b612b Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 13 Aug 2025 08:47:02 +0200 Subject: [PATCH 32/67] Update coverage artifact path in code quality workflow --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 24e3d7b3..a8ab91f8 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -53,5 +53,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage-${{ matrix.jobIndex }} - path: merger-coverage/ + path: coverage/ retention-days: 7 From 8419464ac1c91dc44d0d99653106bfd57b9eecc9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 27 Aug 2025 21:57:43 +0200 Subject: [PATCH 33/67] Add step to upload JUnit reports in code quality workflow --- .github/workflows/fe-code-quality.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index a8ab91f8..705f3932 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -55,3 +55,10 @@ jobs: name: coverage-${{ matrix.jobIndex }} path: coverage/ retention-days: 7 + + - name: Upload Junit Reports + uses: actions/upload-artifact@v4 + with: + name: junit-${{ matrix.jobIndex }} + path: reports/ + retention-days: 7 From c4bdadbc1048aa1dffd8253c01f3493520cedf70 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 27 Aug 2025 23:22:19 +0200 Subject: [PATCH 34/67] remove jest junit --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 4e11cbd9..9067444a 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -68,7 +68,7 @@ function main() { if (target === 'test') { // Add coverage reporters for HTML, lcov and JUnit output // Note: Using individual project coverage directories - cmd += ' --all --coverage --coverageReporters="lcov,html" --reporters=default,jest-junit'; + cmd += ' --all --coverage --coverageReporters="lcov,html"'; } if (projects.length > 0) { From 50f7fa09a5bdb06473b4c949e92d0b02f8770da9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 10 Sep 2025 06:53:12 +0200 Subject: [PATCH 35/67] Remove jest-junit dependency and related configurations --- .github/workflows/fe-code-quality.yml | 7 ----- package-lock.json | 37 --------------------------- package.json | 1 - tools/scripts/run-many/run-many.ts | 7 ----- 4 files changed, 52 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 705f3932..a8ab91f8 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -55,10 +55,3 @@ jobs: name: coverage-${{ matrix.jobIndex }} path: coverage/ retention-days: 7 - - - name: Upload Junit Reports - uses: actions/upload-artifact@v4 - with: - name: junit-${{ matrix.jobIndex }} - path: reports/ - retention-days: 7 diff --git a/package-lock.json b/package-lock.json index 45ed1992..53558eb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "@types/jest": "29.5.14", "@types/node": "^22.15.0", "jest": "29.7.0", - "jest-junit": "^16.0.0", "lcov-result-merger": "^5.0.1", "luxon": "^3.3.0", "prettier": "2.8.1", @@ -4523,22 +4522,6 @@ "fsevents": "^2.3.2" } }, - "node_modules/jest-junit": { - "version": "16.0.0", - "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/jest-junit/-/jest-junit-16.0.0.tgz", - "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "mkdirp": "^1.0.4", - "strip-ansi": "^6.0.1", - "uuid": "^8.3.2", - "xml": "^1.0.1" - }, - "engines": { - "node": ">=10.12.0" - } - }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -5733,19 +5716,6 @@ "node": "*" } }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -6785,13 +6755,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/xml": { - "version": "1.0.1", - "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/xml/-/xml-1.0.1.tgz", - "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", - "dev": true, - "license": "MIT" - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://cplace.jfrog.io/artifactory/api/npm/cplace-npm/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index d58c8e29..989201c6 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "@types/jest": "29.5.14", "@types/node": "^22.15.0", "jest": "29.7.0", - "jest-junit": "^16.0.0", "lcov-result-merger": "^5.0.1", "luxon": "^3.3.0", "prettier": "2.8.1", diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 9067444a..c8a9cc34 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -64,13 +64,6 @@ function main() { cmd = getE2ECommand(cmd, base); } - // Add coverage flag if enabled and target is test - if (target === 'test') { - // Add coverage reporters for HTML, lcov and JUnit output - // Note: Using individual project coverage directories - cmd += ' --all --coverage --coverageReporters="lcov,html"'; - } - if (projects.length > 0) { runCommand(cmd); } else { From bbc456863df07996c98650cc412afcaab7765a82 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 10 Sep 2025 15:36:28 +0200 Subject: [PATCH 36/67] Add SonarCloud integration to code quality workflow --- .github/workflows/fe-code-quality.yml | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index a8ab91f8..43524acc 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -55,3 +55,62 @@ jobs: name: coverage-${{ matrix.jobIndex }} path: coverage/ retention-days: 7 + + sonar: + name: SonarCloud + needs: code-quality + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: download coverage report + uses: actions/download-artifact@v5 + with: + path: coverage/ + pattern: coverage-* + merge-multiple: true + + - name: download junit report + uses: actions/download-artifact@v5 + with: + path: reports/ + pattern: junit-* + merge-multiple: true + + - name: Display structure of downloaded files + run: find coverage/ -name "*.info" + + - name: Merge matrix coverage reports + run: npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info + + - name: Normalize LCOV paths for Linux + run: | + if [ -f "./coverage/lcov.info" ]; then + sed -i 's|\\|/|g' ./coverage/lcov.info + echo "Normalized LCOV paths to Unix format" + fi + + - name: Upload Coverage Reports + uses: actions/upload-artifact@v4 + with: + name: coverage + path: coverage/ + retention-days: 7 + + - name: Upload Junit Reports + uses: actions/upload-artifact@v4 + with: + name: reports + path: reports/ + retention-days: 7 + + - name: Dump sonar-project.properties + run: cat sonar-project.properties + + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@v4 + env: + SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }} From 0cb63022b6233038b6c5804e15de034ce717eae9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 10 Sep 2025 15:58:52 +0200 Subject: [PATCH 37/67] Add optional SonarCloud token requirement for workflow call --- .github/workflows/fe-code-quality.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 43524acc..5f2ecc39 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -1,7 +1,10 @@ name: Frontend Code Quality Workflow -on: workflow_call - +on: + workflow_call: + secrets: + SONAR_CLOUD_TOKEN: + required: false jobs: code-quality: runs-on: ubuntu-latest @@ -60,6 +63,7 @@ jobs: name: SonarCloud needs: code-quality runs-on: ubuntu-latest + if: ${{ secrets.SONAR_CLOUD_TOKEN != '' }} steps: - name: Checkout uses: actions/checkout@v4 From 10d3fcb6feeb5e63a3ffd651b9f94a8d01d68dc0 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 06:46:43 +0200 Subject: [PATCH 38/67] Add check for SONAR_CLOUD_TOKEN existence in code quality workflow --- .github/workflows/fe-code-quality.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 5f2ecc39..380a13ba 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -5,6 +5,7 @@ on: secrets: SONAR_CLOUD_TOKEN: required: false + jobs: code-quality: runs-on: ubuntu-latest @@ -63,8 +64,17 @@ jobs: name: SonarCloud needs: code-quality runs-on: ubuntu-latest - if: ${{ secrets.SONAR_CLOUD_TOKEN != '' }} steps: + - name: Check if SONAR_CLOUD_TOKEN exists + id: check-secret + run: | + if [ -n "${{ secrets.SONAR_CLOUD_TOKEN }}" ]; then + echo "has_token=true" >> $GITHUB_OUTPUT + else + echo "has_token=false" >> $GITHUB_OUTPUT + fi + continue-on-error: false + - name: Checkout uses: actions/checkout@v4 with: From 4684249b44b79cf8bd12446c92159eea9db626cd Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 07:54:15 +0200 Subject: [PATCH 39/67] Add SonarCloud organization and project key support to code quality workflow --- .github/workflows/fe-code-quality.yml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 380a13ba..441842bc 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -5,6 +5,15 @@ on: secrets: SONAR_CLOUD_TOKEN: required: false + SONAR_CLOUD_ORG: + required: false + description: "SonarCloud organization key, e.g., 'my-org'" + SONAR_CLOUD_PROJECT_KEY: + required: false + description: "SonarCloud project key, e.g., 'my-project'" + SONAR_PROPERTIES: + required: false + description: "Additional sonar-project.properties content" jobs: code-quality: @@ -75,11 +84,33 @@ jobs: fi continue-on-error: false + - name: Skip SonarCloud steps if no token + if: steps.check-secret.outputs.has_token == 'false' + run: | + echo "SONAR_CLOUD_TOKEN is not set. Skipping SonarCloud analysis." + exit 0 + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Write sonar-project.properties + run: | + echo "sonar.organization=${{ secrets.SONAR_CLOUD_ORG }}" >> sonar-project.properties + echo "sonar.projectKey=${{ secrets.SONAR_CLOUD_PROJECT_KEY }}" >> sonar-project.properties + echo "sonar.sources=." >> sonar-project.properties + echo "sonar.tests=." >> sonar-project.properties + echo "sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.tsx,**/*.test.tsx" >> sonar-project.properties + echo "sonar.javascript.lcov.reportPaths=./coverage/lcov.info" >> sonar-project.properties + echo "sonar.testExecutionReportPaths=./reports/**/junit.xml" >> sonar-project.properties + echo "sonar.test.exclusions=**/node_modules/**,**/test/**" >> sonar-project.properties + echo "sonar.verbose=true" >> sonar-project.properties + if [ -n "${{ secrets.SONAR_PROPERTIES }}" ]; then + echo "${{ secrets.SONAR_PROPERTIES }}" >> sonar-project.properties + fi + cat sonar-project.properties + - name: download coverage report uses: actions/download-artifact@v5 with: From 95ce42c1c4e8a486c9d269f489a4a46e5cc0d91c Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 08:18:59 +0200 Subject: [PATCH 40/67] Add sonar.host.url configuration to sonar-project.properties --- .github/workflows/fe-code-quality.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 441842bc..6b84cc63 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -97,6 +97,7 @@ jobs: - name: Write sonar-project.properties run: | + echo "sonar.host.url=https://sonarcloud.io" > sonar-project.properties echo "sonar.organization=${{ secrets.SONAR_CLOUD_ORG }}" >> sonar-project.properties echo "sonar.projectKey=${{ secrets.SONAR_CLOUD_PROJECT_KEY }}" >> sonar-project.properties echo "sonar.sources=." >> sonar-project.properties From 68b38abf1fe41dbcd6b3fd0ec198a38c5fa4d957 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 10:30:34 +0200 Subject: [PATCH 41/67] Add inputs for SonarCloud organization and project key to code quality workflow --- .github/workflows/fe-code-quality.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 6b84cc63..b8f7acaf 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -5,15 +5,19 @@ on: secrets: SONAR_CLOUD_TOKEN: required: false + inputs: SONAR_CLOUD_ORG: required: false description: "SonarCloud organization key, e.g., 'my-org'" + type: string SONAR_CLOUD_PROJECT_KEY: required: false description: "SonarCloud project key, e.g., 'my-project'" + type: string SONAR_PROPERTIES: required: false description: "Additional sonar-project.properties content" + type: string jobs: code-quality: @@ -98,8 +102,8 @@ jobs: - name: Write sonar-project.properties run: | echo "sonar.host.url=https://sonarcloud.io" > sonar-project.properties - echo "sonar.organization=${{ secrets.SONAR_CLOUD_ORG }}" >> sonar-project.properties - echo "sonar.projectKey=${{ secrets.SONAR_CLOUD_PROJECT_KEY }}" >> sonar-project.properties + echo "sonar.organization=${{ inputs.SONAR_CLOUD_ORG }}" >> sonar-project.properties + echo "sonar.projectKey=${{ inputs.SONAR_CLOUD_PROJECT_KEY }}" >> sonar-project.properties echo "sonar.sources=." >> sonar-project.properties echo "sonar.tests=." >> sonar-project.properties echo "sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.tsx,**/*.test.tsx" >> sonar-project.properties @@ -107,8 +111,8 @@ jobs: echo "sonar.testExecutionReportPaths=./reports/**/junit.xml" >> sonar-project.properties echo "sonar.test.exclusions=**/node_modules/**,**/test/**" >> sonar-project.properties echo "sonar.verbose=true" >> sonar-project.properties - if [ -n "${{ secrets.SONAR_PROPERTIES }}" ]; then - echo "${{ secrets.SONAR_PROPERTIES }}" >> sonar-project.properties + if [ -n "${{ inputs.SONAR_PROPERTIES }}" ]; then + echo "${{ inputs.SONAR_PROPERTIES }}" >> sonar-project.properties fi cat sonar-project.properties From 72661ca90d1a8a9f4e226579491e34549e012c0e Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 10:39:47 +0200 Subject: [PATCH 42/67] Add input validation for SonarCloud token and organization/project key --- .github/workflows/fe-code-quality.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index b8f7acaf..5c48c98e 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -85,13 +85,24 @@ jobs: echo "has_token=true" >> $GITHUB_OUTPUT else echo "has_token=false" >> $GITHUB_OUTPUT + echo "SONAR_CLOUD_TOKEN secret must be set to run SonarCloud analysis." + fi + + - name: Check if sonar inputs are provided + id: check-inputs + if: steps.check-secret.outputs.has_token == 'true' + run: | + if [ -z "${{ inputs.SONAR_CLOUD_ORG }}" ] || [ -z "${{ inputs.SONAR_CLOUD_PROJECT_KEY }}" ]; then + echo "run_sonar=false" >> $GITHUB_OUTPUT + echo "SONAR_CLOUD_ORG and SONAR_CLOUD_PROJECT_KEY inputs must be provided when SONAR_CLOUD_TOKEN is set." + else + echo "run_sonar=true" >> $GITHUB_OUTPUT fi - continue-on-error: false - name: Skip SonarCloud steps if no token - if: steps.check-secret.outputs.has_token == 'false' + if: steps.check-inputs.outputs.run_sonar == 'false' || steps.check-secret.outputs.has_token == 'false' run: | - echo "SONAR_CLOUD_TOKEN is not set. Skipping SonarCloud analysis." + echo "Skipping SonarCloud analysis." exit 0 - name: Checkout From 597fdf87dce7c1bfdeb936d6f80ed79cd69462ef Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 12:16:35 +0200 Subject: [PATCH 43/67] Remove test execution report path from sonar-project.properties --- .github/workflows/fe-code-quality.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 5c48c98e..16f1b2c2 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -119,7 +119,6 @@ jobs: echo "sonar.tests=." >> sonar-project.properties echo "sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.tsx,**/*.test.tsx" >> sonar-project.properties echo "sonar.javascript.lcov.reportPaths=./coverage/lcov.info" >> sonar-project.properties - echo "sonar.testExecutionReportPaths=./reports/**/junit.xml" >> sonar-project.properties echo "sonar.test.exclusions=**/node_modules/**,**/test/**" >> sonar-project.properties echo "sonar.verbose=true" >> sonar-project.properties if [ -n "${{ inputs.SONAR_PROPERTIES }}" ]; then From b37e5e8db5e9f3926da3db3b05a1c21672b0bf00 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 14:29:22 +0200 Subject: [PATCH 44/67] Add continue-on-error option for unit tests in code quality workflow --- .github/workflows/fe-code-quality.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 16f1b2c2..d3622a97 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -56,6 +56,7 @@ jobs: - name: Unit Tests uses: collaborationFactory/github-actions/.github/actions/run-many@poc/code-coverage-in-code-quality-pr-pipeline + continue-on-error: true with: target: ${{ matrix.target }} jobIndex: ${{ matrix.jobIndex }} From bc4d312b6b1056fd4f506ea6dee9ea1e7aabcc48 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 16:27:54 +0200 Subject: [PATCH 45/67] Add continue-on-error option for unit tests in code quality workflow --- .github/workflows/fe-code-quality.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index d3622a97..e7856027 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -116,12 +116,8 @@ jobs: echo "sonar.host.url=https://sonarcloud.io" > sonar-project.properties echo "sonar.organization=${{ inputs.SONAR_CLOUD_ORG }}" >> sonar-project.properties echo "sonar.projectKey=${{ inputs.SONAR_CLOUD_PROJECT_KEY }}" >> sonar-project.properties - echo "sonar.sources=." >> sonar-project.properties - echo "sonar.tests=." >> sonar-project.properties echo "sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.tsx,**/*.test.tsx" >> sonar-project.properties echo "sonar.javascript.lcov.reportPaths=./coverage/lcov.info" >> sonar-project.properties - echo "sonar.test.exclusions=**/node_modules/**,**/test/**" >> sonar-project.properties - echo "sonar.verbose=true" >> sonar-project.properties if [ -n "${{ inputs.SONAR_PROPERTIES }}" ]; then echo "${{ inputs.SONAR_PROPERTIES }}" >> sonar-project.properties fi From b9a77efc68fd397b512afbb3ccda28fe4ffc64b9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Thu, 11 Sep 2025 22:42:31 +0200 Subject: [PATCH 46/67] Refactor code quality workflow by removing unnecessary steps and optimizing coverage report uploads --- .github/workflows/fe-code-quality.yml | 30 --------------------------- 1 file changed, 30 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index e7856027..962afd26 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -64,9 +64,6 @@ jobs: base: ${{ github.event.pull_request.base.ref }} ref: ${{ github.event.pull_request.head.ref }} - - name: Display structure of downloaded files - run: find coverage/ -name "*.info" - - name: Upload Coverage Reports uses: actions/upload-artifact@v4 with: @@ -130,16 +127,6 @@ jobs: pattern: coverage-* merge-multiple: true - - name: download junit report - uses: actions/download-artifact@v5 - with: - path: reports/ - pattern: junit-* - merge-multiple: true - - - name: Display structure of downloaded files - run: find coverage/ -name "*.info" - - name: Merge matrix coverage reports run: npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info @@ -150,23 +137,6 @@ jobs: echo "Normalized LCOV paths to Unix format" fi - - name: Upload Coverage Reports - uses: actions/upload-artifact@v4 - with: - name: coverage - path: coverage/ - retention-days: 7 - - - name: Upload Junit Reports - uses: actions/upload-artifact@v4 - with: - name: reports - path: reports/ - retention-days: 7 - - - name: Dump sonar-project.properties - run: cat sonar-project.properties - - name: SonarQube Scan uses: SonarSource/sonarqube-scan-action@v4 env: From 81ee9dbdad20fecab83451fe91c067cd3ff3139d Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 12 Sep 2025 06:50:32 +0200 Subject: [PATCH 47/67] Add default values for SonarCloud organization and project keys in code quality workflow --- .github/workflows/fe-code-quality.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 962afd26..ee8be991 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -10,14 +10,17 @@ on: required: false description: "SonarCloud organization key, e.g., 'my-org'" type: string + default: "collaborationfactory" SONAR_CLOUD_PROJECT_KEY: required: false description: "SonarCloud project key, e.g., 'my-project'" type: string + default: "collaborationFactory_${{ github.repository.name }}" SONAR_PROPERTIES: required: false description: "Additional sonar-project.properties content" type: string + default: "" jobs: code-quality: From 16667d654e2584cb3ad75d3ebec6a6fe7e873757 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 12 Sep 2025 07:24:46 +0200 Subject: [PATCH 48/67] Set default SonarCloud project key dynamically in code quality workflow --- .github/workflows/fe-code-quality.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index ee8be991..86087e96 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -15,7 +15,7 @@ on: required: false description: "SonarCloud project key, e.g., 'my-project'" type: string - default: "collaborationFactory_${{ github.repository.name }}" + default: "" SONAR_PROPERTIES: required: false description: "Additional sonar-project.properties content" @@ -89,11 +89,20 @@ jobs: echo "SONAR_CLOUD_TOKEN secret must be set to run SonarCloud analysis." fi + - name: Set SonarCloud Project Key + id: set-project-key + run: | + if [ -z "${{ inputs.SONAR_CLOUD_PROJECT_KEY }}" ]; then + echo "project_key=collaborationFactory_${{ github.event.repository.name }}" >> $GITHUB_OUTPUT + else + echo "project_key=${{ inputs.SONAR_CLOUD_PROJECT_KEY }}" >> $GITHUB_OUTPUT + fi + - name: Check if sonar inputs are provided id: check-inputs if: steps.check-secret.outputs.has_token == 'true' run: | - if [ -z "${{ inputs.SONAR_CLOUD_ORG }}" ] || [ -z "${{ inputs.SONAR_CLOUD_PROJECT_KEY }}" ]; then + if [ -z "${{ inputs.SONAR_CLOUD_ORG }}" ] || [ -z "${{ steps.set-project-key.outputs.project_key }}" ]; then echo "run_sonar=false" >> $GITHUB_OUTPUT echo "SONAR_CLOUD_ORG and SONAR_CLOUD_PROJECT_KEY inputs must be provided when SONAR_CLOUD_TOKEN is set." else @@ -115,7 +124,7 @@ jobs: run: | echo "sonar.host.url=https://sonarcloud.io" > sonar-project.properties echo "sonar.organization=${{ inputs.SONAR_CLOUD_ORG }}" >> sonar-project.properties - echo "sonar.projectKey=${{ inputs.SONAR_CLOUD_PROJECT_KEY }}" >> sonar-project.properties + echo "sonar.projectKey=${{ steps.set-project-key.outputs.project_key }}" >> sonar-project.properties echo "sonar.test.inclusions=**/*.spec.ts,**/*.test.ts,**/*.spec.tsx,**/*.test.tsx" >> sonar-project.properties echo "sonar.javascript.lcov.reportPaths=./coverage/lcov.info" >> sonar-project.properties if [ -n "${{ inputs.SONAR_PROPERTIES }}" ]; then From f5cb037ad128ac059493aa6c4c28c6ae9bec8500 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Tue, 16 Sep 2025 15:33:52 +0200 Subject: [PATCH 49/67] Add code coverage command to test target in run-many.ts --- tools/scripts/run-many/run-many.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index c8a9cc34..9a45be59 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -7,6 +7,15 @@ function getE2ECommand(command: string, base: string): string { return command; } +function getCoverageCommand(command: string): string { + core.info(`Before coverage command: ${command}`); + command = command.concat( + ' --codeCoverage --coverageReporters=["html", "lcov"]' + ); + core.info(`After coverage command: ${command}`); + return command; +} + function runCommand(command: string): void { if (command.includes('--targets=e2e')) { const commandArr = command.split(' '); @@ -64,6 +73,14 @@ function main() { cmd = getE2ECommand(cmd, base); } + // Add coverage flag if enabled and target is test + if (target === 'test') { + core.info('Coverage gate is enabled'); + // Add coverage reporters for HTML, JSON, and JUnit output + // Note: Using individual project coverage directories + cmd = getCoverageCommand(cmd); + } + if (projects.length > 0) { runCommand(cmd); } else { From 18e91f3b7139d261464d788910d64355af149e76 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 17 Sep 2025 08:44:58 +0200 Subject: [PATCH 50/67] Fix formatting of coverageReporters in getCoverageCommand function --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 9a45be59..7652fab9 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - ' --codeCoverage --coverageReporters=["html", "lcov"]' + ' --codeCoverage --coverageReporters=[\"html\", \"lcov\"]' ); core.info(`After coverage command: ${command}`); return command; From 7f767328e2754e5a82af3b549524f3c6342ae188 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 17 Sep 2025 09:37:05 +0200 Subject: [PATCH 51/67] Fix formatting of coverageReporters in getCoverageCommand function --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 7652fab9..e7353493 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - ' --codeCoverage --coverageReporters=[\"html\", \"lcov\"]' + `--codeCoverage --coverageReporters=['html', 'lcov']` ); core.info(`After coverage command: ${command}`); return command; From b67f57e4215ca49c8d46ba8b30369673393054fd Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 17 Sep 2025 09:56:33 +0200 Subject: [PATCH 52/67] Fix formatting of coverageReporters in getCoverageCommand function --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index e7353493..29b0cdc9 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - `--codeCoverage --coverageReporters=['html', 'lcov']` + `--codeCoverage --coverageReporters=["html", "lcov"]` ); core.info(`After coverage command: ${command}`); return command; From d6c0273ce6807a50cdcee0d0976ac328ea0f7571 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 17 Sep 2025 09:58:09 +0200 Subject: [PATCH 53/67] Fix formatting of coverageReporters in getCoverageCommand function --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 29b0cdc9..63c1f1ca 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - `--codeCoverage --coverageReporters=["html", "lcov"]` + `--codeCoverage=true --coverageReporters=["html", "lcov"]` ); core.info(`After coverage command: ${command}`); return command; From dcac214c887d789be6300d1cac0f71dc382125b9 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 22 Oct 2025 13:34:57 +0200 Subject: [PATCH 54/67] check for lcov files availability before merging coverage reports --- .github/workflows/fe-code-quality.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 86087e96..2a21ae1c 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -139,7 +139,19 @@ jobs: pattern: coverage-* merge-multiple: true + - name: Check for LCOV files + id: check-lcov + run: | + if ls ./coverage/**/lcov*.info 1> /dev/null 2>&1; then + echo "lcov_exists=true" >> $GITHUB_OUTPUT + echo "LCOV files found, will proceed with merge" + else + echo "lcov_exists=false" >> $GITHUB_OUTPUT + echo "No LCOV files found, skipping merge" + fi + - name: Merge matrix coverage reports + if: steps.check-lcov.outputs.lcov_exists == 'true' run: npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info - name: Normalize LCOV paths for Linux From 6fae5f802730a4eee870b0a200e9450071fd39e1 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Wed, 22 Oct 2025 13:52:49 +0200 Subject: [PATCH 55/67] check for lcov files availability before normalizing coverage reports --- .github/workflows/fe-code-quality.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 2a21ae1c..82e3b3b6 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -155,6 +155,7 @@ jobs: run: npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info - name: Normalize LCOV paths for Linux + if: steps.check-lcov.outputs.lcov_exists == 'true' run: | if [ -f "./coverage/lcov.info" ]; then sed -i 's|\\|/|g' ./coverage/lcov.info From 090db5fe9bca1a04871d47beb41f5e09cc7a3db6 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 31 Oct 2025 23:52:52 +0100 Subject: [PATCH 56/67] Update run-many.ts add space infront of the coverage cli parameter attachment --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 63c1f1ca..f7874596 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - `--codeCoverage=true --coverageReporters=["html", "lcov"]` + ` --codeCoverage=true --coverageReporters=["html", "lcov"]` ); core.info(`After coverage command: ${command}`); return command; From f45a1fae49501d937d99984b35abe0c24d7c42d0 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Fri, 31 Oct 2025 23:58:46 +0100 Subject: [PATCH 57/67] Fix quotes in coverage report command --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index f7874596..5f84fa72 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - ` --codeCoverage=true --coverageReporters=["html", "lcov"]` + ` --codeCoverage=true --coverageReporters=['html', 'lcov']` ); core.info(`After coverage command: ${command}`); return command; From f9e3d90dc32061ee790eb6dfa352eefbc0411b3c Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sat, 1 Nov 2025 00:04:36 +0100 Subject: [PATCH 58/67] Fix coverage command to use only 'lcov' reporter --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index 5f84fa72..a24d59ed 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - ` --codeCoverage=true --coverageReporters=['html', 'lcov']` + ` --codeCoverage=true --coverageReporters=['lcov']` ); core.info(`After coverage command: ${command}`); return command; From 94e6accb6a99d1c678a76d7debcfef765f2fe48c Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 07:57:35 +0100 Subject: [PATCH 59/67] Fail the pipeline, if unit tests are failed. --- .github/workflows/fe-code-quality.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 82e3b3b6..73f3b8d1 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -58,6 +58,7 @@ jobs: run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} || true - name: Unit Tests + id: test uses: collaborationFactory/github-actions/.github/actions/run-many@poc/code-coverage-in-code-quality-pr-pipeline continue-on-error: true with: @@ -74,6 +75,13 @@ jobs: path: coverage/ retention-days: 7 + - name: Fail pipeline if test step failed + run: | + if [ "${{ steps.test.outcome }}" = "failure" ]; then + echo "Unit tests step failed, failing the pipeline." + exit 1 + fi + sonar: name: SonarCloud needs: code-quality From c70572f620aea04e323b5adacd5653803e98349b Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 08:14:18 +0100 Subject: [PATCH 60/67] fix coverage cli parameter --- tools/scripts/run-many/run-many.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/run-many/run-many.ts b/tools/scripts/run-many/run-many.ts index a24d59ed..e4582ad9 100644 --- a/tools/scripts/run-many/run-many.ts +++ b/tools/scripts/run-many/run-many.ts @@ -10,7 +10,7 @@ function getE2ECommand(command: string, base: string): string { function getCoverageCommand(command: string): string { core.info(`Before coverage command: ${command}`); command = command.concat( - ` --codeCoverage=true --coverageReporters=['lcov']` + ` --codeCoverage=true --coverageReporters=lcov --coverageReporters=html` ); core.info(`After coverage command: ${command}`); return command; From 643870423efbd670e5612d0cb8323bfe74bfe0c7 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 15:11:28 +0100 Subject: [PATCH 61/67] add check for lcov with fix for the path --- .github/workflows/fe-code-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 73f3b8d1..2d6ca9b2 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -143,7 +143,7 @@ jobs: - name: download coverage report uses: actions/download-artifact@v5 with: - path: coverage/ + path: ./ pattern: coverage-* merge-multiple: true From a9462649710027e711045e3b6f82a5d61deaee8a Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 15:30:06 +0100 Subject: [PATCH 62/67] debug coverage path --- .github/workflows/fe-code-quality.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 2d6ca9b2..996e9eb9 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -147,6 +147,13 @@ jobs: pattern: coverage-* merge-multiple: true + - name: Debug - List downloaded files + run: | + echo "=== Current directory structure ===" + ls -la + echo "=== Searching for LCOV files ===" + find . -name "*.info" -type f || echo "No .info files found" + - name: Check for LCOV files id: check-lcov run: | From 9f6b8464130b0b75a72bd2e62367083caa06ddff Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 15:49:26 +0100 Subject: [PATCH 63/67] fix coverage path --- .github/workflows/fe-code-quality.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 996e9eb9..cf806dcf 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -143,7 +143,7 @@ jobs: - name: download coverage report uses: actions/download-artifact@v5 with: - path: ./ + path: ./coverage pattern: coverage-* merge-multiple: true @@ -167,7 +167,9 @@ jobs: - name: Merge matrix coverage reports if: steps.check-lcov.outputs.lcov_exists == 'true' - run: npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info + run: | + mkdir -p ./coverage + npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info - name: Normalize LCOV paths for Linux if: steps.check-lcov.outputs.lcov_exists == 'true' From ca0e623cbf7c289681040d0b9c8ec2cc7e282161 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 16:00:26 +0100 Subject: [PATCH 64/67] fix coverage path --- .github/workflows/fe-code-quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index cf806dcf..d9d0cba2 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -157,7 +157,7 @@ jobs: - name: Check for LCOV files id: check-lcov run: | - if ls ./coverage/**/lcov*.info 1> /dev/null 2>&1; then + if find ./coverage -name "lcov*.info" -type f | grep -q .; then echo "lcov_exists=true" >> $GITHUB_OUTPUT echo "LCOV files found, will proceed with merge" else @@ -168,7 +168,7 @@ jobs: - name: Merge matrix coverage reports if: steps.check-lcov.outputs.lcov_exists == 'true' run: | - mkdir -p ./coverage + shopt -s globstar npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info - name: Normalize LCOV paths for Linux From c742e35a7cdc39894373e6c94336b15cbaef00be Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 16:39:23 +0100 Subject: [PATCH 65/67] debug merge lcov --- .github/workflows/fe-code-quality.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index d9d0cba2..c3f1f9dd 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -179,6 +179,24 @@ jobs: echo "Normalized LCOV paths to Unix format" fi + - name: Debug - Inspect merged coverage file + if: steps.check-lcov.outputs.lcov_exists == 'true' + run: | + echo "=== Merged coverage file exists ===" + ls -lh ./coverage/lcov.info + echo "" + echo "=== First 50 lines of merged coverage ===" + head -n 50 ./coverage/lcov.info + echo "" + echo "=== Unique source file paths in coverage ===" + grep "^SF:" ./coverage/lcov.info | sort -u | head -n 20 + echo "" + echo "=== Current working directory ===" + pwd + echo "" + echo "=== Repository structure (top-level) ===" + ls -la + - name: SonarQube Scan uses: SonarSource/sonarqube-scan-action@v4 env: From 046e6066ab150ae3df43b91da80053e207f352f3 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 16:48:17 +0100 Subject: [PATCH 66/67] debug merge lcov --- .github/workflows/fe-code-quality.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index c3f1f9dd..69499365 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -168,8 +168,14 @@ jobs: - name: Merge matrix coverage reports if: steps.check-lcov.outputs.lcov_exists == 'true' run: | - shopt -s globstar - npx lcov-result-merger ./coverage/**/lcov*.info ./coverage/lcov.info + echo "=== Finding all LCOV files ===" + find ./coverage -name "lcov*.info" -type f + echo "" + echo "=== Merging coverage files ===" + npx lcov-result-merger "coverage/**/lcov*.info" coverage/lcov.info + echo "" + echo "=== Merge completed ===" + ls -lh ./coverage/lcov.info - name: Normalize LCOV paths for Linux if: steps.check-lcov.outputs.lcov_exists == 'true' From 43243db3ef13d9ed582951aab5443821fae91e49 Mon Sep 17 00:00:00 2001 From: Senthanal Sirpi Manohar Date: Sun, 2 Nov 2025 17:05:36 +0100 Subject: [PATCH 67/67] cleanup --- .github/workflows/fe-code-quality.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/workflows/fe-code-quality.yml b/.github/workflows/fe-code-quality.yml index 69499365..ab4dac66 100644 --- a/.github/workflows/fe-code-quality.yml +++ b/.github/workflows/fe-code-quality.yml @@ -147,13 +147,6 @@ jobs: pattern: coverage-* merge-multiple: true - - name: Debug - List downloaded files - run: | - echo "=== Current directory structure ===" - ls -la - echo "=== Searching for LCOV files ===" - find . -name "*.info" -type f || echo "No .info files found" - - name: Check for LCOV files id: check-lcov run: | @@ -185,24 +178,6 @@ jobs: echo "Normalized LCOV paths to Unix format" fi - - name: Debug - Inspect merged coverage file - if: steps.check-lcov.outputs.lcov_exists == 'true' - run: | - echo "=== Merged coverage file exists ===" - ls -lh ./coverage/lcov.info - echo "" - echo "=== First 50 lines of merged coverage ===" - head -n 50 ./coverage/lcov.info - echo "" - echo "=== Unique source file paths in coverage ===" - grep "^SF:" ./coverage/lcov.info | sort -u | head -n 20 - echo "" - echo "=== Current working directory ===" - pwd - echo "" - echo "=== Repository structure (top-level) ===" - ls -la - - name: SonarQube Scan uses: SonarSource/sonarqube-scan-action@v4 env: