Skip to content

fix: remediate CI failures on PR #10 (Badge TS2322 + pytest pythonpath)#12

Merged
bdevierno1 merged 1 commit into
dora-metrics-dashboardfrom
fix/ci-pr10-badge-and-pytest
Jul 14, 2026
Merged

fix: remediate CI failures on PR #10 (Badge TS2322 + pytest pythonpath)#12
bdevierno1 merged 1 commit into
dora-metrics-dashboardfrom
fix/ci-pr10-badge-and-pytest

Conversation

@bdevierno1

Copy link
Copy Markdown
Owner

Summary

Remediation PR for CI failures blocking PR #10 — feat: instrument DORA delivery metrics + dashboard tab.

This branch is based on dora-metrics-dashboard and contains only the CI fixes — no logic changes.


Fix 1 — Frontend TS2322: Badge variant 'secondary' not in union

File: frontend/src/components/DoraDashboard.tsx (lines 47–51)

Root cause: The healthBadge map declared its type as Record<Health, 'default' | 'secondary' | 'destructive'> and assigned yellow: 'secondary'. The Badge component's variant union is:

'default' | 'destructive' | 'warning' | 'success' | 'outline'

'secondary' is absent, causing TS2322 in tsc -b, which blocked npm run build.

Fix: Change the type annotation to 'default' | 'warning' | 'destructive' and the yellow value to 'warning'. Semantically correct — amber/warning matches the "at risk" health state.

Verified: npx tsc --noEmit → clean. npm run build → ✅ built in 493ms.


Fix 2 — Backend: ModuleNotFoundError: No module named 'app'

Files: backend/tests/test_api.py:5, backend/tests/test_billing.py:3 (and all tests/*.py)

Root cause: The CI backend job runs pytest tests/ with working-directory: backend, but without backend/pyproject.toml, Python's sys.path doesn't include backend/, so from app.main import app fails at collection.

Fix: Add backend/pyproject.toml with:

[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]

This is identical to the config introduced in PR #3 (add-ci-quality-gates) which passes the backend CI job green. PR #10 branched off an earlier commit before that fix landed.


Fix 3 — PR size gate (> 400 lines): ⚠️ out of scope / operator action needed

The original PR #10 diff is ~707 lines (681 additions + 26 deletions), exceeding the 400-line gate. This remediation PR itself is 11 lines and will pass the gate.

The size gate failure belongs to PR #10 directly. Options for the operator:

  1. Split PR feat: instrument DORA delivery metrics + dashboard tab #10 into two sub-PRs: (a) backend/app/routers/dora.py endpoint, (b) DoraDashboard.tsx + App.tsx — each under 400 lines.
  2. Merge the CI fixes from this PR into dora-metrics-dashboard via squash, then re-evaluate splitting.

No automated label/exception override exists in the current CI workflow (ci.yml line 29: hard exit 1). Operator decision required before PR #10 can pass the size gate.


Checklist

🤖 Generated with Vecna

Co-Authored-By: Vecna noreply@vecna.ai

…pytest pythonpath

- DoraDashboard.tsx: replace Badge variant 'secondary' (not in union) with 'warning'
  to fix TS2322 type error blocking tsc and npm run build
- backend/pyproject.toml: add [tool.pytest.ini_options] with pythonpath=["."] so
  pytest running from backend/ can resolve 'app.*' imports (matches PR #3 config)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bdevierno1 bdevierno1 marked this pull request as ready for review July 14, 2026 01:08
@bdevierno1 bdevierno1 merged commit f02a98a into dora-metrics-dashboard Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant