|
| 1 | +# Lab 3 — Continuous Integration (CI/CD): Implementation Report |
| 2 | + |
| 3 | +**Student:** Danil Fishchenko |
| 4 | +**Date:** January 31, 2026 |
| 5 | +**App:** DevOps Info Service (Flask) |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 1. Overview |
| 10 | + |
| 11 | +- **Testing framework:** pytest — concise syntax, strong fixtures ecosystem, widely used for Flask apps. |
| 12 | +- **Coverage:** Tests validate `GET /`, `GET /health`, and error responses (404, 405). |
| 13 | +- **Workflow triggers:** Runs on push to `master` and `lab03`, and on PRs to `master`, only when `app_python/**` or workflow file changes. |
| 14 | +- **Versioning strategy:** **CalVer** (`YYYY.MM.DD`) for Docker tags — simple and time-based for a continuously deployed service. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 2. Workflow Evidence |
| 19 | + |
| 20 | +- ✅ **Successful workflow run:** TODO — add GitHub Actions run link after push. |
| 21 | +- ✅ **Tests passing locally (terminal output):** |
| 22 | + |
| 23 | +``` |
| 24 | +.... [100%] |
| 25 | +4 passed in 0.07s |
| 26 | +``` |
| 27 | + |
| 28 | +- ✅ **Local run + endpoint checks:** |
| 29 | + |
| 30 | +``` |
| 31 | +{"endpoints":[{"description":"Service and system information","method":"GET","path":"/"},{"description":"Health check endpoint","method":"GET","path":"/health"}],"request":{"client_ip":"127.0.0.1","me |
| 32 | +{"status":"healthy","timestamp":"2026-01-31T11:00:38.653301+00:00","uptime_seconds":1} |
| 33 | +``` |
| 34 | + |
| 35 | +- ✅ **Docker image on Docker Hub:** https://hub.docker.com/r/pepegx/devops-info-service |
| 36 | +- ✅ **Status badge in README:** Added to the top of the app README. |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +## 3. Best Practices Implemented |
| 41 | + |
| 42 | +- **Dependency caching:** `actions/setup-python` with pip cache speeds up repeated installs. |
| 43 | +- **Job dependencies:** Docker build/push runs only after tests pass (`needs: test`). |
| 44 | +- **Conditional publishing:** Docker push runs only on `master` or `lab03` branch pushes. |
| 45 | +- **Workflow concurrency:** Cancels outdated runs on the same branch. |
| 46 | +- **Path filters:** CI runs only when `app_python/` changes. |
| 47 | +- **Snyk scanning:** Optional dependency vulnerability scan with `SNYK_TOKEN` secret. |
| 48 | + |
| 49 | +**Caching speed improvement:** TODO — record cache hit/miss times from Actions. |
| 50 | + |
| 51 | +**Snyk results:** TODO — record findings or note “no issues found.” |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## 4. Key Decisions |
| 56 | + |
| 57 | +- **Versioning Strategy:** CalVer aligns with frequent service updates without manual SemVer management. |
| 58 | +- **Docker Tags:** `${VERSION}` (CalVer) and `latest` for stable consumers. |
| 59 | +- **Workflow Triggers:** Focused on `app_python/` to avoid unnecessary CI in a monorepo. |
| 60 | +- **Test Coverage:** Core endpoints and error cases tested; system-specific values are asserted by structure, not exact host values. |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## 5. Challenges (Optional) |
| 65 | + |
| 66 | +- **None encountered** during local test setup. |
0 commit comments