This directory contains the first implementation slice for the CI dashboard V1 project.
Current scope in this scaffold:
- SQL migrations for the three V1-owned tables
- shared Python config and database helpers
- job state persistence helpers
- build URL normalization and exact retest parsing helpers
- implemented data jobs:
ci-sync-buildsci-sync-pr-eventsci-sync-flaky-issues
sync-flaky-issues may call the GitHub API to recover branch metadata for flaky issues when the read-only github_tickets source omits the issue body or branch details. In Kubernetes, inject a GITHUB_TOKEN runtime secret for that job.
ci-refresh-build-derivedbackfill-rangefor idempotent date-window re-imports- one-off Kubernetes backfill helpers under
k8s/backfill/ - recurring flaky issue sync helper under
k8s/cronjobs/ - implemented read-only FastAPI query endpoints for:
/api/v1/status/freshness/api/v1/filters/*/api/v1/builds/*/api/v1/flaky/trend/api/v1/flaky/composition/api/v1/flaky/distinct-case-counts/api/v1/flaky/issue-weekly-rates/api/v1/flaky/top-jobs/api/v1/flaky/period-comparison/api/v1/failures/*
- first React dashboard shell under
web/, including:OverviewBuild TrendFlaky
- project docs under
docs/, includingfunctional-design/
Not implemented yet:
- deeper build/failure drill-down pages and richer table views
- infra / Jenkins specific pages
This scaffold supports local unit tests with sqlite and does not require a remote TiDB instance.
Recommended local setup:
cd ci-dashboard
python3 -m venv .venv
./.venv/bin/pip install fastapi uvicorn SQLAlchemy PyMySQL pytest pytest-cov ruff coverage httpx
PYTHONPATH=src ./.venv/bin/python -m pytest --cov=src/ci_dashboard --cov-report=term-missing
make sync-builds
make sync-pr-events
make sync-flaky-issues
make refresh-build-derived
./.venv/bin/python -m ci_dashboard.jobs.cli backfill-range --start-date 2025-12-01 --end-date 2025-12-07
make api
make web-install
make web-dev
make web-buildNotes:
- tests use sqlite fixtures and run locally
- production-style DB config still uses
TIDB_* - local development can use
CI_DASHBOARD_DB_URL=sqlite+pysqlite:///./ci-dashboard.sqlite - FastAPI serves the built frontend from
web/distaftermake web-build - set
CI_DASHBOARD_STATIC_DIRwhen the built frontend lives outside the default repo or container layout - the Cost and CI details insight tabs are always available
- during UI iteration, run
make apiandmake web-devin separate terminals backfill-rangeis stateless and does not updateci_job_state, so the same time window can be re-imported safelyCI_DASHBOARD_REFRESH_BUILD_LIMITcontrols how many impacted builds onerefresh-build-derivedrun will process before checkpointing and continuing in the next CronJob run; the default is5000, valid values are positive integers, and smaller values trade shorter/faster runs for more CronJob passes before backlog catch-up finishesscripts/render_backfill_job.shrenders a one-off Kubernetes Job manifest for GKE backfill runsscripts/render_flaky_issue_sync_cronjob.shrenders a recurring Kubernetes CronJob manifest for daily flaky issue syncscripts/render_jenkins_worker_deployment.shrenders the V3 Jenkins event worker Deployment manifestscripts/render_archive_error_logs_cronjob.shrenders the V3 Jenkins error-log archive CronJob manifest- Jenkins finished events asynchronously enrich the canonical build row from the
Jenkins
/timings/page. This fetch is best-effort and does not block Kafka offset commits. backfill-jenkins-timings --lookback-days 30provides a one-off historical repair command; it is intentionally not deployed as a recurring CronJob.
For local UI iteration with real TiDB data:
cd ci-dashboard
make prepare-local-tidb-env
make PYTHON=./.venv/bin/python api-tidbIn a second terminal:
cd ci-dashboard
make web-install
make web-devNotes:
make prepare-local-tidb-envreads the current Kubernetes secrets:apps/ci-dashboard-eq-prd-insight-dbapps/ci-dashboard-backfill-caas CA fallback when the DB secret exposes a container-onlyTIDB_SSL_CApath
- it writes local-only files under
ci-dashboard/.local/ - Vite proxies
/api/*tohttp://127.0.0.1:8000, so the browser still talks only to the local dev server - you can verify the chain with:
curl http://127.0.0.1:8000/api/v1/status/freshnesscurl http://127.0.0.1:5173/api/v1/status/freshness
This project now provides two container entrypoints:
Dockerfile.appfor the FastAPI + React dashboard appDockerfile.jobsfor CLI-driven sync and backfill jobs
Recommended image repositories:
ghcr.io/pingcap-qe/ee-apps/ci-dashboardghcr.io/pingcap-qe/ee-apps/ci-dashboard-jobs
Repository-local image build wiring is defined in skaffold.yaml:
cd ci-dashboard
skaffold build --push=false --default-repo ghcr.io/pingcap-qe/ee-appsNotes:
Dockerfile.appbuilds the frontend with production base path/dashboard/Dockerfile.jobsnow installs directly from source and no longer depends on a prebuilt wheel indist/- local-only files under
.local/are excluded from the Docker build context and are not baked into images