Skip to content

refactor: SDK quality fixes and guidelines#258

Merged
retr0h merged 12 commits intomainfrom
refactor/sdk-quality-fixes
Mar 14, 2026
Merged

refactor: SDK quality fixes and guidelines#258
retr0h merged 12 commits intomainfrom
refactor/sdk-quality-fixes

Conversation

@retr0h
Copy link
Collaborator

@retr0h retr0h commented Mar 14, 2026

Summary

  • Add JSON tags to all SDK client result types so StructToMap
    produces correct snake_case keys
  • Add Collection[T].First() safe accessor
  • Wrap Docker gen types with SDK-defined request types
    (DockerCreateOpts, DockerStopOpts, DockerListParams,
    DockerRemoveParams, DockerPullOpts, DockerExecOpts) —
    consumers no longer import gen
  • Fix CollectionResult to populate Result.Data from raw JSON
  • Surface rawJSON unmarshal errors in Result.Data instead of
    silently discarding with _ = err
  • Fix AuditService.Get UUID error wrapping
  • Add SDK Development Guidelines documentation page
  • Add missing DockerService client documentation page
  • Add osapi-orchestrator to README sister projects
  • Fix extra blank line after Job ID in docker CLI output
  • 100% test coverage on all SDK packages

Test plan

  • go test ./... passes (all packages)
  • golangci-lint run reports 0 issues
  • All 36 orchestrator examples compile individually
  • docs build succeeds with no broken links
  • 100% coverage on pkg/sdk/client/, pkg/sdk/orchestrator/,
    pkg/sdk/platform/

🤖 Generated with Claude Code

retr0h and others added 12 commits March 13, 2026 21:58
Covers 9 issues from code review: CollectionResult.Data population,
Docker request types, Collection.First(), JSON tags, error wrapping,
and osapi-orchestrator type deduplication.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
7 tasks across 2 repos: JSON tags, Collection.First(), Docker
request types, CollectionResult.Data, error wrapping, then
osapi-orchestrator type deduplication.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add snake_case json struct tags to all exported types in the SDK
client package so json.Marshal produces consistent key names.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Safe accessor for single-result collections. Returns zero value
and false when empty instead of panicking on index out of bounds.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace all gen.Docker*Request and gen.*Params types in the SDK's
public API with SDK-defined DockerCreateOpts, DockerStopOpts,
DockerListParams, DockerRemoveParams, DockerPullOpts, and
DockerExecOpts. The gen-to-SDK mapping is handled internally so
consumers never import the gen package.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
…esult

Add rawJSON []byte parameter so consumers can pass resp.RawJSON()
to populate Result.Data for downstream access (guards, Decode).
Update all callers in examples.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Consistent with JobService.Get which wraps with
"invalid job ID: %w".

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add test cases for all optional field paths in Create, List, Stop,
Remove, and Exec after wrapping gen types with SDK-defined request
types.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add SDK Development Guidelines page with rules for types, error
  handling, JSON tags, gen type wrapping, and bridge helpers
- Add missing DockerService client documentation page
- Add osapi-orchestrator to README sister projects
- Reference guidelines from CLAUDE.md

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Align with the established pattern used by all other CLI commands:
one blank line before Job ID, none after.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Thank you for contributing to this project! 😊🕹️

@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #258   +/-   ##
=======================================
  Coverage   99.94%   99.94%           
=======================================
  Files         222      222           
  Lines        9393     9439   +46     
=======================================
+ Hits         9388     9434   +46     
  Misses          3        3           
  Partials        2        2           
Files with missing lines Coverage Δ
pkg/sdk/client/agent_types.go 100.00% <ø> (ø)
pkg/sdk/client/audit.go 100.00% <100.00%> (ø)
pkg/sdk/client/audit_types.go 100.00% <ø> (ø)
pkg/sdk/client/docker.go 100.00% <100.00%> (ø)
pkg/sdk/client/docker_types.go 100.00% <ø> (ø)
pkg/sdk/client/file_types.go 100.00% <ø> (ø)
pkg/sdk/client/health_types.go 100.00% <ø> (ø)
pkg/sdk/client/job_types.go 100.00% <ø> (ø)
pkg/sdk/client/node_types.go 100.00% <100.00%> (ø)
pkg/sdk/orchestrator/bridge.go 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e2277c...2f95000. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@retr0h retr0h merged commit feef75f into main Mar 14, 2026
9 checks passed
@retr0h retr0h deleted the refactor/sdk-quality-fixes branch March 14, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant