Skip to content

Add CardStepsService.Get()#183

Merged
jeremy merged 3 commits intomainfrom
card-steps
Mar 15, 2026
Merged

Add CardStepsService.Get()#183
jeremy merged 3 commits intomainfrom
card-steps

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 15, 2026

Summary

  • Add GetCardStep operation to the Smithy spec for GET /{accountId}/card_tables/steps/{stepId}, matching the existing GetCard pattern
  • Regenerate all five SDK clients (Go, TypeScript, Ruby, Swift, Kotlin) with get() methods on CardStepsService
  • Hand-written Go wrapper with hooks/retry and cardStepFromGenerated conversion
  • Tests for Go (happy path + 404), TypeScript (happy path + 404), and Ruby (happy path)

The BC3 Rails app exposes this route via Kanban::StepsController#show at both top-level (/card_tables/steps/:id) and bucket-scoped (/buckets/:bucket_id/card_tables/steps/:id) paths, though the public API docs only document step retrieval as part of Get Card.

Enables the CLI to validate step existence before assign/unassign without the current Account().Get() workaround.

Test plan

  • make check passes (smithy, behavior-model, provenance, api-version, go-check-drift, kt-check-drift, go-check, ts-check, rb-check, kt-check, swift-check, conformance — 52 passed, 0 failed)
  • Smoke test against live Basecamp account

Summary by cubic

Adds a GET /{accountId}/card_tables/steps/{stepId} endpoint and SDK methods to fetch a single card step. This lets the CLI check step existence without the current account lookup workaround.

  • New Features
    • Added GetCardStep to the Smithy spec and OpenAPI for GET /{accountId}/card_tables/steps/{stepId} with exponential retry (3 attempts, 429/503).
    • Regenerated SDKs (Go, TypeScript, Ruby, Swift, Kotlin) with get()/Get on CardStepsService.
    • Implemented a Go wrapper with hooks/retry and cardStepFromGenerated conversion.
    • Added tests: Go (200, 404), TypeScript (200, 404), Ruby (200, 404).

Written for commit 07bb026. Summary will update on new commits.

@jeremy jeremy requested a review from a team as a code owner March 15, 2026 20:44
Copilot AI review requested due to automatic review settings March 15, 2026 20:44
@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 15, 2026
@github-actions
Copy link
Copy Markdown

## Spec Change Impact

### Summary of Changes
- **Added Operation**: `CardStepsService.Get()`

### Impact Analysis
- All SDKs need regeneration to incorporate the new operation.
- This is **not a breaking change** since no operations or fields were removed or modified in a backward-incompatible way.

### SDK Update Checklist
- [ ] Go
- [ ] TypeScript
- [ ] Ruby
- [ ] Kotlin
- [ ] Swift

@github-actions github-actions bot added the enhancement New feature or request label Mar 15, 2026
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.

1 issue found across 26 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="typescript/tests/services/card-steps.test.ts">

<violation number="1" location="typescript/tests/services/card-steps.test.ts:54">
P2: The test is named "should throw not_found for missing step" but only asserts that *something* is thrown (`rejects.toThrow()`). This will pass even if the error is a network failure or parse error rather than a proper `not_found` response. Assert on the error code to actually verify 404 handling.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f984152b00

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Adds a new GetCardStep operation (GET /{accountId}/card_tables/steps/{stepId}) to the Smithy/OpenAPI specs and propagates it through all generated SDKs, plus a hand-written Go wrapper and targeted tests to support step-existence checks (e.g., for the CLI).

Changes:

  • Add GetCardStep to Smithy spec + tagging/behavior model + OpenAPI outputs.
  • Regenerate SDKs to expose get()/Get() on CardStepsService across Go/TS/Ruby/Swift/Kotlin.
  • Add tests for Go (200/404), TypeScript (200/404), and Ruby (200).

Reviewed changes

Copilot reviewed 13 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
spec/basecamp.smithy Defines new GetCardStep operation and input/output shapes.
spec/overlays/tags.smithy Tags GetCardStep under “Card Tables” for docs/grouping.
behavior-model.json Marks operation readonly + retry behavior metadata.
openapi.json Adds OpenAPI path/operation + response schema mapping.
typescript/src/generated/openapi-stripped.json Mirrors new get operation for TS generator/runtime.
typescript/src/generated/schema.d.ts Adds GetCardStep operation typing and path method signature.
typescript/src/generated/path-mapping.ts Maps route to operation name for request metadata.
typescript/src/generated/services/card-steps.ts Adds CardStepsService.get(stepId) implementation.
typescript/src/generated/metadata.json Adds retry config entry for GetCardStep.
typescript/scripts/generate-services.ts Ensures GetCardStep is grouped into CardSteps service.
typescript/tests/services/card-steps.test.ts Adds TS happy-path + 404 test coverage for get.
go/pkg/generated/client.gen.go Regenerates Go client with GetCardStep* request/response helpers.
go/pkg/basecamp/cards.go Adds hand-written CardStepsService.Get() wrapper using hooks + conversion.
go/pkg/basecamp/url-routes.json Registers GET route mapping for GetCardStep.
go/pkg/basecamp/cards_test.go Adds Go tests for CardStepsService.Get() (200 + 404).
ruby/scripts/generate-services.rb Adds GetCardStep to Ruby service split config.
ruby/lib/basecamp/generated/services/card_steps_service.rb Adds Ruby CardStepsService#get(step_id:).
ruby/test/basecamp/services/card_steps_service_test.rb Adds Ruby happy-path test for get.
ruby/lib/basecamp/generated/metadata.json Adds retry config entry for GetCardStep.
ruby/lib/basecamp/generated/types.rb Regeneration timestamp update.
swift/Sources/BasecampGenerator/ServiceGrouper.swift Ensures Swift generator groups GetCardStep into CardSteps.
swift/Sources/Basecamp/Generated/Services/CardStepsService.swift Adds Swift get(stepId:) method.
swift/Sources/Basecamp/Generated/Metadata.swift Adds retry config entry for GetCardStep.
kotlin/generator/src/main/kotlin/com/basecamp/sdk/generator/Config.kt Ensures Kotlin generator groups GetCardStep into CardSteps.
kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/services/card-steps.kt Adds Kotlin suspend fun get(stepId: Long) method.
kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/Metadata.kt Adds retry config entry for GetCardStep.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jeremy added 2 commits March 15, 2026 14:31
Define a readonly GET endpoint for card_tables/steps/{stepId},
following the GetCard pattern. Wire it into the service resource
list and tag it under "Card Tables".
Register GetCardStep in service split maps for all five languages
and run generators. Produces get() methods in TS, Ruby, Swift, and
Kotlin generated services, plus the Go oapi-codegen client.
@github-actions
Copy link
Copy Markdown

## Spec Change Impact

### Summary of Changes
- **Added**: Operation `CardStepsService.Get()`

### Impact Analysis
- **SDKs requiring regeneration**: All (Go, TypeScript, Ruby, Kotlin, Swift)
- **Breaking change?**: No (this change is additive, no existing operations or fields were removed)

### SDKs to Update
- [ ] Go  
- [ ] TypeScript  
- [ ] Ruby  
- [ ] Kotlin  
- [ ] Swift  

Hand-written Get method follows the CardsService.Get pattern with
hooks, retry, and cardStepFromGenerated conversion. Tests cover
happy path and 404 in Go, TypeScript, and Ruby.
Copilot AI review requested due to automatic review settings March 15, 2026 21:35
@github-actions
Copy link
Copy Markdown

## Spec Change Impact

### Summary of Changes
- **Added Operation**: `CardStepsService.Get()`  
  A new operation `Get()` was added to the `CardStepsService`.

### Impact on SDKs
- All SDKs need regeneration to include the new operation.

### Breaking Change?
- **No**, this is not a breaking change as no existing operations, fields, or types were removed or modified.

### Checklist of SDKs needing updates:
- [ ] Go
- [ ] TypeScript
- [ ] Ruby
- [ ] Kotlin
- [ ] Swift

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

Adds a first-class “Get Card Step” API operation (GET /{accountId}/card_tables/steps/{stepId}) to the Smithy/OpenAPI specs and regenerates all SDKs so consumers can fetch a single card step directly (matching the existing Get Card flow).

Changes:

  • Added Smithy + OpenAPI definitions for GetCardStep (including retry metadata + tags).
  • Regenerated SDK clients (Go/TS/Ruby/Swift/Kotlin) to expose CardStepsService.get() / Get().
  • Added targeted tests for Go + TypeScript (200 + 404) and Ruby (200).

Reviewed changes

Copilot reviewed 13 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/basecamp.smithy Defines the GetCardStep operation, input/output, and errors.
spec/overlays/tags.smithy Tags GetCardStep under “Card Tables” for docs/grouping.
openapi.json Publishes the new endpoint in the full OpenAPI spec.
behavior-model.json Adds readonly + retry behavior metadata for GetCardStep.
typescript/src/generated/openapi-stripped.json Adds the account-scoped (stripped) TS OpenAPI path + retry extension.
typescript/src/generated/schema.d.ts Adds GetCardStep operation typing and response content alias.
typescript/src/generated/path-mapping.ts Maps the new GET route to GetCardStep operation id.
typescript/src/generated/metadata.json Adds retry config metadata entry for GetCardStep.
typescript/src/generated/services/card-steps.ts Adds CardStepsService.get(stepId) calling GET /card_tables/steps/{stepId}.
typescript/scripts/generate-services.ts Ensures GetCardStep is grouped into the CardSteps service split.
typescript/tests/services/card-steps.test.ts Adds happy-path + 404 error tests for cardSteps.get.
ruby/scripts/generate-services.rb Ensures GetCardStep is grouped under the Ruby CardSteps service.
ruby/lib/basecamp/generated/services/card_steps_service.rb Adds Ruby get(step_id:) method for the new endpoint.
ruby/test/basecamp/services/card_steps_service_test.rb Adds Ruby tests for get success + 404 not found.
ruby/lib/basecamp/generated/metadata.json Adds retry config metadata entry for GetCardStep.
ruby/lib/basecamp/generated/types.rb Updates generated timestamp for the Ruby types bundle.
swift/Sources/BasecampGenerator/ServiceGrouper.swift Groups GetCardStep into Swift CardSteps service.
swift/Sources/Basecamp/Generated/Services/CardStepsService.swift Adds Swift get(stepId:) method.
swift/Sources/Basecamp/Generated/Metadata.swift Adds retry config for GetCardStep.
kotlin/generator/src/main/kotlin/com/basecamp/sdk/generator/Config.kt Groups GetCardStep into Kotlin CardSteps service.
kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/services/card-steps.kt Adds Kotlin suspend fun get(stepId: Long) implementation.
kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/Metadata.kt Adds retry config for GetCardStep.
go/pkg/generated/client.gen.go Adds generated request/response plumbing for GetCardStep.
go/pkg/basecamp/cards.go Adds handwritten Go wrapper CardStepsService.Get w/ hooks + conversion.
go/pkg/basecamp/url-routes.json Registers GET routing metadata for GetCardStep.
go/pkg/basecamp/cards_test.go Adds Go contract tests for CardStepsService.Get (200 + 404).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeremy jeremy merged commit cb9431f into main Mar 15, 2026
55 checks passed
@jeremy jeremy deleted the card-steps branch March 15, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request 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.

2 participants