feat: add SQL/SQLite, AppSec, Capstone incident-tracker, Gitea Actions CI and spaced repetition
Test and Lint / quality (push) Successful in 34s
Test and Lint / quality (push) Successful in 34s
This commit is contained in:
1 parent
0ac80d60d4
commit
9430a194c3
18 files changed
+422
-7
No files matched your search
@@ -0,0 +1,21 @@
|
||||
# Capstone Mini-Projekt: `incident-tracker` (CLI + SQLite + JSON logs)
|
||||
|
||||
Ten sam projekt SRE realizujesz w Pythonie, Go i Ruście, żeby porównać ergonomię i architekturę wszystkich trzech języków.
|
||||
|
||||
## Wymagania
|
||||
Zaimplementuj aplikację `incident-tracker` (`tracker.py`):
|
||||
1. **Model domenowy:** `Incident(id, title, severity, status)` gdzie `severity` ∈ `{"low", "medium", "high", "critical"}`, `status` ∈ `{"open", "resolved"}`.
|
||||
2. **Warstwa persystencji (`IncidentStore` na SQLite):**
|
||||
* `init_schema()` — idempotentne tworzenie tabeli `incidents`.
|
||||
* `add(title: str, severity: str) -> Incident` — walidacja niepustego tytułu i dozwolonego `severity`, zapis przez parametryzowane zapytanie.
|
||||
* `list_incidents(severity: str | None = None) -> list[Incident]` — opcjonalne filtrowanie.
|
||||
* `resolve(incident_id: int) -> Incident` — zmiana statusu na `"resolved"` (lub `IncidentNotFoundError`).
|
||||
* `stats() -> dict[str, int]` — zliczenie incydentów po `status` (`{"open": ..., "resolved": ...}`).
|
||||
3. **Warstwa CLI (`build_cli(db_path: Path)` w `typer`):**
|
||||
* Podkomendy: `add <title> --severity <sev>`, `list [--severity <sev>]`, `resolve <id>`, `stats`.
|
||||
* Wynik wypisywany jako czysty JSON na `stdout`.
|
||||
|
||||
## Uruchomienie testów
|
||||
```bash
|
||||
make test-project
|
||||
```
|
||||
Reference in new issue
Block a user