feat(projects): add recent-projects operations

Merged
JE
3mo ago
+2321-25

bc3#13043 (merged to master) exposes the per-user recent-visit log in the API. This PR absorbs both halves into the spec and all six SDKs:

  • ListRecentProjects — GET /my/recent_projects.json: the projects the current user has most recently visited, most recent visit first. Reads the raw visit log — capped at the 50 most recent visits, keeping only active projects the person can still access — so the response is a single page and the operation carries no pagination traits. Each entry is the standard project projection plus bookmarked (the wire omits starred here, unlike GET /projects.json; harmless since Project.starred is optional).
  • RecordProjectVisit — POST /projects/{projectId}/recent_visit.json, 204 No Content, newly documented by the same bc3 PR: records a visit so CLI/SDK project opens feed the same list the web does. Re-recording a visit refreshes the same entry, so the POST is naturally idempotent (@basecampIdempotent(natural: true), joining the other eight idempotent POSTs). Visits to archived/trashed projects are accepted but not recorded; an inaccessible project answers 404.

What's in the change

  • Spec: two operations + shapes in spec/basecamp.smithy, tagged Projects; output reuses the existing Project shape.
  • Generated: make generate across all six SDKs (OpenAPI, behavior model, url-routes, per-language services/metadata/types).
  • Go wrapper: Projects().ListRecent(ctx) and Projects().RecordVisit(ctx, id) over the generated client only; grouped-client-inventory.yml rows.
  • Conformance: path cases for both operations, an idempotency retry case for the POST, dispatch entries in all six runners, and the Ruby GET-only-retry waiver (runner skip lists + spec/zero-skip-roster.yml, SPEC roster re-rendered). A live read-only case for ListRecentProjects joins live-my-surface.json, with the decoder registered in all five replay/dispatch tables; the deliberately pinned counts in check-replay-decoder-parity (31 → 32 live ops) and check-idempotency-parity (85 → 86 idempotent, 210 → 212 union) advance with it.
  • Fixture: spec/fixtures/projects/recent.json — the bookmarked-only projection, most recent visit first, with one unpinned entry so the flag is exercised both ways; consumed by the Go fixture tests.
  • Tests: happy path + error case for both operations in TypeScript, Ruby, Python, Kotlin, Swift, and Go.
  • Repin: provenance advances to the bc3 revision that shipped #13043, with the 824013d672d..88549ca619e range triaged in spec/api-gaps/README.md (49 commits; #13042/#13037 were already absorbed by #835/#834, and #13040's delegated-events performed_by field is registered as a new addressed-in-bc3-pr-13040 gap entry rather than absorbed here). spec/bc3-routes.json regenerated at the new pin: 377 → 379 routes, exactly the two new recent-projects routes. New gap entry recent-projects.md records the absorption.

Verification

make check-targets run locally: green end to end with two disclosed local-toolchain gaps, both in files/lanes this PR barely touches and where remote CI is authoritative — lint-actions (the local zizmor flags pre-existing workflow style in untouched workflow files) and the Swift test lanes (swift test cannot resolve XCTest under this machine's CommandLineTools; swift build succeeds, and the Swift SDK + generator drift checks pass). Conformance suites pass across the mock runners, including the two new path cases and the new idempotency case; the Python/Ruby replay-runner unit suites and check-replay-decoder-parity were re-run green after the decoder registrations.

Tracking card: Add recent-projects API to basecamp-sdk


Summary by cubic

Adds the recent-projects API to the spec and all six SDKs so SDK-driven project opens can read and feed the same per-user recent-visit list the web uses.

New Features

  • ListRecentProjects — GET /my/recent_projects.json, unpaginated; entries are the standard Project projection plus bookmarked (starred is omitted on the wire, which is harmless since it's optional).
  • RecordProjectVisit — POST /projects/{projectId}/recent_visit.json, returns 204; re-recording refreshes the same entry, so the POST is naturally idempotent and joins the retry-eligible POSTs.
  • Visits to archived or trashed projects are accepted but not recorded; an inaccessible project answers 404.

Across the SDKs

  • Regenerates all six SDKs and the OpenAPI/behavior-model metadata, reflowing the new operations' Smithy docs so generated method summaries render fully; Go adds Projects().ListRecent(ctx) and Projects().RecordVisit(ctx, projectID) wrappers, and TypeScript, Kotlin, and Swift override resource types so both operations report project telemetry. The Go test asserts bookmarked survives the wrapper conversion and starred stays false when the wire omits it.
  • Conformance adds path cases for both, an idempotency-retry case for the POST (waived in Ruby under its GET-only retry rule), a live read-only ListRecentProjects case with decoders in all five replay tables, 403 error-path tests for the list in Python, TypeScript, and Ruby, and the TypeScript, Kotlin, and Swift runners now carry the decoded list result like the Go runner does.
  • Provenance repins to the bc3 revision shipping #13043; bc3-routes.json goes 377 → 379 routes and the triage absorbs recent-projects and registers a delegated-events-performed-by gap.
  • make check-targets is green locally except two disclosed toolchain gaps in untouched lanes (lint-actions workflow-style flags and Swift XCTest resolution).