Files
mopac-pmo/archive/REPORT-20260829-0830-mred-version-update.md
T

52 lines
3.3 KiB
Markdown

# REPORT — 20260829 08:30 — mred `version update` (Redmine 524 finish turn)
Repo: ukrrs/mopac-redmine-go, branch `main`, pushed `788f6fe..5abd352`.
Prior state: main@788f6fe clean, zero delivered from the study turn; this
turn implemented the full scope. All dev ran inside the digest-pinned
Docker builder (`./dev.sh`); TDD (tests red first, then implementation).
## Diff summary (3 atomic conventional commits, pushed to origin/main)
| Commit | Content |
|---|---|
| `26824c3` feat(redmine) | `Client.UpdateVersion` (PUT /versions/N.json — partial: only set fields serialized; the 204 empty body is never parsed, `out=nil` path) and `Client.GetVersion` (GET /versions/N.json, backs the `-o json` re-fetch). Fake Redmine gained the matching PUT/GET endpoints (partial apply, 204-with-empty-body, 404 on unknown id) plus a `Version(id)` assertion accessor. |
| `37118f0` feat(cli) | `mred version update ID [--status open|closed] [--due YYYY-MM-DD] [--name NAME]`. At least one flag required → exit 1 usage error otherwise; `--status` validated to open\|closed; only provided flags sent. Text mode prints `updated version #N`; `-o json` re-fetches and emits the stored version; exit codes 0/1/2 per house convention; help/usage text updated. |
| `5abd352` docs(readme) | Command-reference row, quickstart example, library-surface signatures (`GetVersion`/`UpdateVersion`), partial-update + 204 note, status-table line. |
## Verification
- `./dev.sh check` (build + vet + test, Docker): **green**, all packages.
- `./dev.sh smoke` (real CLI vs containerized fake, port 8601): **smoke: OK**
(existing surface unregressed; redaction pass clean).
- New tests, all table-driven against the existing fake:
- Library: `TestUpdateVersionPartial` (4 cases: status flip, due change,
name change, combined — each pins the exact PUT request body so
"only provided flags are sent" is asserted, plus untouched-attribute
survival; every case round-trips the 204-empty-body reply),
`TestGetVersion` (round-trip + 404→`ErrNotFound`),
`TestUpdateVersionMissing` (404 mapping with parseable `http 404`).
- CLI: `TestVersionUpdate` (8 cases: status flip, due change, name
change, combined flags with stored-state assertions, no-flags usage
error, bad-status usage error, non-numeric id usage error, unknown id
→ exit 2 with `http 404` on stderr) and `TestVersionUpdateJSONRefetches`
(json mode re-fetches and emits the updated version).
- Count: 22 passing test entries (4 top-level functions, 12 table
subtests). Full suite: 3 packages ok, 0 failures.
## Production read verification (read-only, after push)
Using the 0600 config derived from `~/.creds/redmine.env`
(`~/.config/mred/env`, per the documented bootstrap):
- `mred version list -p MOPAC`**exit 0**, all **5** versions present
(34 closed V1 Core due 2026-08-28; 35 open Beta due 2026-08-31;
36 open Production due 2026-09-01; 37 closed Phase 3 - Integrations
due 2026-09-07; 38 open Selfhost Alpha due 2026-08-29).
- `mred version list -p MOPAC -o json` → 5 ids, exit 0.
- **No mutation of production**: the only commands run against the live
tracker are `version list` reads (GET). `version update` was exercised
exclusively against the fake.
No journal/status writes were made to Redmine 524 — left Resolved for
PMO re-verification per protocol.