Skip to content

reliability: add CI quality gates (tests, lint, type-check, PR-size)#2

Open
bdevierno1 wants to merge 5 commits into
mainfrom
add-data-quality-checks
Open

reliability: add CI quality gates (tests, lint, type-check, PR-size)#2
bdevierno1 wants to merge 5 commits into
mainfrom
add-data-quality-checks

Conversation

@bdevierno1

Copy link
Copy Markdown
Owner

Summary

  • Adds .github/workflows/ci.yml with four jobs: PR-size gate (<400 lines), backend pytest + 60% coverage floor + ruff lint + mypy type-check, frontend eslint + tsc + vite build, and a ci-gate rollup job that acts as the single required status check.
  • Adds .github/PULL_REQUEST_TEMPLATE.md: full release-readiness checklist (CI, correctness, security, migrations, feature flags, ops, sign-off).
  • Adds .github/ISSUE_TEMPLATE/release-readiness.yml: structured tracking issue mirroring the same checklist.

Motivation

Reliability sweep finding (2026-06-19): The repo has no CI pipeline. Zero automated checks run on PRs, meaning regressions and lint violations can merge silently. This is the primary reliability gap identified today — the app is classified Yellow on the internal SLO bands because the absence of enforcement elevates regression risk and makes DORA Change Failure Rate untrackable.

The backend test suite already has 89 passing tests; this PR wires the CI infrastructure that makes those tests blocking on every PR.

Feature-freeze recommendation

Per error-budget policy: the app is classified Yellow (no production telemetry → conservative default; CI gap raises regression risk). Until this PR merges and CI is confirmed green, prefer low-risk reliability work. No large migrations or new API surfaces should be merged without a rollback plan. The outstanding SSRF security fix (PR #1) is explicitly exempted — it is a reliability/security patch that should proceed independent of this PR.

Test plan

  • Backend: cd backend && pip install -r requirements.txt && pytest tests/ -v → 89 passed locally (main), 118 passed on security/asi02-ssrf-tool-url-validation
  • Frontend: cd frontend && npm ci && npx tsc --noEmit && npm run lint

Out of scope

  • The backend/data_quality/ and docs/runbooks/ partial work from a prior session — separate PR once complete.
  • Coverage enforcement is set at 60% floor (current ~65%); raising it is a follow-up after CI is established.

🤖 Generated with Vecna

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

bdevierno1 and others added 2 commits June 18, 2026 20:35
- .github/workflows/ci.yml: PR-size gate (<400 lines), backend pytest
  with 60% coverage floor, ruff lint, mypy type-check, frontend eslint
  + tsc + vite build, and a ci-gate rollup job as the required check.
- .github/PULL_REQUEST_TEMPLATE.md: full release-readiness checklist
  covering CI, correctness, security, migrations, feature flags, ops
  readiness, and stakeholder sign-off.
- .github/ISSUE_TEMPLATE/release-readiness.yml: structured release
  tracking issue template mirroring the same checklist.

Enforces code-review-standards.md and release-readiness-checklist.md.

Co-Authored-By: Vecna <noreply@vecna.ai>
- backend: remove 4 unused imports (F401) via ruff --fix:
  * fastapi.Request in app/main.py
  * sqlalchemy.ext.asyncio.async_sessionmaker in app/main.py
  * math in tests/test_errors.py
  * unittest.mock.MagicMock in tests/test_http_client.py
- backend: suppress E402 on intentional late import in agent/vecna_litellm.py
  (import litellm must follow litellm_main patching)
- frontend: regenerate package-lock.json so npm ci succeeds
  (was missing @emnapi/core@1.11.1, @emnapi/runtime@1.11.1;
   had wrong @emnapi/wasi-threads version)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bdevierno1 and others added 2 commits July 13, 2026 20:08
fix: resolve CI failures introduced by PR #2 quality gates
Frontend (eslint):
- App.tsx: call connectWs via a ref in the reconnect timer so it is no
  longer accessed before declaration (react-hooks TDZ); wrap the two
  effect data-loads (loadOps, openPastOperation) in async IIFEs to
  satisfy react-hooks/set-state-in-effect (matches the file's existing
  effect idiom). These two were previously masked by the compiler
  bailout on the connectWs error.
- badge.tsx/button.tsx: stop exporting badgeVariants/buttonVariants
  (no external consumers) so each file only exports components
  (react-refresh/only-export-components).

Backend (mypy):
- operation_context.py: type the run_coroutine_threadsafe done-callback
  against concurrent.futures.Future (not asyncio.Future).
- agent/tools.py: coerce getaddrinfo sockaddr[0] (str | int) to str for
  the list[dict[str, str]] entry.

Backend (test import):
- add pytest.ini pythonpath=. so `pytest tests/` (console script) can
  import the app package; without it CI's Backend test step errors with
  ModuleNotFoundError.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Splits the two governance/template files (.github/ISSUE_TEMPLATE/
release-readiness.yml, .github/PULL_REQUEST_TEMPLATE.md) into follow-up
PR #14 to free PR-size budget, and adds unit tests for the pure helpers
(url_guard, lib/serialize, lib/report) to lift backend coverage above the
--cov-fail-under=60 gate. Measured 61.3% on Python 3.11.15 (CI's version);
no gate threshold was relaxed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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