|
1 | | -# diff-risk-dashboard |
| 1 | +# 🛡️ Diff Risk Dashboard — APV JSON → Summary (CLI & Markdown) |
2 | 2 |
|
3 | | -Visual dashboard for Pull Request risk exposure, designed to consume **ai-patch-verifier** JSON outputs. |
| 3 | +Un **CLI** mínimo y profesional para resumir salidas de **ai-patch-verifier (APV)**: |
| 4 | +cuenta findings por severidad, calcula el **worst**, expone un **nivel de riesgo** y puede renderizar **Markdown** listo para pegar en PRs. |
| 5 | + |
| 6 | +<div align="center"> |
| 7 | + |
| 8 | +[](https://github.com/CoderDeltaLAN/diff-risk-dashboard/actions/workflows/build.yml) |
| 9 | +[](https://github.com/CoderDeltaLAN/diff-risk-dashboard/actions/workflows/codeql.yml) |
| 10 | +[](https://github.com/CoderDeltaLAN/diff-risk-dashboard/releases) |
| 11 | + |
| 12 | +[](LICENSE) |
| 13 | +[](https://www.paypal.com/donate/?hosted_button_id=YVENCBNCZWVPW) |
| 14 | + |
| 15 | +</div> |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## ✨ ¿Qué hace? |
| 20 | + |
| 21 | +- Lee APV JSON (`predicted_risk` o `severity`), cuenta por severidad y **detecta el peor**. |
| 22 | +- Devuelve **tabla**, **JSON** o **Markdown** (`--format {table,json,md}`). |
| 23 | +- **Exit code** configurable por riesgo (gateo para CI). |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## 🚀 Instalación / Uso |
| 28 | + |
| 29 | +### A) Dev local |
4 | 30 |
|
5 | | -## Quick Start |
6 | 31 | ```bash |
7 | | -poetry install |
8 | | -poetry run drd summarize examples/sample_apv.json |
| 32 | +python -m pip install --upgrade pip |
| 33 | +pip install -e . |
| 34 | +``` |
| 35 | + |
| 36 | +### B) Usuario final (pipx) |
| 37 | + |
| 38 | +```bash |
| 39 | +pipx install git+https://github.com/CoderDeltaLAN/diff-risk-dashboard@main |
| 40 | +``` |
| 41 | + |
| 42 | +> Binarios expuestos: **`diff-risk`** (CLI) y **`diff-risk-web`** (visor web opcional). |
| 43 | +
|
| 44 | +--- |
| 45 | + |
| 46 | +## 🧰 CLI |
| 47 | + |
| 48 | +```bash |
| 49 | +# Ayuda |
| 50 | +diff-risk -h |
| 51 | + |
| 52 | +# JSON |
| 53 | +diff-risk examples/sample_apv.json --format json --no-exit-by-risk |
| 54 | + |
| 55 | +# Markdown a archivo |
| 56 | +diff-risk examples/sample_apv.json --format md -o report.md --no-exit-by-risk |
| 57 | + |
| 58 | +# Tabla (por defecto) + exit code por riesgo |
| 59 | +diff-risk examples/sample_apv.json |
| 60 | +``` |
| 61 | + |
| 62 | +Salida Markdown típica: |
| 63 | + |
| 64 | +```md |
| 65 | +# Diff Risk Dashboard 🔴 — Worst: **HIGH** |
| 66 | + |
| 67 | +| Severity | Count | |
| 68 | +|---|---:| |
| 69 | +| CRITICAL | 0 | |
| 70 | +| HIGH | 1 | |
| 71 | +| MEDIUM | 1 | |
| 72 | +| LOW | 1 | |
| 73 | +| INFO | 0 | |
| 74 | +| **TOTAL** | **3** | |
| 75 | + |
| 76 | +> Generated by diff-risk-dashboard CLI |
9 | 77 | ``` |
10 | 78 |
|
11 | | -## Run checks (mirrors CI) |
| 79 | +--- |
| 80 | + |
| 81 | +## 🌐 Visor web opcional |
| 82 | + |
12 | 83 | ```bash |
13 | | -poetry run ruff check . |
14 | | -poetry run black --check . |
15 | | -PYTHONPATH=src poetry run pytest -q |
16 | | -poetry run mypy src |
| 84 | +python -m pip install "fastapi>=0.110" "uvicorn[standard]>=0.27" |
| 85 | +diff-risk-web # abre http://127.0.0.1:8000 |
17 | 86 | ``` |
18 | 87 |
|
19 | | -## License |
20 | | -MIT |
| 88 | +--- |
| 89 | + |
| 90 | +## 🗂️ Estructura |
| 91 | + |
| 92 | +```text |
| 93 | +. |
| 94 | +├── examples/ # JSON de ejemplo |
| 95 | +├── src/diff_risk_dashboard/ # core, cli, report, web |
| 96 | +├── tests/ # pytest |
| 97 | +└── .github/workflows/ # build.yml, codeql.yml, release-publish.yml, etc. |
| 98 | +``` |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## 🔄 CI/CD |
| 103 | + |
| 104 | +- **Build** (3.11/3.12): ruff, black --check, pytest, mypy. |
| 105 | +- **CodeQL** en PRs y `main`. |
| 106 | +- **Release Drafter** + workflow `release (publish)` para publicar tags con notas. |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## 🗺️ Roadmap (corto) |
| 111 | + |
| 112 | +- **v0.2.x**: Cron de publicación automática (Release Drafter). |
| 113 | +- **Gobernanza**: `SECURITY.md`, `CONTRIBUTING.md`, `CODEOWNERS`, templates de issues. |
| 114 | +- **Calidad**: cobertura en CI + `pre-commit` + agrupación de Dependabot. |
| 115 | + |
| 116 | +> Opcional: publicar en **PyPI/GHCR** y añadir badge. |
| 117 | +
|
| 118 | +--- |
| 119 | + |
| 120 | +## 🤝 Contribuir |
| 121 | + |
| 122 | +- PRs pequeños (Conventional Commits). |
| 123 | +- CI local verde antes de abrir PR. |
| 124 | +- Auto-merge cuando los checks pasan. |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## 🔐 Seguridad |
| 129 | + |
| 130 | +- Reportes via **GitHub Security Advisories** (no PoCs públicos). |
| 131 | +- Respuesta inicial en 72h. |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +## 💚 Donations & Sponsorship |
| 136 | + |
| 137 | +Si este proyecto te ahorra tiempo, considera apoyar su mantenimiento. ¡Gracias! |
| 138 | +[](https://www.paypal.com/donate/?hosted_button_id=YVENCBNCZWVPW) |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## 📈 SEO |
| 143 | + |
| 144 | +diff risk dashboard, apv json, ai-patch-verifier summary, security risk gate, |
| 145 | +python cli for risk, markdown status report, codeql github actions, always green ci, |
| 146 | +ruff black pytest mypy, branch protection required checks, squash merge linear history |
| 147 | + |
| 148 | +--- |
| 149 | + |
| 150 | +## 📄 Licencia |
| 151 | + |
| 152 | +**MIT**. Ver [LICENSE](LICENSE). |
0 commit comments