tiketit ja featuret vaihe 1
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
# Ticket 0005: `report-service/` — indeksigenerointi
|
||||
|
||||
**Vaihe:** 5/12
|
||||
**Status:** pending
|
||||
**Feature branch:** `feature/0005-report-service-index-generation`
|
||||
**TDD required:** Yes
|
||||
**Feature file required:** Yes
|
||||
|
||||
**Required context:**
|
||||
- `docs/test-plan/tdd-guide.md`
|
||||
- `tests/features/0005-report-index.feature`
|
||||
- Skills: `tdd`, `implementation`, `clean-code`, `bash-script`
|
||||
|
||||
---
|
||||
|
||||
## TDD — Red-Green-Refactor
|
||||
|
||||
### Red
|
||||
Kirjoita `tests/generate-index.bats`:
|
||||
- Projektin indeksi: `generate-index.sh temperature-store abc12345 "2024-06-08 14:30" "master" "success"` → HTML sisältää rivin `abc12345`
|
||||
- Buildin indeksi: sisältää linkit raportteihin + "Back to builds"
|
||||
- Useampi build: uusin ensin listassa
|
||||
- Status: `success` → ✅, `failure` → ❌
|
||||
- Tyhjä status → ei generoida riviä
|
||||
|
||||
```bash
|
||||
bats tests/generate-index.bats
|
||||
# FAIL
|
||||
```
|
||||
|
||||
### Green
|
||||
`report-service/generate-index.sh` — staattinen HTML-generaattori.
|
||||
|
||||
```bash
|
||||
bats tests/generate-index.bats
|
||||
# PASS
|
||||
```
|
||||
|
||||
### Refactor
|
||||
Varmista HTML-valiidius, edge-caset (puuttuvat parametrit).
|
||||
|
||||
## DoD
|
||||
- [ ] Cucumber: `@ticket-0005 and @mock` → kaikki skenaariot GREEN
|
||||
- [ ] `tests/generate-index.bats` — kaikki testit läpi
|
||||
- [ ] Projektin indeksi lista buildit aikajärjestyksessä
|
||||
- [ ] Buildin indeksi lista raportit linkkeinä
|
||||
- [ ] "Back to builds" -navigaatio
|
||||
- [ ] Status-emoji ✅/❌
|
||||
|
||||
---
|
||||
|
||||
## Toiminto
|
||||
|
||||
Staattisten HTML-indeksisivujen generointi MinIO:hon. Kaksi tasoa:
|
||||
|
||||
1. **Projektin build-indeksi** (`/reports/{repo}/index.html`): lista buildeista aikajärjestyksessä
|
||||
2. **Buildin raportti-indeksi** (`/reports/{repo}/{commit_short}/index.html`): lista raporteista linkkeinä
|
||||
|
||||
## Build-indeksin sisältö
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{repo_slug} — Build Reports</title>
|
||||
<style>
|
||||
body { font-family: monospace; }
|
||||
.pass { color: green; }
|
||||
.fail { color: red; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{repo_slug}</h1>
|
||||
<ul>
|
||||
<li><span class="pass">✅</span> <a href="abc12345/index.html">abc12345</a> — 2024-06-08 14:30 — master</li>
|
||||
<li><span class="fail">❌</span> <a href="def67890/index.html">def67890</a> — 2024-06-07 10:15 — feature/xyz</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## Raportti-indeksin sisältö
|
||||
|
||||
```html
|
||||
<a href="../index.html">← Back to builds</a>
|
||||
<h2>Build abc12345</h2>
|
||||
<ul>
|
||||
<li><a href="cucumber/overview-features.html">Cucumber Reports</a></li>
|
||||
<li><a href="jacoco/index.html">JaCoCo Coverage</a></li>
|
||||
<li><a href="site/index.html">Maven Site</a></li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
## Sijainti
|
||||
|
||||
- `report-service/generate-index.sh` — generoi tai päivittää indeksit
|
||||
- Kutsutaan `push-reports.sh`:sta (Ticket 0003)
|
||||
|
||||
## Verifiointi
|
||||
|
||||
```bash
|
||||
bash report-service/generate-index.sh temperature-store abc12345 "2024-06-08 14:30" "master" "success"
|
||||
```
|
||||
|
||||
→ `/reports/temperature-store/index.html` sisältää rivin `abc12345`
|
||||
→ `/reports/temperature-store/abc12345/index.html` validi HTML
|
||||
|
||||
## Viitteet
|
||||
|
||||
- `docs/report-hosting.md` — Indeksisivujen määrittely
|
||||
- `docs/requirements.md` — UC3: Kehittäjä selaa projektin build-historiaa
|
||||
Reference in New Issue
Block a user