feat(campfires): add UpdateCampfireLine operation#295
Conversation
Spec Change Impact
Checklist of SDKs needing updates:
|
There was a problem hiding this comment.
Pull request overview
Adds a new Campfires operation, UpdateCampfireLine (PUT /{accountId}/chats/{campfireId}/lines/{lineId}), to let SDK consumers edit existing campfire lines without delete-and-repost. This change updates the Smithy source of truth, regenerates the OpenAPI + all SDKs, and adds language-specific naming/config glue plus tests.
Changes:
- Extend the Smithy spec (and tags overlay) with
UpdateCampfireLine, including idempotency + retry metadata, and regenerateopenapi.json/ derived artifacts. - Regenerate TypeScript/Ruby/Python/Swift/Kotlin SDKs to expose
updateLine/update_linemethods and update service-generator configs to map the new operation name correctly. - Add a hand-written Go
CampfiresService.UpdateLine(...)wrapper (re-fetching the updated line after a 204) and add new tests (Go/TS/Ruby).
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 17 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| typescript/tests/services/campfires.test.ts | Adds MSW-backed tests for campfires.updateLine (204 + validation). |
| typescript/src/generated/services/campfires.ts | Adds generated updateLine method + request interface. |
| typescript/src/generated/schema.d.ts | Updates OpenAPI-derived TS types to include PUT for campfire lines. |
| typescript/src/generated/path-mapping.ts | Registers PUT campfire-line route → UpdateCampfireLine. |
| typescript/src/generated/openapi-stripped.json | Updates stripped OpenAPI with new PUT operation + schema. |
| typescript/src/generated/metadata.json | Adds retry/idempotency metadata entry for UpdateCampfireLine. |
| typescript/scripts/generate-services.ts | Updates service splits + method name override to include UpdateCampfireLine → updateLine. |
| typescript/README.md | Documents the new campfires.updateLine method in the service list. |
| swift/Sources/BasecampGenerator/ServiceGrouper.swift | Adds UpdateCampfireLine to Campfires grouping for generation. |
| swift/Sources/BasecampGenerator/MethodNaming.swift | Adds method name override UpdateCampfireLine → updateLine. |
| swift/Sources/Basecamp/Generated/Services/CampfiresService.swift | Adds generated updateLine(...) API in Swift service. |
| swift/Sources/Basecamp/Generated/Models/UpdateCampfireLineRequest.swift | Adds generated request model for update line. |
| swift/Sources/Basecamp/Generated/Metadata.swift | Adds retry config entry for UpdateCampfireLine. |
| spec/overlays/tags.smithy | Tags UpdateCampfireLine as Campfire. |
| spec/basecamp.smithy | Defines UpdateCampfireLine operation + input/output in Smithy. |
| ruby/test/basecamp/services/campfires_service_test.rb | Adds Ruby tests for update_line (with/without content_type). |
| ruby/scripts/generate-services.rb | Adds operation to Campfires service split + method name override. |
| ruby/lib/basecamp/generated/types.rb | Refreshes generation timestamp header. |
| ruby/lib/basecamp/generated/services/campfires_service.rb | Adds generated update_line(...) method implementation. |
| ruby/lib/basecamp/generated/metadata.json | Adds retry/idempotency metadata entry for UpdateCampfireLine. |
| python/src/basecamp/generated/types.py | Adds TypedDict for UpdateCampfireLineRequestContent. |
| python/src/basecamp/generated/services/campfires.py | Adds sync/async update_line(...) methods. |
| python/src/basecamp/generated/metadata.json | Adds operation metadata entry for retry/idempotency. |
| python/scripts/generate_services.py | Adds operation to Campfires service list + name override. |
| openapi.json | Adds PUT operation + request schema for UpdateCampfireLine. |
| kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/services/Types.kt | Adds UpdateCampfireLineBody model. |
| kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/services/campfires.kt | Adds generated updateLine(...) method. |
| kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/generated/Metadata.kt | Adds retry metadata for UpdateCampfireLine. |
| kotlin/generator/src/main/kotlin/com/basecamp/sdk/generator/Config.kt | Updates service split + method name override for UpdateCampfireLine. |
| go/README.md | Documents Campfires().UpdateLine in the Go service list. |
| go/pkg/generated/client.gen.go | Regenerates Go client with UpdateCampfireLine request/response plumbing. |
| go/pkg/basecamp/campfires.go | Adds hand-written CampfiresService.UpdateLine(...) wrapper + options. |
| go/pkg/basecamp/campfires_test.go | Adds Go tests covering UpdateLine validation + request shape + refetch. |
| behavior-model.json | Adds retry/idempotency behavior model entry for UpdateCampfireLine. |
| AGENTS.md | Updates operation count and generated-operations description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f58f166 to
75f73ca
Compare
Addresses Copilot review on basecamp/basecamp-sdk#295: align UpdateLineOptions ContentType doc with the rest of the campfires service (API defaults to plain text).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 35 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds an UpdateCampfireLine operation across all six SDKs, generated from
the Smithy spec. Maps PUT /chats/{campfireId}/lines/{lineId}, which the
Basecamp API accepts but the spec did not previously expose.
- Smithy: new operation with Campfire tag, registered in service operations
- Generated clients regenerated for Go, TypeScript, Ruby, Python, Swift, Kotlin
- Service generator mappings (TS, Ruby, Python, Swift, Kotlin) updated to
rename UpdateCampfireLine -> updateLine / update_line
- Go service wrapper UpdateLine returns the re-fetched line (API responds 204)
- Go, Ruby, TypeScript tests cover happy path and validation
- AGENTS.md operation count refreshed (175 -> 204)
Verified: PUT /chats/{c}/lines/{l} with {content,content_type} returns 204
against a real Basecamp account; the line content updates as expected.
75f73ca to
26d71f1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 35 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds
UpdateCampfireLine(PUT/{accountId}/chats/{campfireId}/lines/{lineId}) so callers can edit existing campfire messages instead of delete-and-repost. The endpoint is accepted by the Basecamp API but was not previously surfaced in the spec.Verified live against a real Basecamp account: PUT returns 204 and the line content updates as expected.
Changes
spec/basecamp.smithy+spec/overlays/tags.smithy: new operation, taggedCampfire, registered in service operationsopenapi.jsonregenerated viamake smithy-buildmake ts-generate ts-generate-services rb-generate rb-generate-services py-generate swift-generate kt-generate-servicesUpdateCampfireLine → updateLine/update_line:typescript/scripts/generate-services.tsruby/scripts/generate-services.rbpython/scripts/generate_services.pykotlin/generator/.../Config.ktswift/Sources/BasecampGenerator/{MethodNaming,ServiceGrouper}.swiftgo/pkg/basecamp/campfires.go: hand-writtenCampfiresService.UpdateLine(ctx, campfireID, lineID, content, *UpdateLineOptions). The API returns 204; the wrapper returns only an error (mirrorsDeleteLine) so a transient post-mutation read can not make a successful update appear to fail. Callers that need the canonical post-update line follow up withGetLine.go/pkg/basecamp/campfires_test.go), 2 Ruby (ruby/test/.../campfires_service_test.rb), 2 TypeScript (typescript/tests/services/campfires.test.ts)typescript/README.md,go/README.md,AGENTS.mdoperation count refreshed (175 → 204)Test plan
make go-check— Go tests + lint passmake ts-check— 618 tests passmake rb-check— 601 tests passmake py-check— 209 tests passmake swift-check— 166 tests passmake kt-check— Kotlin build + tests passmake go-check-drift/make py-check-drift/make kt-check-drift— no driftmake conformance— 64 passed, 0 failedRelated
CLI consumer that exercises this op: basecamp/basecamp-cli#462
Summary by cubic
Add
UpdateCampfireLineso clients can edit Campfire messages via PUT/{accountId}/chats/{campfireId}/lines/{lineId}. The spec now exposes this API and all SDKs gained anupdateLine/update_linemethod.contentrequired; optionalcontent_type("text/plain"or"text/html").UpdateLine(ctx, campfireID, lineID, content, *UpdateLineOptions)→ void; validates non-empty content andcontent_type.updateLine(campfireId, lineId, { content, contentType? })→ void; rejects empty content.update_line/updateLine→ void/Unit.UpdateCampfireLine → updateLine/update_line; READMEs and operation counts refreshed (175 → 204).Written for commit 26d71f1. Summary will update on new commits.