Files
mopac-pmo/logs/q-redmine-cli.log
T

7 lines
3.7 KiB
Plaintext

I have full context: sibling pattern (mopac-bitwarden-go), harness fake-server test style, PMO python glue to replace, creds at `~/.creds/redmine.env`, Redmine at projects.knownelement.com. Setting up the work plan.Toolchain verified. Creating the repo via Gitea API (idempotent check first):Repo created. Cloning and seeding with LICENSE:Harness done. Now TDD config package — tests first (red):Red confirmed. Implementation:Green. Two atomic commits:Now the core piece. First the stateful fake Redmine server (test infrastructure, harness-style):Now the library test suite (red first):Red confirmed (library absent). Fixing fake's query type, then writing the library:All three failures are test-side: fake returns issues in map order, `*` is URL-encoded, and one assertion is inverted. Fixing:Now sort fake issue listings for determinism:All green. Committing the library:Library committed. Now the CLI — tests first:Red. Implementing the CLI:Fixing the update-path project resolution (numeric project id, no MOPAC hardcode, single fetch):Now the main entrypoint and run tests:Only relation failed — but flag stops at positionals, so update should have tripped too. Investigating before patching:All four failures share one root cause: flags after positionals. Checking the list-test detail first:Confirmed. Adding a loose arg parser that accepts flags anywhere (task surface requires `update ID --note`, `relation create FROM TO --type`):Now switch all subcommands to `parseArgs`:Guarding the lone `-` (stdin convention) against an infinite loop in parseArgs:Found it: the fake's issue list returns stored write-shape issues instead of the read projection. Fixing:My projection edits never landed (stale content mismatch). Applying against current text:All green. Committing CLI:Smoke pattern clear. Adding a fixed-address listener to the fake, the smoke server main, and the smoke script:Three fixes before running: hoist leading `--config` in Run, clean the readiness probe, and extract ID2 by subject:Smoke failed at issue create. Reproducing manually to see the error:Fake is up (transient reset). Retrying the failing steps manually:Found it: the smoke's create command is missing `-o json`, so the `"id":` grep fails silently. Fixing:Smoke fully green. Committing, then README per docs standard:Verifying Redmine 506 reference (read-only) before committing:506 confirmed as this task. Adding env.example, final check, push:All pushed. Now the PMO report with exact replacement mappings:Verifying the report's cutover commands live (read-only): sed transform + real `issue list`:Live read verified against the real tracker (issues 522/521/519, exit 0). Updating docs to record it:Delivered and pushed (8 commits, `ukrrs/mopac-redmine-go` @ `788f6fe`):
- **Library + CLI**: `redmine.Client` (issues/notes-journals, versions, categories, relations, name→id resolution) and `mred` with the full specced surface, `-o json`, flags-after-positionals, exit 0/1/2 with one-line `http NNN` stderr.
- **Tests**: 62 unit tests green (round-trips, filters, error mapping, key-redaction — the fake echoes the key in error bodies to prove nothing leaks) + end-to-end smoke `OK` against the containerized fake; all builds via the digest-pinned Docker builder.
- **Live-verified read-only**: `mred issue list -p MOPAC` against projects.knownelement.com returned 522/521/519, exit 0, zero code change. Live writes left to PMO acceptance.
- **Report**: `~/.coordinate/inbox-pmo/REPORT-20260829-1400-redmine-cli.md` — command surface, test results, and row-per-operation python→mred mappings for all four glue scripts, plus the one-time setup block and cutover checklist (#506 closes via `mred issue update 506 --status done --done-ratio 100 --note ...`).