refactor: SDK quality fixes and guidelines#258
Merged
Conversation
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>
Contributor
|
Thank you for contributing to this project! 😊🕹️ |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ 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
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StructToMapproduces correct snake_case keys
Collection[T].First()safe accessor(
DockerCreateOpts,DockerStopOpts,DockerListParams,DockerRemoveParams,DockerPullOpts,DockerExecOpts) —consumers no longer import
genCollectionResultto populateResult.Datafrom raw JSONResult.Datainstead ofsilently discarding with
_ = errAuditService.GetUUID error wrappingTest plan
go test ./...passes (all packages)golangci-lint runreports 0 issuesdocs buildsucceeds with no broken linkspkg/sdk/client/,pkg/sdk/orchestrator/,pkg/sdk/platform/🤖 Generated with Claude Code