Update the spec where bc3 changed: Campfire line updates and replies, menu permissions, custom search ranges

JE
3d ago
+2876-213

Absorbs the four bc3 contracts that #1125's repin to bc3 e759e8f2749 registered in spec/api-gaps/ but didn't model. I checked each one against bc3's code at that revision before changing the spec. All links below are pinned to it.

1. Updating a Campfire line answers 200 with the line (bc3 #14536)

Chats::LinesController#update now renders :show for JSON, and campfires.md documents 200 OK with the line. The spec declared code: 204 with an empty output.

UpdateCampfireLine now declares code: 200 and returns line: CampfireLine, so the update returns the line in every SDK. This is breaking, which is why the PR carries breaking:

  • Go's CampfiresService.UpdateLine changes from error to (*CampfireLine, error). Run locally against origin/main, apidiff reports this as the one incompatible change. Everything else in the PR is additive.
  • The return type also changes in TypeScript (Promise<void> → Promise<CampfireLine>), Ruby, Python, Kotlin, Swift and Rust. Code that ignored the result keeps working outside Go, though Swift warns on the unused result.
  • MIGRATING.md has a table for all seven SDKs.

Basecamp 4's four branch still answers 204. Against it, Go, Kotlin, Swift and Rust would report a malformed response for an update that succeeded. I didn't add a shim for that: COORDINATION.md records that BC5 replaced BC4 in production, so no live BC4 backend remains.

2. Campfire line replies (bc3 #14407, #14461)

CampfireLine and SearchResult gain original_id and original, and CreateCampfireLineInput gains original_id, excerpt and uuid.

original is a new CampfireLineOriginal structure, not a CampfireLine. The quoted line has no parent, bucket, updated_at, inherits_status or visible_to_clients, all of which CampfireLine requires, so Swift, Kotlin and Rust couldn't decode it as one. Its creator is people/_person_minimal (id, name, avatar_url), which Person accepts.

Two things are deliberately left alone:

  • The create's retry policy. Whether a create that carries a uuid should become retryable is a separate decision.
  • The 202 Accepted that an integration Ping answers.

3. Menu permissions and archive counts (bc3 #14599)

These views emit the keys:

Todo, Todolist (which also models groups), Todoset, CardTable and CardColumn gain the fields, and so does SearchResult's kanban-list branch, which renders _list and so carries archived_cards_count.

Every new member is optional:

  • The permission keys appear only where a view passes permissions: true.
  • A to-do list group has no archive counts.
  • Only a Kanban::Column has can_move and can_archive_or_trash.

Go's domain types use *bool and *int32 for these fields, so a missing key stays nil, which means "not reported" rather than "no".

4. Search by a custom date range (bc3 #14236)

Search::TimeFilter accepts since=custom with from and to, and Searching permits both. SearchInput gains from and to as ISO8601Date query members, and SearchSinceField documents custom.

Not in this PR

#1125 registered a fifth contract: bc3 #14348's notify on upload create (upload-create-subscriptions.md). It wasn't one of the four this PR set out to fix, so it stays registered for its own change.

What else changed

  • make generate, so all seven SDKs are regenerated.
  • The Go wrappers and domain types take the new fields. UpdateLine returns the line.
  • Shared fixtures carry the new keys. campfires/reply_line_get.json is new and registered in the fixture manifest, which now covers CampfireLine and CampfireLineOriginal, as well as UpdateCampfireLine's 200 body.
  • New tests: Go for every gap, and TypeScript, Ruby, Python, Kotlin, Swift and Rust for the update's return value, reply create and read, and the custom range.
  • The four gap entries move to absorbed-in-sdk. The README's range triage is history and stays as written.
  • No operation is added or removed, so operation counts, routes and the bc3 pin don't change.

Local checks

make -k check passes everything except rs-deny. That one fails on a yanked sha2 0.11.2 in rust/Cargo.lock, which this PR doesn't touch, so main has it too.


Summary by cubic

Absorbs the four bc3 API contracts that #1125 registered in spec/api-gaps/ into the spec and all seven SDKs: Campfire line updates return the updated line, line replies carry their original, to-do and card table resources expose menu permissions and archive counts, and search accepts a custom date range.

Breaking change

  • Updating a Campfire line now answers 200 OK with the line instead of 204 No Content (bc3 #14536). Every SDK's update returns the line; Go's UpdateLine changes from error to (*CampfireLine, error), and MIGRATING.md covers all seven SDKs.
  • Callers that ignored the result keep working outside Go, though Swift warns on the unused result; BC4 still answers 204, but no live BC4 backend remains, so no shim was added.

Other changes

  • Campfire reads: CampfireLine and SearchResult carry original_id and original, a new CampfireLineOriginal shape, since the quoted line is not a full CampfireLine (bc3 #14407).
  • Campfire create takes original_id, excerpt and uuid (bc3 #14461); making uuid creates retryable is deliberately left out.
  • Todo, Todolist, Todoset, CardTable, CardColumn and the kanban-list search branch gain optional menu permission and archive-count fields (bc3 #14599); Go uses pointers, so a missing key means "not reported", not "no".
  • Search takes from and to with since=custom (bc3 #14236).
  • The fifth gap from #1125, upload-create-subscriptions, stays registered for its own change.
  • make check passes except rs-deny, which fails on main too (yanked sha2 0.11.2).