Fix tool CRUD endpoints to use bucket-scoped paths#176
Conversation
## Spec Change Impact
### Summary of Changes
- **Modified:** Updated tool CRUD endpoints to use bucket-scoped paths.
### Impact
- All SDKs need regeneration due to the changes.
- This is **not** a breaking API change since no operations or fields were removed.
### Checklist for SDK updates:
- [ ] Go
- [ ] TypeScript
- [ ] Ruby
- [ ] Kotlin
- [ ] Swift |
Review carefully before merging. Consider a major version bump. |
There was a problem hiding this comment.
Pull request overview
This PR fixes Tool CRUD (get/clone/update/delete) across the SDKs by switching from non-existent account-scoped routes to the correct bucket-scoped (/buckets/{projectId}/dock/tools/...) BC3 API paths, driven by an update to the Smithy spec and regenerated clients.
Changes:
- Update Smithy
GetTool,CloneTool,UpdateTool, andDeleteTooloperations to include a requiredprojectIdpath label and bucket-scoped URIs. - Regenerate SDK clients (TypeScript/Ruby/Go/Kotlin/Swift) so tool CRUD methods take
projectIdand call the corrected routes. - Update TypeScript and Ruby tests/mocks to match the new bucket-scoped paths.
Reviewed changes
Copilot reviewed 5 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| typescript/tests/services/tools.test.ts | Updates request mocks and client calls to include projectId and new bucket-scoped tool paths. |
| typescript/src/generated/services/tools.ts | Adjusts generated ToolsService CRUD method signatures and request paths to be bucket-scoped. |
| typescript/src/generated/services/index.ts | Reorders exports to include ToolsService earlier (no functional change). |
| typescript/src/generated/schema.d.ts | Updates OpenAPI-derived TS types for the new bucket-scoped tool endpoints and operation path params. |
| typescript/src/generated/path-mapping.ts | Updates operation-id mapping keys to bucket-scoped tool routes for retry/metadata lookup. |
| typescript/src/generated/openapi-stripped.json | Regenerated OpenAPI artifact reflecting the updated tool endpoints (and reordered spec output). |
| typescript/src/generated/metadata.json | Regenerated operation metadata (retry/idempotency) including tool operations. |
| swift/Sources/Basecamp/Generated/Services/ToolsService.swift | Updates Swift ToolsService CRUD methods to require projectId and use bucket-scoped paths. |
| spec/basecamp.smithy | Source-of-truth fix: adds projectId labels and corrects tool CRUD URIs to /buckets/{projectId}/dock/tools/.... |
| ruby/test/basecamp/services/tools_service_test.rb | Updates Ruby service tests to stub and call bucket-scoped tool routes with project_id. |
| ruby/lib/basecamp/generated/types.rb | Regenerated Ruby type header timestamp (generated artifact). |
| ruby/lib/basecamp/generated/services/tools_service.rb | Updates generated Ruby ToolsService CRUD to require project_id and use bucket-scoped paths. |
| ruby/lib/basecamp/generated/metadata.json | Regenerated Ruby SDK operation metadata including tool operations. |
| kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/services/tools.kt | Updates Kotlin ToolsService CRUD signatures and request paths to include projectId bucket scope. |
| go/pkg/generated/client.gen.go | Updates generated Go client interfaces/builders/response parsers for tool CRUD to include projectId. |
| go/pkg/basecamp/url-routes.json | Regenerated route metadata to include bucket-scoped tool CRUD patterns. |
| go/pkg/basecamp/tools.go | Updates Go convenience wrapper to accept projectID for tool CRUD calls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
jeremy
left a comment
There was a problem hiding this comment.
Let's push this one upstream into the app. Shouldn't need bucket scope.
|
Still need this to correct tool creation. |
## Spec Change Impact
### Summary of Changes
- **Modified Operations**: Updated tool CRUD endpoints to use bucket-scoped paths.
- **Modified Resources/Types**: Paths for tool-related operations now include a `bucketId` parameter to reflect the scope change.
### Impact Analysis
- **SDK Regeneration**: All SDKs require regeneration to incorporate the updated paths.
- **Breaking Change**: Yes. Path changes for tool endpoints require clients to be updated to include the `bucketId` parameter.
### Checklist of SDKs to Update
- [ ] Go
- [ ] TypeScript
- [ ] Ruby
- [ ] Kotlin
- [ ] Swift |
|
Fixed — per Jeremy's review, reverted Get/Update/Delete back to account-scoped paths ( |
… bucket-scoped CloneTool (creation) requires the bucket-scoped path because there's no existing recording ID to resolve the project from. Get/Update/Delete work with account-scoped paths via bc3#9930. Spec change + all regenerated SDK artifacts.
Remove projectID parameter from Get/Update/Delete in the Go service layer. Update Ruby and TypeScript test stubs and assertions to match.
1f0c015 to
d873484
Compare
Spec Change ImpactChanges Overview:
Breaking Change:
SDK Updates:
SDK Update Checklist:
|
Summary
(
/{accountId}/dock/tools/{toolId}) that don't exist in the BC3 API — everycall returned 404
/buckets/{projectId}/dock/tools/{toolId}recording routes (
/{accountId}/recordings/{toolId}/position.json)What changed
projectIdpath parameter to GetTool, CloneTool,UpdateTool, and DeleteTool URIs and input structures
projectIDparameterContext
Reported via Basecamp card.
The Ruby SDK hand-written service already had the correct bucket-scoped paths —
the bug was in the Smithy spec which drives the Go/TS/Kotlin/Swift generated
clients.
Summary by cubic
Fixes tool endpoints to match BC3 routing. Clone now uses a bucket-scoped path, while get/update/delete stay account-scoped to avoid 404s and keep existing calls working.
Bug Fixes
CloneToolmoved to/{accountId}/buckets/{projectId}/dock/tools.json;GetTool/UpdateTool/DeleteToolremain at/{accountId}/dock/tools/{toolId}. Regenerated OpenAPI andGo/TypeScript/Ruby/Kotlin/SwiftSDKs.projectId; get/update/delete reverted to account-scoped paths and signatures. Enable/disable/reposition unchanged.Migration
projectIdnow. Examples: TypeScriptclient.tools.clone(123, { sourceRecordingId: 1 }); GoTools.Create(ctx, 123, 1); Swifttools.clone(projectId: 123, req: ...). Get/update/delete signatures unchanged.Written for commit d873484. Summary will update on new commits.