Skip to content

Upgrade basecamp-sdk to v0.4.0#266

Merged
jeremy merged 6 commits intomainfrom
sdk-0.4.0
Mar 11, 2026
Merged

Upgrade basecamp-sdk to v0.4.0#266
jeremy merged 6 commits intomainfrom
sdk-0.4.0

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • Bump basecamp-sdk/go from pre-release pseudo-version to v0.4.0
  • Adapt all List call sites to new pagination types: pass nil opts where no pagination is needed, unwrap result structs (.Events, .Entries, .People, .Results, etc.)
  • Wire server-side Limit on search and campfire messages, replacing client-side slicing
  • Note SDK version in API-COVERAGE.md

Test plan

  • go build ./... compiles clean
  • bin/ci green (unit tests, e2e tests, lint, vet, surface snapshot, skill drift, SDK provenance)
  • Smoke test search, timeline, campfire messages against live account

Summary by cubic

Upgrade github.com/basecamp/basecamp-sdk/go to v0.4.0 and adapt the CLI to the new pagination API. Use server-side limits for search; keep client-side tail-slicing for campfire messages to preserve “most recent N.”

  • Dependencies

    • Bump github.com/basecamp/basecamp-sdk/go to v0.4.0 (uniform Limit/Page; types.FlexibleTime, types.FlexInt).
    • Update go.mod, go.sum, internal/version/sdk-provenance.json, and note version in API-COVERAGE.md.
    • Fix scripts/bump-sdk.sh to read semver tag timestamps from .info when go mod download -json omits .Time.
  • Refactors

    • Pass nil options where no pagination is needed; unwrap result fields (.Events, .Entries, .People, .Results).
    • Search: use server-side Limit (only when limit > 0); remove client-side slicing.
    • Campfire lines: call with nil opts and tail-slice locally to show newest N.
    • Touchpoints: timeline, search, campfire, timesheet, boosts, webhooks, todolist groups, message types, people, and TUI fetchers.

Written for commit 42dbd0c. Summary will update on new commits.

jeremy added 3 commits March 11, 2026 01:20
Uniform pagination support across all List methods, types.FlexibleTime
for date-only API responses, and types.FlexInt for float-encoded integers.
List methods now accept option structs and return result wrappers.
Pass nil opts where no pagination is needed, unwrap result fields
(.Events, .Entries, .People, .Results, etc.), and wire server-side
Limit on search and campfire messages to replace client-side slicing.
@jeremy jeremy requested a review from a team as a code owner March 11, 2026 08:21
Copilot AI review requested due to automatic review settings March 11, 2026 08:21
@github-actions github-actions bot added commands CLI command implementations tui Terminal UI sdk SDK wrapper and provenance docs deps enhancement New feature or request labels Mar 11, 2026
Copy link
Copy Markdown
Contributor

@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.

2 issues found across 18 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="internal/commands/search.go">

<violation number="1" location="internal/commands/search.go:57">
P2: Guard should be `limit > 0`, not `limit != 0`. A negative `--limit` value would be forwarded to the server, producing undefined behavior instead of being silently ignored as it was before.</violation>
</file>

<file name="internal/commands/campfire.go">

<violation number="1" location="internal/commands/campfire.go:218">
P1: Behavioral regression: `Limit` truncates from the start of the paginated result (oldest messages), but the old `lines[len(lines)-limit:]` slicing took from the end (newest messages). Users will now see the oldest N campfire lines instead of the most recent N.

To preserve the old "show most recent" behavior, either fetch all lines (`Limit: -1`) and keep the tail-slicing, or use a two-pass approach (e.g., fetch total count from `Meta.TotalCount` then request the last page).</violation>
</file>

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

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

Upgrades the Basecamp Go SDK dependency to github.com/basecamp/basecamp-sdk/go@v0.4.0 and updates CLI/TUI call sites to the SDK’s new uniform pagination/result-wrapping conventions (e.g., passing nil opts and unwrapping .Events, .Entries, .People, .Results).

Changes:

  • Bump SDK version in go.mod/go.sum and record it in sdk-provenance.json + API-COVERAGE.md.
  • Update many SDK List*/timeline/people/search call sites to pass pagination opts and unwrap new result structs.
  • Move search/campfire “limit” behavior to server-side where supported.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/version/sdk-provenance.json Records upgraded SDK version/revision provenance.
go.mod Bumps basecamp-sdk/go to v0.4.0.
go.sum Updates checksums for the new SDK version.
API-COVERAGE.md Notes SDK version and key SDK behavior changes.
internal/tui/workspace/views/search.go Unwraps Search() results from new result struct.
internal/tui/workspace/data/hub_global.go Updates Campfire list/lines + timeline calls to new pagination signatures/result structs.
internal/tui/workspace/data/hub.go Updates Campfire lines, timeline, and boosts calls to new signatures/result structs.
internal/names/resolver.go Updates People().Pingable to use new result struct.
internal/commands/search.go Uses SDK-side limit and unwraps search results.
internal/commands/campfire.go Uses SDK-side limit for campfire messages and updates list signatures.
internal/commands/timeline.go Updates timeline calls for new result struct + pagination opts.
internal/commands/people.go Updates pingable people to new result struct.
internal/commands/boost.go Updates boosts list calls to accept pagination opts.
internal/commands/webhooks.go Updates webhooks list call to accept pagination opts.
internal/commands/todolistgroups.go Updates todolist groups list call to accept pagination opts.
internal/commands/templates.go Updates templates list call to accept pagination opts.
internal/commands/messagetypes.go Updates message types list call to accept pagination opts.
internal/commands/timesheet.go Unwraps timesheet report entries and minor command construction cleanup.

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

jeremy added 3 commits March 11, 2026 01:33
* origin/main:
  Polish boost display and copy (#262)
  Reject whitespace-only content in mutation commands (#238)
…l.go nil opts

- search.go: Change `limit != 0` to `limit > 0` to avoid forwarding
  negative values to the server
- campfire.go: Revert to client-side tail-slicing with nil SDK opts to
  preserve "show most recent N" semantics (SDK server-side Limit may
  return oldest N depending on API ordering)
- detail.go: Add nil opts to ListRecording call added on main after
  branch creation
go mod download -json omits .Time for semver tags. Fall back to the
cached .info file which always includes it. Corrects the stale
updated_at in sdk-provenance.json (was preserving the old pseudo-version
timestamp instead of the v0.4.0 tag time).
Copy link
Copy Markdown
Contributor

@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 5 files (changes from recent commits).

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="internal/commands/campfire.go">

<violation number="1" location="internal/commands/campfire.go:219">
P1: Server-side limit was removed and replaced with client-side slicing, contradicting the PR's stated intent and the pattern used by every other list command. Passing `nil` defaults the SDK to fetching 100 lines (`DefaultCampfireLineLimit`), so `--limit 200` silently caps at 100. Use `CampfireLineListOptions{Limit: limit}` to let the server handle the limit, matching the old behavior and the rest of the codebase.</violation>
</file>

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

@jeremy jeremy merged commit 93cd89b into main Mar 11, 2026
26 checks passed
@jeremy jeremy deleted the sdk-0.4.0 branch March 11, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations deps docs enhancement New feature or request sdk SDK wrapper and provenance tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants