From 89da20672a59144b3b1fad0a7714b0f26eae6cc1 Mon Sep 17 00:00:00 2001 From: Kurian Vithayathil <1056073+kvithayathil@users.noreply.github.com> Date: Wed, 24 Jun 2026 16:34:19 -0400 Subject: [PATCH 1/3] fix(ci): repair code quality workflow paths --- .github/workflows/code-quality.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 9a68b05..8e236f9 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -15,7 +15,7 @@ jobs: uses: astral-sh/setup-uv@v4 with: enable-cache: true - cache-dependency-glob: "main/backend/uv.lock" + cache-dependency-glob: "backend/uv.lock" - name: Setup Bun uses: oven-sh/setup-bun@v1 @@ -29,18 +29,15 @@ jobs: uses: extractions/setup-just@v2 - name: Install backend dependencies - working-directory: main run: cd backend && uv sync --dev - name: Install frontend dependencies - working-directory: main run: cd frontend && bun install --frozen-lockfile - name: Install code quality tools run: npm install -g jscpd fallow - name: Run fallow analysis (frontend — SvelteKit) - working-directory: main run: cd frontend && npx fallow --format json --sarif-file fallow-results.sarif > fallow-results.json continue-on-error: true @@ -48,29 +45,24 @@ jobs: uses: github/codeql-action/upload-sarif@v3 if: always() with: - sarif_file: main/frontend/fallow-results.sarif + sarif_file: frontend/fallow-results.sarif category: fallow-frontend - name: Run duplication analysis (backend only) - working-directory: main run: just duplication - name: Run complexity analysis - working-directory: main run: just complexity - name: Run dead code analysis (backend — Python) - working-directory: main run: cd backend && uv run vulture app/ vulture_whitelist.py --min-confidence 80 2>&1 | tee ../vulture-report.txt continue-on-error: true - name: Run dead code analysis (frontend — SvelteKit) - working-directory: main run: cd frontend && npx fallow dead-code --format json > ../fallow-frontend-dead-code.json continue-on-error: true - name: Check quality thresholds - working-directory: main run: | echo "=== Quality Threshold Check ===" FAIL=0 @@ -125,11 +117,11 @@ jobs: with: name: code-quality-reports path: | - main/jscpd-report/ - main/vulture-report.txt - main/frontend/fallow-results.json - main/frontend/fallow-results.sarif - main/fallow-frontend-dead-code.json + jscpd-report/ + vulture-report.txt + frontend/fallow-results.json + frontend/fallow-results.sarif + fallow-frontend-dead-code.json - name: Create failure issue if: failure() From e50d92f9cedab556de3312c8caba7eca6ce7c054 Mon Sep 17 00:00:00 2001 From: Kurian Vithayathil <1056073+kvithayathil@users.noreply.github.com> Date: Wed, 24 Jun 2026 22:53:08 -0400 Subject: [PATCH 2/3] fix(ci): use correct jscpd report filename in quality thresholds --- .github/workflows/code-quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 8e236f9..92290eb 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -66,8 +66,8 @@ jobs: run: | echo "=== Quality Threshold Check ===" FAIL=0 - if [ -f jscpd-report/index.html ]; then - DUP_PCT=$(grep -oP '\d+(?=%)' jscpd-report/index.html | head -1) + if [ -f jscpd-report/jscpd-report.html ]; then + DUP_PCT=$(grep -oP '\d+(?=%)' jscpd-report/jscpd-report.html | head -1) if [ -z "$DUP_PCT" ]; then echo "::warning::Could not parse duplication percentage from jscpd report" DUP_PCT=0 From 5c077d21056ed09f4e63fe4c3c81819ffefdfad5 Mon Sep 17 00:00:00 2001 From: Kurian Vithayathil <1056073+kvithayathil@users.noreply.github.com> Date: Wed, 24 Jun 2026 23:53:05 -0400 Subject: [PATCH 3/3] fix(ci): extract jscpd duplication pct from stat card not CSS The quality-thresholds step grepped for digits before '%' and took the first match, which was '100' from 'width: 100%' in the report's CSS. This false-positive triggered the 20% gate on every run. Scope the grep to the 'Duplicated Lines' stat card so only the real duplication rate is matched, and switch the threshold check from bash integer -gt to awk so decimal percentages (e.g. 2.20%) compare correctly. --- .github/workflows/code-quality.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 92290eb..6f2b3e0 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -67,13 +67,15 @@ jobs: echo "=== Quality Threshold Check ===" FAIL=0 if [ -f jscpd-report/jscpd-report.html ]; then - DUP_PCT=$(grep -oP '\d+(?=%)' jscpd-report/jscpd-report.html | head -1) + # Scope to the "Duplicated Lines" stat card; a bare grep for digits + # before % matches CSS values like width:100% earlier in the HTML. + DUP_PCT=$(grep -A1 'Duplicated Lines' jscpd-report/jscpd-report.html | grep -oP '\d+(?:\.\d+)?(?=%)' | head -1) if [ -z "$DUP_PCT" ]; then echo "::warning::Could not parse duplication percentage from jscpd report" DUP_PCT=0 fi echo "Duplication: ${DUP_PCT}%" - if [ "$DUP_PCT" -gt 20 ] 2>/dev/null; then + if awk "BEGIN {exit !($DUP_PCT > 20)}"; then echo "::error::Duplication above 20% threshold: ${DUP_PCT}%" FAIL=1 fi