Skip to content

feat(campfires): add UpdateCampfireLine operation#295

Open
nnemirovsky wants to merge 1 commit into
basecamp:mainfrom
nnemirovsky:feat/campfires-update-line
Open

feat(campfires): add UpdateCampfireLine operation#295
nnemirovsky wants to merge 1 commit into
basecamp:mainfrom
nnemirovsky:feat/campfires-update-line

Conversation

@nnemirovsky
Copy link
Copy Markdown
Contributor

@nnemirovsky nnemirovsky commented May 4, 2026

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, tagged Campfire, registered in service operations
  • openapi.json regenerated via make smithy-build
  • All 6 SDKs regenerated (Go, TypeScript, Ruby, Python, Swift, Kotlin) — make ts-generate ts-generate-services rb-generate rb-generate-services py-generate swift-generate kt-generate-services
  • Service generator configs updated in 5 places to map UpdateCampfireLine → updateLine / update_line:
    • typescript/scripts/generate-services.ts
    • ruby/scripts/generate-services.rb
    • python/scripts/generate_services.py
    • kotlin/generator/.../Config.kt
    • swift/Sources/BasecampGenerator/{MethodNaming,ServiceGrouper}.swift
  • go/pkg/basecamp/campfires.go: hand-written CampfiresService.UpdateLine(ctx, campfireID, lineID, content, *UpdateLineOptions). The API returns 204; the wrapper returns only an error (mirrors DeleteLine) 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 with GetLine.
  • Tests: 4 Go (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.md operation count refreshed (175 → 204)

Test plan

  • make go-check — Go tests + lint pass
  • make ts-check — 618 tests pass
  • make rb-check — 601 tests pass
  • make py-check — 209 tests pass
  • make swift-check — 166 tests pass
  • make kt-check — Kotlin build + tests pass
  • make go-check-drift / make py-check-drift / make kt-check-drift — no drift
  • make conformance — 64 passed, 0 failed
  • Live PUT against a real campfire line — 204, content updated, restored cleanly

Related

CLI consumer that exercises this op: basecamp/basecamp-cli#462


Summary by cubic

Add UpdateCampfireLine so clients can edit Campfire messages via PUT /{accountId}/chats/{campfireId}/lines/{lineId}. The spec now exposes this API and all SDKs gained an updateLine/update_line method.

  • New Features
    • Spec/OpenAPI: new PUT for campfire lines; idempotent with retry (3 attempts, exponential backoff on 429/503).
    • Request body: content required; optional content_type ("text/plain" or "text/html").
    • SDKs:
      • Go: UpdateLine(ctx, campfireID, lineID, content, *UpdateLineOptions) → void; validates non-empty content and content_type.
      • TypeScript: updateLine(campfireId, lineId, { content, contentType? }) → void; rejects empty content.
      • Ruby/Python/Swift/Kotlin: update_line/updateLine → void/Unit.
    • Tests: added in Go, TypeScript, Ruby for happy path and validation; live PUT verified (204, content updates).
    • Generators/Docs: mapped UpdateCampfireLine → updateLine/update_line; READMEs and operation counts refreshed (175 → 204).

Written for commit 26d71f1. Summary will update on new commits.

@github-actions github-actions Bot added documentation Improvements or additions to documentation 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 May 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Spec Change Impact

  • Added: UpdateCampfireLine operation
  • Resources/Types: No changes to existing types or resources
  • SDKs needing regeneration: All SDKs should be regenerated to include the new operation
  • Breaking change: No (new operation added, no removals)

Checklist of SDKs needing updates:

  • Go
  • TypeScript
  • Ruby
  • Kotlin
  • Swift

@github-actions github-actions Bot added enhancement New feature or request and removed documentation Improvements or additions to documentation labels May 4, 2026
@nnemirovsky nnemirovsky marked this pull request as ready for review May 4, 2026 10:34
Copilot AI review requested due to automatic review settings May 4, 2026 10:34
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 35 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

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 regenerate openapi.json / derived artifacts.
  • Regenerate TypeScript/Ruby/Python/Swift/Kotlin SDKs to expose updateLine / update_line methods 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.

Comment thread go/pkg/basecamp/campfires.go Outdated
@nnemirovsky nnemirovsky force-pushed the feat/campfires-update-line branch from f58f166 to 75f73ca Compare May 4, 2026 10:44
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 4, 2026
nnemirovsky added a commit to nnemirovsky/basecamp-cli that referenced this pull request May 4, 2026
Addresses Copilot review on basecamp/basecamp-sdk#295: align UpdateLineOptions
ContentType doc with the rest of the campfires service (API defaults to plain
text).
@nnemirovsky nnemirovsky requested a review from Copilot May 4, 2026 10:50
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

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.
@nnemirovsky nnemirovsky force-pushed the feat/campfires-update-line branch from 75f73ca to 26d71f1 Compare May 4, 2026 11:16
@github-actions github-actions Bot added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels May 4, 2026
@nnemirovsky nnemirovsky requested a review from Copilot May 4, 2026 11:37
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

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.

Comment thread go/pkg/basecamp/campfires.go
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