feat: clear the post-sweep TODO residue #32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/todo-residue-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Three independent gaps from
TODO.mdshipped in one bundle. After this lands, the only remaining items are theyt updatechecksum sidecar (blocked on a CI-side.sha256publish) and the manual-test coverage notes.Custom-field
$typediscoveryupdate_stateandupdate_estimationnow try the commonStateIssueCustomField/PeriodIssueCustomFieldtypes first and, only on HTTP 400, fall back to a discovery round-trip againstGET /api/admin/projects/<id>/customFieldsand retry once with the project-specific$type(translated from<Kind>ProjectCustomFieldto<Kind>IssueCustomField). The happy path keeps its single POST. Discovery failure (non-admin token, missing field) preserves the original 400 so the user still sees the underlying error rather than a misleading "discovery failed".discover_issue_field_typeis also exposed for future callers (issue create,issue update) that want the same treatment. Three new wiremock tests cover retry-success, retry-skipped-on-200, and 400-bubbled-when-discovery-empty.--jsonparity for writesAdds
--jsontoissue set-state,issue set-estimation,issue comment,issue tag add/remove,issue link/unlink,issue sprint set,work add, andwork delete. Each emits a pretty-printed envelope withissue,action, the action-specific payload,dry_run, andok. The mutation still fires;--jsononly controls output formatting (verified by a new wiremock test forset-state). Combines cleanly with the existing--dry-runflag:--json --dry-runprints the envelope with"dry_run": trueand skips the API call.SecretStringwrap forcfg.tokenThe
Configstruct still derivesDebug(tracing, panics,dbg!), and the token field is now aSecretStringso accidental{:?}formatting printsSecret([REDACTED ...])instead of the actual token. Serde adapters preserve the on-disk YAML shape (plain string, unchanged file format). AConfig::token() -> &straccessor keeps callsites readable without forcing everyclient_from_cfghelper to importExposeSecret. Locked in by a Debug-redaction unit test.Test plan
cargo fmt --allcargo clippy --all-targets --all-features -- --deny warningscargo test --all-targets(193 passed)yt --json issue set-state ISSUE-1 Doneprints a valid JSON envelope on stdoutyt --dry-run --json issue comment ISSUE-1 "hi"prints"dry_run": trueand does not POSTMultiEnumIssueCustomField,yt issue set-state ISSUE-1 Donesucceeds (discovery kicks in after the initial 400) where it previously failedThree independent gaps from `TODO.md` shipped in one bundle. Custom-field `$type` discovery. `update_state` and `update_estimation` now try the common `StateIssueCustomField` / `PeriodIssueCustomField` types first and, only on HTTP 400, fall back to a discovery round-trip against `GET /api/admin/projects/<id>/customFields` and retry once with the project-specific `$type` (translated from `<Kind>ProjectCustomField` to `<Kind>IssueCustomField`). The happy path keeps its single POST. Discovery failure (non-admin token, missing field) preserves the original 400 so the user still sees the underlying error rather than a misleading "discovery failed". `discover_issue_field_type` is also exposed for future callers (`issue create`, `issue update`) that want the same treatment. Three new wiremock tests cover retry-success, retry-skipped-on-200, and 400-bubbled-when-discovery-empty. `--json` parity for writes. Adds `--json` to `issue set-state`, `issue set-estimation`, `issue comment`, `issue tag add/remove`, `issue link/unlink`, `issue sprint set`, `work add`, and `work delete`. Each emits a pretty-printed envelope with `issue`, `action`, the action-specific payload, `dry_run`, and `ok`. The mutation still fires; `--json` only controls output formatting (verified by a new wiremock test for `set-state`). Combines cleanly with the existing `--dry-run` flag: `--json --dry-run` prints the envelope with `"dry_run": true` and skips the API call. `SecretString` wrap for `cfg.token`. The Config struct still derives `Debug` (tracing, panics, `dbg!`), and the token field is now a `SecretString` so accidental `{:?}` formatting prints `Secret([REDACTED ...])` instead of the actual token. Serde adapters preserve the on-disk YAML shape (plain string, unchanged file format). A `Config::token() -> &str` accessor keeps callsites readable without forcing every `client_from_cfg` helper to import `ExposeSecret`. Locked in by a Debug-redaction unit test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>