You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate all commands to typed SDK service methods (#91)
* Add SDK integration layer: client init, error mapping, and test infrastructure
Wire up fizzy-sdk as a dependency with SDK client initialization in root
PersistentPreRunE, typed error conversion (sdk_errors.go), normalizeAny()
for struct→map round-trips, and httptest-backed mock infrastructure that
lets existing MockClient tests exercise real SDK service methods.
* Migrate all commands to typed SDK service methods
Replace raw HTTP calls (getClient().Get/Post/Patch/Delete) with typed
SDK service methods (Cards().Create, Boards().Update, etc.) across all
command files. Legacy getClient() retained only for file upload/download,
multipart PATCH (avatar), and board migration.
* Update AGENTS.md for SDK architecture and remove dead --tag-ids flag
* Address PR review findings: 7 fixes across commands
- step update: bypass omitempty on bool via raw Patch when --not_completed set
- requireAuth: decouple from SDK init so legacy commands aren't blocked
- card create: follow Location header when API returns empty body
- setup: nil-guard accMap["id"] in parseAccounts
- pin_test: use validation error (422) instead of duplicate not-found
- setup_test: use toJSON helper instead of manual json.Marshal
- test_helpers: replace fragile "nauthorized" match with ToLower
* Fix e2e harness isolation and attachment test panics
Use FIZZY_PROFILE env var + clean HOME temp dir instead of --account
flag to avoid profile store resolution. Guard type assertions in
attachment download tests to prevent nil panics.
* Fix auth e2e tests: pass FIZZY_PROFILE and FIZZY_NO_KEYRING to Execute
Auth login/logout tests use harness.Execute() directly (not h.Run()),
so they must explicitly provide the env vars that globalEnv() normally
injects. Without FIZZY_PROFILE the CLI errors with "No profile configured".
* Address PR review feedback
- Fix CodeQL allocation overflow alert in column.go (len+3 flagged as
potentially large)
- Remove double normalizeAny in step update --not_completed path
- Add configHome temp dir to NewWithConfig for test isolation
- Set Retryable: true on transient sentinel errors (circuit breaker,
bulkhead, rate limit)
* Address PR review feedback: omitempty bools, network errors, upload SDK
- board update --all_access false: use raw Patch when setting false to
avoid omitempty dropping the zero value (same pattern as step
--not_completed)
- comment update: only set Body on request when --body or --body_file
provided, preventing empty string from clearing comment text
- sdk_errors: catch raw net.Error as CodeNetwork for proper exit codes
- upload: use requireAuth+requireAccount instead of requireAuthAndAccount
since upload only uses legacy client, not SDK
- AGENTS.md: update stale jsonAny docs to reflect normalizeAny
* Upgrade fizzy-sdk to v0.1.0
No breaking changes for the CLI — just moving from pre-release
commit pin to the tagged release.
* Add printSuccessWithLocation for webhook merge compatibility
The webhook commands (merged to master in #96) call
printSuccessWithLocation which was added to root.go on master.
Our branch has a diverged root.go, so CI's merge produces an
undefined reference. Add the function here so the merge builds.
* Fix board breadcrumb test to use SDK test mode
The breadcrumb test merged from master (#96) used SetTestMode
(legacy client), but board list uses getSDK() on this branch.
Switch to SetTestModeWithSDK to match.
* Fix CodeQL allocation overflow alert in column list
Guard the slice capacity computation to satisfy CodeQL's
size-overflow analysis.
* Address PR review feedback: marshal errors and URL validation
- Handle json.Marshal errors in signup identity data processing
instead of silently discarding them
- Validate hostname presence for all URL schemes in validateAPIURL,
not just http://
-**`getClient()`** (deprecated) returns `client.API` — legacy client, used only for file upload, download, multipart PATCH, and board migration
26
+
27
+
SDK service methods return typed structs (e.g. `*generated.Board`, `[]generated.Card`). Helper functions convert to the `any` types the output layer expects:
28
+
-**`normalizeAny(data)`** — JSON-round-trips any value (typed structs, `json.RawMessage`, maps) to `map[string]any` / `[]map[string]any`
29
+
-**`jsonAnySlice(pages)`** — converts `[]json.RawMessage` from `GetAll()` pagination to `[]map[string]any`
30
+
-**`convertSDKError(err)`** — converts SDK errors to `*output.Error`
31
+
-**`toSliceAny(v)`** — normalizes `[]map[string]any` or `[]any` to `[]any` for iteration
32
+
33
+
Account can be a slug or numeric ID.
34
+
19
35
## Fizzy API Reference
20
36
21
37
API documentation: https://github.com/basecamp/fizzy/blob/main/docs/API.md
@@ -39,6 +55,23 @@ make test-run NAME=TestBoardCRUD # Run a specific test
39
55
40
56
Requirements: Go 1.26+, API credentials for e2e tests.
41
57
58
+
### Unit Test Patterns
59
+
60
+
Tests use `SetTestModeWithSDK(mock)` which creates an httptest server backed by `MockClient`:
0 commit comments