Skip to content

Fix tool CRUD endpoints to use bucket-scoped paths#176

Merged
jeremy merged 2 commits intobasecamp:mainfrom
robzolkos:fix-tools-bucket-scoped-paths
Mar 15, 2026
Merged

Fix tool CRUD endpoints to use bucket-scoped paths#176
jeremy merged 2 commits intobasecamp:mainfrom
robzolkos:fix-tools-bucket-scoped-paths

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Mar 12, 2026

Summary

  • Tool CRUD operations (get, clone, update, delete) used account-scoped paths
    (/{accountId}/dock/tools/{toolId}) that don't exist in the BC3 API — every
    call returned 404
  • The actual BC3 routes require bucket scoping:
    /buckets/{projectId}/dock/tools/{toolId}
  • Enable, disable, and reposition are unchanged — they already work via flat
    recording routes (/{accountId}/recordings/{toolId}/position.json)

What changed

  • Smithy spec: Added projectId path parameter to GetTool, CloneTool,
    UpdateTool, and DeleteTool URIs and input structures
  • All SDKs regenerated: Go, TypeScript, Ruby, Kotlin, Swift
  • Go service wrapper: Updated to accept projectID parameter
  • Tests: Updated TypeScript and Ruby test mocks for new paths

Context

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

    • Smithy: CloneTool moved to /{accountId}/buckets/{projectId}/dock/tools.json; GetTool/UpdateTool/DeleteTool remain at /{accountId}/dock/tools/{toolId}. Regenerated OpenAPI and Go/TypeScript/Ruby/Kotlin/Swift SDKs.
    • Services/tests updated: clone methods now require projectId; get/update/delete reverted to account-scoped paths and signatures. Enable/disable/reposition unchanged.
  • Migration

    • Only clone requires a projectId now. Examples: TypeScript client.tools.clone(123, { sourceRecordingId: 1 }); Go Tools.Create(ctx, 123, 1); Swift tools.clone(projectId: 123, req: ...). Get/update/delete signatures unchanged.

Written for commit d873484. Summary will update on new commits.

@robzolkos robzolkos requested a review from a team as a code owner March 12, 2026 16:12
Copilot AI review requested due to automatic review settings March 12, 2026 16:12
@github-actions github-actions bot added typescript Pull requests that update TypeScript code ruby Pull requests that update the Ruby SDK go kotlin swift spec Changes to the Smithy spec or OpenAPI labels Mar 12, 2026
@github-actions
Copy link
Copy Markdown

## 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

@github-actions github-actions bot added breaking Breaking change to public API bug Something isn't working labels Mar 12, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 12, 2026

⚠️ Potential breaking changes detected:

  • The function 'Create' in 'ToolsService' (Go SDK) had its signature changed. A new required parameter 'projectID' was added.
  • The method 'clone' in Kotlin SDK's 'ToolsService' had its signature changed. A new required parameter 'projectId' was added.
  • The method 'clone' in Swift SDK's 'ToolsService' had its signature changed. A new required parameter 'projectId' was added.
  • The endpoint '/dock/tools.json' in the TypeScript SDK has been removed and replaced with '/buckets/{projectId}/dock/tools.json', changing the structure and requiring a 'projectId' path parameter.

Review carefully before merging. Consider a major version bump.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 18 files

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and DeleteTool operations to include a required projectId path label and bucket-scoped URIs.
  • Regenerate SDK clients (TypeScript/Ruby/Go/Kotlin/Swift) so tool CRUD methods take projectId and 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.

Copy link
Copy Markdown
Member

@jeremy jeremy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's push this one upstream into the app. Shouldn't need bucket scope.

@robzolkos robzolkos closed this Mar 12, 2026
@jeremy
Copy link
Copy Markdown
Member

jeremy commented Mar 14, 2026

Still need this to correct tool creation.

@jeremy jeremy reopened this Mar 14, 2026
@github-actions
Copy link
Copy Markdown

## 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

@jeremy
Copy link
Copy Markdown
Member

jeremy commented Mar 15, 2026

Fixed — per Jeremy's review, reverted Get/Update/Delete back to account-scoped paths (/{accountId}/dock/tools/{toolId}). Only CloneTool (creation) keeps the bucket-scoped path since there's no existing recording ID to resolve the project from. bc3#9930 makes account-scoped paths work for the other three operations.

jeremy added 2 commits March 15, 2026 12:55
… 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.
@jeremy jeremy force-pushed the fix-tools-bucket-scoped-paths branch from 1f0c015 to d873484 Compare March 15, 2026 20:13
@github-actions
Copy link
Copy Markdown

Spec Change Impact

Changes Overview:

  • Modified Operations:
    • CRUD endpoints for Tool updated to use bucket-scoped paths.
  • No Additions or Removals: No new operations, resources, or types introduced or removed.

Breaking Change:

  • Breaking API Change: Yes, due to changes in endpoint paths. Any existing integrations using the previous Tool endpoints will require updates to accommodate bucket-scoped paths.

SDK Updates:

  • All SDKs need regeneration to incorporate updated path changes.

SDK Update Checklist:

  • Go
  • TypeScript
  • Ruby
  • Kotlin
  • Swift

@jeremy jeremy merged commit 31f21ec into basecamp:main Mar 15, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change to public API bug Something isn't working go kotlin ruby Pull requests that update the Ruby SDK spec Changes to the Smithy spec or OpenAPI swift typescript Pull requests that update TypeScript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants