Skip to content

fix: resolve all CI check failures - #4

Merged
badry-dev merged 7 commits into
mainfrom
claude/setup-repo-scaffolding-cicd-1txix
Mar 4, 2026
Merged

badry-dev merged 7 commits into
mainfrom
claude/setup-repo-scaffolding-cicd-1txix

Conversation

@badry-dev

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits March 4, 2026 14:34
Establishes the complete monorepo foundation before feature work begins:

Backend (Python 3.12 / FastAPI):
- app/main.py: FastAPI app with CORS middleware and /api/v1/admin/health
- app/config.py: Pydantic Settings v2 configuration loader
- requirements.txt: pinned dependencies (FastAPI, SQLAlchemy, Alembic,
  python-oracledb, APScheduler, PyJWT, bcrypt, structlog, ruff, mypy,
  pytest)
- pyproject.toml: ruff, mypy (strict), pytest-asyncio, coverage config
- tests/test_health.py: health endpoint smoke test

Frontend (Vite + React 18 + TypeScript):
- Tailwind CSS with shadcn/ui CSS variable theme
- ESLint (typescript-eslint) + Prettier with tailwindcss plugin
- Vitest with @testing-library/react
- App.tsx baseline component and App.test.tsx smoke test

Docker:
- docker/Dockerfile.backend: python:3.12-slim, non-root user
- docker/Dockerfile.frontend: multi-stage Node build + nginx:1.27-alpine
- docker/nginx.conf: SPA fallback + /api/* proxy to backend
- docker-compose.yml: api, web, db services with healthchecks;
  optional oracle profile via gvenzl/oracle-xe

GitHub Actions:
- .github/workflows/backend.yml: ruff, mypy, pytest (with Postgres svc)
- .github/workflows/frontend.yml: eslint, prettier --check, vitest, build
- .github/workflows/docker.yml: build both images + compose config check

Docs and tooling:
- docs/architecture.md: system diagram, route namespaces, design decisions
- docs/contributing.md: onboarding, setup steps, check commands
- docs/conventions.md: branch/PR rules, commit hygiene, API versioning,
  migration workflow, security constraints, logging standards
- Makefile: setup, check, docker-build/up/down, dev server targets
- README.md: quick-start guide with tech stack summary
- .env.example: root-level environment template
- .gitignore: Python, Node, Docker, OS, IDE artifacts

https://claude.ai/code/session_01CREZQfgG9HeXtcS4AvUKv4
Backend:
- Fix ruff I001: sort imports in tests/test_health.py (pytest after fastapi)
- Remove duplicate httpx entry from requirements.txt
- Drop unused types-passlib dev dependency

Frontend:
- Add package-lock.json so `npm ci` succeeds in CI and Docker builds
- Fix ESLint no-require-imports: replace require() with ES import in
  tailwind.config.ts
- Fix Prettier formatting in eslint.config.js, tsconfig.json

https://claude.ai/code/session_01CREZQfgG9HeXtcS4AvUKv4
Copilot AI review requested due to automatic review settings March 4, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR scaffolds the repo to resolve CI failures by adding baseline backend/frontend apps, tooling configs, Dockerization, and CI workflows so the project can lint, type-check, test, and build consistently.

Changes:

  • Add a minimal FastAPI backend with /api/v1/admin/health, backend tooling (ruff/mypy/pytest), and a smoke test.
  • Add a minimal Vite + React + Tailwind frontend with ESLint/Prettier/Vitest setup and a basic component test.
  • Add Dockerfiles, nginx SPA config, docker-compose services, and GitHub Actions workflows for backend/frontend/docker CI.

Reviewed changes

Copilot reviewed 36 out of 42 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend/vite.config.ts Vite config (React plugin, alias, dev proxy, Vitest config)
frontend/tsconfig.node.json TS config for node-side files (Vite config)
frontend/tsconfig.json TS project references root
frontend/tsconfig.app.json TS config for the app (paths, strictness)
frontend/tailwind.config.ts Tailwind theme + typography plugin
frontend/src/vite-env.d.ts Vite client typings reference
frontend/src/test/setup.ts Vitest setup for jest-dom matchers
frontend/src/main.tsx React entrypoint mounting <App />
frontend/src/index.css Tailwind layers + base CSS variables/theme
frontend/src/App.tsx Minimal App scaffold UI
frontend/src/App.test.tsx Basic component smoke test
frontend/postcss.config.js PostCSS config (tailwindcss + autoprefixer)
frontend/package.json Frontend scripts/deps/devDeps
frontend/index.html Vite HTML entry
frontend/eslint.config.js ESLint flat config for TS/React
frontend/.prettierrc Prettier config (+ tailwind plugin)
frontend/.prettierignore Prettier ignore list
frontend/.gitignore Frontend-specific ignores
docs/conventions.md Development conventions (branches, API, migrations, security, style, testing)
docs/contributing.md Contributor onboarding + local run/check instructions
docs/architecture.md High-level architecture and directory layout
docker/nginx.conf Nginx SPA fallback + /api/ reverse proxy
docker/Dockerfile.frontend Frontend build image + nginx runtime image
docker/Dockerfile.backend Backend python image build/run
docker-compose.yml Compose stack for db/api/web (+ optional oracle)
backend/tests/test_health.py Health endpoint smoke test
backend/tests/init.py Test package marker
backend/requirements.txt Backend pinned dependencies
backend/pyproject.toml Ruff/mypy/pytest/coverage config
backend/app/main.py FastAPI app + CORS + health route
backend/app/config.py Pydantic Settings v2 configuration
backend/app/init.py App package marker
backend/.gitignore Backend-specific ignores
backend/.env.example Backend env example file
README.md Project README (quickstart, links)
Makefile Local setup/check/dev/docker convenience targets
.gitignore Root ignores (env, python, node, IDE, etc.)
.github/workflows/frontend.yml Frontend CI (lint/format/test/build)
.github/workflows/docker.yml Docker image build validation
.github/workflows/backend.yml Backend CI (ruff/mypy/pytest with postgres service)
.env.example Root env example (JWT secret, oracle password)

Comment thread backend/app/config.py
Comment thread docker-compose.yml Outdated
Comment thread frontend/vite.config.ts
Comment thread frontend/tsconfig.app.json
Comment thread frontend/tsconfig.node.json
Comment thread docker-compose.yml
Comment on lines +39 to +44
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/api/v1/admin/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API container healthcheck runs curl, but docker/Dockerfile.backend doesn’t install curl (python:3.12-slim images don’t include it by default). This will cause the api service to stay unhealthy and block web startup via depends_on. Install curl in the backend image or change the healthcheck to use a tool that’s already present (e.g., python -c ... or wget if installed).

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

badry-dev and others added 2 commits March 4, 2026 19:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…t config

vite.config.ts — __dirname undefined in ESM:
- Replace path.resolve(__dirname, ...) with fileURLToPath(new URL(...))
  which is the correct ESM equivalent; drop path import

tsc -b / composite mode:
- Add "composite": true to tsconfig.app.json and tsconfig.node.json so
  tsc --build mode can track project references correctly
- Add "types": ["node"] to tsconfig.node.json so the url module resolves
- Add "types": ["vitest/globals"] to tsconfig.app.json so describe/it/expect
  resolve in test files without importing them explicitly

vitest/config type conflict:
- Importing defineConfig from vitest/config caused a plugin type mismatch
  because vitest bundles its own vite version; fix by separating configs:
  vite.config.ts — pure Vite config (no test block)
  vitest.config.ts — new file, merges vite config with vitest test settings
- Update test/test:watch scripts to pass --config vitest.config.ts
- Add @types/node ^22 as devDependency (needed for url module in node tsconfig)

docker/Dockerfile.backend — curl missing for healthcheck:
- Add curl to the apt-get install block; python:3.12-slim does not include
  it, causing the docker-compose api service healthcheck to always fail and
  blocking the web service from starting

https://claude.ai/code/session_01CREZQfgG9HeXtcS4AvUKv4

@badry-dev badry-dev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issues fixed

Copilot AI commented Mar 4, 2026

Copy link
Copy Markdown

@Badry-Kudu I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits March 4, 2026 19:56
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
README + docs:
- Rewrite README.md (had wide-char encoding corruption)
- Add docs/progress.md tracking Phase 0 completion and Phase 1 status

App structure:
- app/logging_config.py: structlog JSON renderer, contextvars integration
- app/database.py: SQLAlchemy 2.0 async engine + session factory (asyncpg)
- app/dependencies.py: get_db async generator for FastAPI DI
- app/middleware.py: RequestLoggingMiddleware — per-request UUID, structured
  access log, X-Request-ID propagation
- app/exceptions.py: http / validation / unhandled exception handlers with
  structured log and safe 5xx body
- app/main.py: full app factory with lifespan, CORS, middleware stack,
  exception handlers, router mounts

SQLAlchemy 2.0 models (8 domain tables):
- OracleConnection (connections) — Oracle pool config + encrypted credential
- AuthMethod (auth_methods) — bearer / basic / api_key auth configs
- ApiEndpoint (endpoints) — SQL-to-URL binding with bind-param schema
- Schedule (schedules) — cron/interval snapshot refresh configs
- JobRun (job_runs) — immutable scheduler execution audit records
- Snapshot (snapshots) — JSONB cached query results
- AccessLog (access_logs) — per-request audit trail (no FK for durability)
- AppSetting (app_settings) — key-value runtime settings store

Alembic:
- alembic.ini: URL set dynamically from Pydantic Settings (no secrets in repo)
- alembic/env.py: asyncio runner compatible with asyncpg dialect
- alembic/script.py.mako: Python 3.12 mako template with StrEnum-safe types
- alembic/versions/0001_initial_schema.py: creates all 8 tables + 5 PG enums;
  fully reversible downgrade path

Health endpoints:
- GET /api/v1/admin/health/live — liveness probe (no DB)
- GET /api/v1/admin/health/ready — readiness probe (SELECT 1 on Postgres)

Tests:
- tests/conftest.py: session-scoped engine, per-test rollback, http_client
  (DB-free) and async_client (DB-backed) fixtures
- tests/test_health.py: liveness (no DB, 3 tests), readiness (@integration, 2)
- tests/test_models.py: table names, enum coverage, instantiation (12 tests)
- pyproject.toml: add integration marker, B008 per-file ignore for routers

Checks: ruff OK, mypy --strict OK, 15 tests pass locally (integration tests
run against live Postgres in CI), 90% coverage

https://claude.ai/code/session_01CREZQfgG9HeXtcS4AvUKv4
Resolves add/add conflicts where main merged an earlier Phase 0 version
(PR #3) while this branch contains the same files with all CI fixes,
ESM/Docker/tsc corrections, and the full Phase 1 backend foundation.
Kept our versions throughout.

https://claude.ai/code/session_01CREZQfgG9HeXtcS4AvUKv4
@badry-dev
badry-dev merged commit 897444b into main Mar 4, 2026
0 of 3 checks passed
@badry-dev
badry-dev deleted the claude/setup-repo-scaffolding-cicd-1txix branch March 4, 2026 17:51
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.

4 participants