MIL-004: source code review and CI #29
@@ -0,0 +1,26 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checks:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.13"
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install -e ".[dev]"
|
||||||
|
- name: Tests
|
||||||
|
run: python -m pytest
|
||||||
|
- name: Lint
|
||||||
|
run: python -m ruff check src tests
|
||||||
|
- name: Format check
|
||||||
|
run: python -m ruff format --check src tests
|
||||||
|
- name: Types
|
||||||
|
run: python -m mypy src tests
|
||||||
@@ -79,6 +79,16 @@ python -m ruff format --check src tests
|
|||||||
python -m mypy src tests
|
python -m mypy src tests
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Continuous integration
|
||||||
|
|
||||||
|
On every push and pull request, `.gitea/workflows/ci.yml` installs the project on
|
||||||
|
Python 3.13 and runs the same checks as above: `pytest`, `ruff check`,
|
||||||
|
`ruff format --check` and `mypy`. To run all of them locally:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python -m pytest && python -m ruff check src tests && python -m ruff format --check src tests && python -m mypy src tests
|
||||||
|
```
|
||||||
|
|
||||||
## Build the source documentation
|
## Build the source documentation
|
||||||
|
|
||||||
The source uses Doxygen comments. The HTML output goes to `docs/doxygen/html`.
|
The source uses Doxygen comments. The HTML output goes to `docs/doxygen/html`.
|
||||||
@@ -96,6 +106,7 @@ doxygen Doxyfile
|
|||||||
| `docs/` | Planning and review documents (business case, plan, milestones) |
|
| `docs/` | Planning and review documents (business case, plan, milestones) |
|
||||||
| `pyproject.toml` | Project configuration |
|
| `pyproject.toml` | Project configuration |
|
||||||
| `Doxyfile` | Doxygen configuration |
|
| `Doxyfile` | Doxygen configuration |
|
||||||
|
| `.gitea/workflows/` | CI workflow |
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ document of a type. `Primary File` may contain a glob (e.g.
|
|||||||
| SA | Stakeholder Analysis | docs/stakeholder-analysis.md | 002 |
|
| SA | Stakeholder Analysis | docs/stakeholder-analysis.md | 002 |
|
||||||
| PP | Project Plan | docs/project-plan.md | 002 |
|
| PP | Project Plan | docs/project-plan.md | 002 |
|
||||||
| MIL | Milestone / Gateway | docs/milestones/*.md | 005 |
|
| MIL | Milestone / Gateway | docs/milestones/*.md | 005 |
|
||||||
| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 006 |
|
| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 008 |
|
||||||
| TM | Traceability Matrix | docs/sqa/traceability-matrix.md | 002 |
|
| TM | Traceability Matrix | docs/sqa/traceability-matrix.md | 002 |
|
||||||
|
|
||||||
## Languages
|
## Languages
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
## Version History
|
## Version History
|
||||||
| Date | Status | Author | Reviewer | Change | Commit |
|
| Date | Status | Author | Reviewer | Change | Commit |
|
||||||
| --- | --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- | --- |
|
||||||
| 2026-10-06 | Proposed | Jens Tirsvad Nielsen | S01 | Initial version | [8ef00aa] |
|
| 2026-10-06 | Accepted | Jens Tirsvad Nielsen | S01 | Initial version | [8ef00aa] |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ published project, within the short assignment timeline in [BC-001].
|
|||||||
| Project Setup | [MIL-001] | 2026-10-05 to 2026-10-07 | 2026-10-07 | S01 | none | Skeleton, tooling, README | [Milestone 40] |
|
| Project Setup | [MIL-001] | 2026-10-05 to 2026-10-07 | 2026-10-07 | S01 | none | Skeleton, tooling, README | [Milestone 40] |
|
||||||
| Coffee Machine Core | [MIL-002] | 2026-10-08 to 2026-10-10 | 2026-10-10 | S01 | none | Working program | [Milestone 41] |
|
| Coffee Machine Core | [MIL-002] | 2026-10-08 to 2026-10-10 | 2026-10-10 | S01 | none | Working program | [Milestone 41] |
|
||||||
| Quality and Publication | [MIL-003] | 2026-10-11 to 2026-10-12 | 2026-10-12 | S01 | none | Tests, Doxygen, published repo | [Milestone 42] |
|
| Quality and Publication | [MIL-003] | 2026-10-11 to 2026-10-12 | 2026-10-12 | S01 | none | Tests, Doxygen, published repo | [Milestone 42] |
|
||||||
| Code Review and CI | [MIL-004] | 2026-10-07 to 2026-10-12 | 2026-10-12 | S01 | none | Source review record, CI workflow | |
|
| Code Review and CI | [MIL-004] | 2026-10-07 to 2026-10-12 | 2026-10-12 | S01 | none | Source review record, CI workflow | [Milestone 48] |
|
||||||
|
|
||||||
```plantuml
|
```plantuml
|
||||||
@startgantt
|
@startgantt
|
||||||
@@ -94,3 +94,4 @@ A No-Go moves all later dates by the same amount.
|
|||||||
[Milestone 42]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/milestone/42
|
[Milestone 42]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/milestone/42
|
||||||
[c0c3940]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/commit/c0c3940551db0d7d96492cc734976d0436051ff9
|
[c0c3940]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/commit/c0c3940551db0d7d96492cc734976d0436051ff9
|
||||||
[8ef00aa]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/commit/8ef00aafaaa193ea565f1a45238d31e963a5e05d
|
[8ef00aa]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/commit/8ef00aafaaa193ea565f1a45238d31e963a5e05d
|
||||||
|
[Milestone 48]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/milestone/48
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# RC-006 Source Code Review
|
||||||
|
|
||||||
|
## Metadata
|
||||||
|
| Key | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| ID | RC-006 |
|
||||||
|
| CrossReference | [MIL-004], [QC-PY-001] |
|
||||||
|
|
||||||
|
## Version History
|
||||||
|
| Date | Status | Author | Reviewer | Change | Commit |
|
||||||
|
| --- | --- | --- | --- | --- | --- |
|
||||||
|
| 2026-10-06 | Proposed | Jens Tirsvad Nielsen | S01 | Initial version | pending |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Artifact Under Review
|
||||||
|
|
||||||
|
- Instance reviewed: `src/coffee_machine/` and `tests/` at the state of MIL-003 (`main` after PR 22)
|
||||||
|
- Checklist used: [QC-PY-001] (`QC-PY-001`)
|
||||||
|
- Independence: S01 is the only stakeholder and is also the recorded author, so the reviewer-is-not-author rule cannot be met. The code and documents were written by Claude on S01's behalf; S01 reviews and signs. This is a known limit of a one-person project, not a clean independent review.
|
||||||
|
|
||||||
|
## Checklist Results
|
||||||
|
|
||||||
|
| # | Criterion | Status | Evidence/Notes |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 1 | Packages, modules, functions, variables, classes and constants follow PEP 8 casing (`snake_case`, `PascalCase`, `UPPER_SNAKE`) | Pass | Modules, functions and variables are `snake_case`, constants `UPPER_SNAKE`, `Drink` is `PascalCase`. |
|
||||||
|
| 2 | Names state purpose in the domain's language; no unexplained abbreviations, no single-letter names outside tiny scopes | Pass | Names state purpose (`is_resource_sufficient`, `process_coins`); the only short names are loop variables. |
|
||||||
|
| 3 | Code is produced by the project's formatter and passes its linter with no unexplained suppressions | Pass | `ruff check` and `ruff format --check` pass; no suppression comments. |
|
||||||
|
| 4 | Every function and method signature is type-annotated, including `-> None` | Pass | Every function, including tests and the nested `feed`, is annotated. |
|
||||||
|
| 5 | No bare `except:`, no swallowed exceptions; specific exceptions are raised and the cause is kept (`raise ... from`) | Pass | No bare `except`. `_ask_coin_count` catches only `ValueError` and answers it by asking again, so nothing is swallowed. |
|
||||||
|
| 6 | No mutable default arguments and no shadowed builtins | Pass | No mutable defaults; no builtin is shadowed. |
|
||||||
|
| 7 | Files, locks and connections are managed with context managers | N-A | The program opens no files, locks or connections. |
|
||||||
|
| 8 | Public modules, classes and functions have docstrings that say what, not how | Pass | All modules, public functions and tests have Doxygen docstrings that say what the code does. |
|
||||||
|
| 9 | Logging uses `logging`, not `print`; no secrets or personal data in log output | N-A | No logging exists. `print` is the program's own console output, not diagnostics. |
|
||||||
|
| 10 | Classes and operations trace to the Design Class Diagram they implement; deviations are recorded | N-A | No Design Class Diagram exists; the plan treats the work as plain technical tasks. |
|
||||||
|
| 11 | Tests exist for new behaviour, are named for the behaviour, and do not depend on order or the network | Pass | 19 tests named for behaviour, independent of order, no network. |
|
||||||
|
| 12 | Type checker runs in strict mode without errors; `Any` is justified in a comment | Pass | `mypy --strict` runs clean and `Any` is not used. |
|
||||||
|
| 13 | Dependencies are declared and pinned in the project's dependency file, none unused | Fail | Runtime dependencies: none. The dev tools had no lower bounds for ruff and mypy; fixed by action item 1, which sets `pytest>=9`, `ruff>=0.16`, `mypy>=2.4` (the tested versions). |
|
||||||
|
|
||||||
|
## Overall Verdict
|
||||||
|
|
||||||
|
Go — every mandatory criterion passes or is N-A. The one Fail (13) is optional and is fixed in the same change by issue #25.
|
||||||
|
|
||||||
|
## Action Items
|
||||||
|
|
||||||
|
| Action | Owner | Due |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Set lower bounds for the dev dependencies in pyproject.toml (done) | S01 | 2026-10-06 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[MIL-004]: ../../milestones/mil-004-code-review-and-ci.md
|
||||||
|
[QC-PY-001]: ../../../framework/qc/qc-programming-python.md
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# RC-007 MIL-004 Review
|
||||||
|
|
||||||
|
## Metadata
|
||||||
|
| Key | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| ID | RC-007 |
|
||||||
|
| CrossReference | [MIL-004], [QC-MIL-001] |
|
||||||
|
|
||||||
|
## Version History
|
||||||
|
| Date | Status | Author | Reviewer | Change | Commit |
|
||||||
|
| --- | --- | --- | --- | --- | --- |
|
||||||
|
| 2026-10-06 | Proposed | Jens Tirsvad Nielsen | S01 | Initial version | pending |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Artifact Under Review
|
||||||
|
|
||||||
|
- Instance reviewed: [MIL-004] (docs/milestones/mil-004-code-review-and-ci.md)
|
||||||
|
- Checklist used: [QC-MIL-001] (`QC-MIL-001`)
|
||||||
|
- Independence: S01 is the only stakeholder and is also the recorded author, so the reviewer-is-not-author rule cannot be met. The code and documents were written by Claude on S01's behalf; S01 reviews and signs. This is a known limit of a one-person project, not a clean independent review.
|
||||||
|
|
||||||
|
## Checklist Results
|
||||||
|
|
||||||
|
| # | Criterion | Status | Evidence/Notes |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 1 | A concrete deliverable is defined for every gate | Pass | Deliverable names the RC record, the fixes, the CI workflow and the README section. |
|
||||||
|
| 2 | Explicit Go/No-Go criteria are stated for each gate | Pass | Five Go/No-Go rows, each checkable (a record exists, a workflow runs four commands, a run is green). |
|
||||||
|
| 3 | Dependencies on other milestones are explicitly mapped | Pass | Depends on MIL-003 with a reason. |
|
||||||
|
| 4 | Each milestone is traceable to a Business Case objective or KPI | Pass | Traceability cites Business Case objective 6 and 4. |
|
||||||
|
| 5 | Milestone owner and approving reviewer are identified | Pass | Owner and approving reviewer are S01 (same person; see independence note). |
|
||||||
|
| 6 | Milestone has a defined target date consistent with project constraints | Pass | Target date 2026-10-12 lies inside the duration constraint in the Business Case. |
|
||||||
|
|
||||||
|
## Overall Verdict
|
||||||
|
|
||||||
|
Go — all criteria pass.
|
||||||
|
|
||||||
|
## Action Items
|
||||||
|
|
||||||
|
| Action | Owner | Due |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| None | S01 | - |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[MIL-004]: ../../milestones/mil-004-code-review-and-ci.md
|
||||||
|
[QC-MIL-001]: ../../../framework/qc/qc-milestones-gateways.md
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
## Version History
|
## Version History
|
||||||
| Date | Status | Author | Reviewer | Change | Commit |
|
| Date | Status | Author | Reviewer | Change | Commit |
|
||||||
| --- | --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- | --- |
|
||||||
| 2026-10-06 | Proposed | Jens Tirsvad Nielsen | S01 | Initial version | [8ef00aa] |
|
|
||||||
| 2026-10-06 | Proposed | Jens Tirsvad Nielsen | S01 | Added MIL-004 | [8ef00aa] |
|
| 2026-10-06 | Proposed | Jens Tirsvad Nielsen | S01 | Added MIL-004 | [8ef00aa] |
|
||||||
|
| 2026-10-06 | Proposed | Jens Tirsvad Nielsen | S01 | Added RC-006, RC-007 and the source code row | pending |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -30,13 +30,14 @@ artifact instance is created or reviewed.
|
|||||||
| [MIL-001] | Milestone | [BC-001], [PP-001] | - | [RC-003] |
|
| [MIL-001] | Milestone | [BC-001], [PP-001] | - | [RC-003] |
|
||||||
| [MIL-002] | Milestone | [BC-001], [PP-001] | - | [RC-004] |
|
| [MIL-002] | Milestone | [BC-001], [PP-001] | - | [RC-004] |
|
||||||
| [MIL-003] | Milestone | [BC-001], [PP-001] | - | [RC-005] |
|
| [MIL-003] | Milestone | [BC-001], [PP-001] | - | [RC-005] |
|
||||||
| [MIL-004] | Milestone | [BC-001], [PP-001] | - | - |
|
| [MIL-004] | Milestone | [BC-001], [PP-001] | - | [RC-007] |
|
||||||
|
| Source code (`src/`, `tests/`) | Source code | [MIL-002], [MIL-003], [MIL-004] | - | [RC-006] |
|
||||||
|
|
||||||
## Coverage Notes
|
## Coverage Notes
|
||||||
|
|
||||||
- `-` in Upstream means foundational; in Downstream, nothing is built on it yet; in Last Reviewed, no `RC-*` exists yet.
|
- `-` in Upstream means foundational; in Downstream, nothing is built on it yet; in Last Reviewed, no `RC-*` exists yet.
|
||||||
- [PP-001] has no QC checklist in the framework, so it has no `RC-*`.
|
- [PP-001] has no QC checklist in the framework, so it has no `RC-*`.
|
||||||
- No use case, domain model, design or data artifacts exist; the plan treats all tasks as plain technical tasks. The source code is covered by the tests, not by an `RC-*`.
|
- No use case, domain model, design or data artifacts exist; the plan treats all tasks as plain technical tasks. The source code is reviewed in [RC-006].
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -52,4 +53,6 @@ artifact instance is created or reviewed.
|
|||||||
[RC-003]: ./reviews/rc-003-mil-001.md
|
[RC-003]: ./reviews/rc-003-mil-001.md
|
||||||
[RC-004]: ./reviews/rc-004-mil-002.md
|
[RC-004]: ./reviews/rc-004-mil-002.md
|
||||||
[RC-005]: ./reviews/rc-005-mil-003.md
|
[RC-005]: ./reviews/rc-005-mil-003.md
|
||||||
|
[RC-006]: ./reviews/rc-006-source-code.md
|
||||||
|
[RC-007]: ./reviews/rc-007-mil-004.md
|
||||||
[8ef00aa]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/commit/8ef00aafaaa193ea565f1a45238d31e963a5e05d
|
[8ef00aa]: https://git.tirsystem.com/Tirsvad-Udemy-100_days_of_code/015-coffee_machine/commit/8ef00aafaaa193ea565f1a45238d31e963a5e05d
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ license = { file = "LICENSE" }
|
|||||||
dependencies = []
|
dependencies = []
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
dev = ["pytest>=8", "ruff", "mypy"]
|
dev = ["pytest>=9", "ruff>=0.16", "mypy>=2.4"]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
coffee-machine = "coffee_machine.main:main"
|
coffee-machine = "coffee_machine.main:main"
|
||||||
|
|||||||
Reference in New Issue
Block a user