Skip to content

Go SDK: BoostsService, CreateLine content_type, drift check enforcement#84

Merged
jeremy merged 7 commits intomainfrom
bump-gap
Feb 8, 2026
Merged

Go SDK: BoostsService, CreateLine content_type, drift check enforcement#84
jeremy merged 7 commits intomainfrom
bump-gap

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Feb 8, 2026

Summary

Closes the implementation and process gaps from PR #83 (Boosts API sync).

  • BoostsService — 6 methods wrapping the generated Boosts client (ListRecording, ListEvent, Get, CreateRecording, CreateEvent, Delete), with type converter, client wiring, fixtures, and tests
  • CreateLine content_typeCampfiresService.CreateLine now accepts *CreateLineOptions to send text/html or text/plain content; validates the value and rejects arbitrary strings. Adds LineContentTypePlain / LineContentTypeHTML constants
  • Drift check enforcementscripts/check-service-drift.sh now detects wrapped-but-untested operations (warning). go-check-drift added to make check and CI so drift is caught before merge

Test plan

  • go build ./... compiles clean
  • go test ./pkg/basecamp/... -run TestBoost — new boost fixture tests pass
  • go test ./pkg/basecamp/... -run TestCampfire — existing + new campfire tests pass
  • ./scripts/check-service-drift.sh — 6 boost operations now wrapped (8 remaining unwrapped are question/cardcolumn ops, pre-existing)
  • make smithy-check behavior-model-check provenance-check go-check-drift go-check conformance — all pass
  • Pre-existing ts-check failure confirmed on base branch (unrelated node type issue)

Wraps the generated Boosts API client methods added in PR #83:
- ListRecording, ListEvent, Get, CreateRecording, CreateEvent, Delete
- Converter boostFromGenerated maps generated types to clean SDK types
- Lazy-init Boosts() accessor on AccountClient
- Fixture-based tests for unmarshal and request serialization
Add CreateLineOptions parameter to CampfiresService.CreateLine so callers
can send HTML content. Validates content_type is text/plain or text/html.
Adds LineContentTypePlain and LineContentTypeHTML constants.
- Add test coverage detection to check-service-drift.sh (warns on
  wrapped operations with no tests calling the generated client)
- Add go-check-drift to the check target so make catches drift
- Add drift check step to the Go test job in CI
Copilot AI review requested due to automatic review settings February 8, 2026 07:19
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

This PR closes remaining gaps in the Go SDK after the Boosts API sync by adding a first-class BoostsService, extending campfire line creation to support content_type, and enforcing service drift checks in local/CI workflows.

Changes:

  • Add BoostsService (list/get/create/delete) with fixtures and initial tests.
  • Update CampfiresService.CreateLine to accept optional content_type with validation and new constants.
  • Enhance and enforce check-service-drift.sh via make check and GitHub Actions.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
spec/fixtures/boosts/list.json Adds Boosts list fixture used by Go tests.
spec/fixtures/boosts/get.json Adds Boosts get fixture used by Go tests.
scripts/check-service-drift.sh Adds “wrapped but untested” warning detection and temp file handling.
go/pkg/basecamp/example_test.go Updates campfire CreateLine example for new signature.
go/pkg/basecamp/client.go Wires BoostsService into AccountClient.
go/pkg/basecamp/campfires_test.go Adds tests for content_type marshaling and constants.
go/pkg/basecamp/campfires.go Adds content type constants/options and updates CreateLine signature + validation.
go/pkg/basecamp/boosts_test.go Adds Boost model/request JSON fixture tests.
go/pkg/basecamp/boosts.go Introduces BoostsService and generated→clean type conversion.
go/README.md Updates CreateLine example to pass nil options.
Makefile Adds go-check-drift to make check.
.github/workflows/test.yml Runs drift check in Go CI job.

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

Comment thread go/pkg/basecamp/boosts.go
Comment thread go/pkg/basecamp/boosts.go Outdated
Comment thread go/pkg/basecamp/boosts_test.go
Comment thread go/pkg/basecamp/boosts.go
Comment thread scripts/check-service-drift.sh Outdated
Comment thread go/pkg/basecamp/campfires.go Outdated
Comment thread go/pkg/basecamp/campfires_test.go
- Remove unused CreateBoostRequest type (service methods take raw content
  string, matching CreateLine pattern; struct was only used in tests)
- Remove noisy UNTESTED detection from drift check script — tests exercise
  service wrappers, not .gen.* directly, so the grep produced all-false-
  positive output for every wrapped operation
…ion tests

- Change CreateLine signature from *CreateLineOptions to ...CreateLineOptions
  to preserve source compatibility with existing 4-arg callers
- Add service-level validation tests for CampfiresService (empty content,
  invalid content_type, valid content_types, no-options backward compat)
- Add service-level validation tests for BoostsService (empty content
  rejected, valid content accepted)
BoostsService tests (7 new):
- ListRecording: 200 response, X-Total-Count header parsing, converter mapping
- ListRecording empty: 200 with [] body
- Get: 200 with full converter mapping (Booster, Recording)
- Get 404: not_found error
- CreateRecording: 201, verifies request body content wiring
- Delete: 204 success
- Delete 404: not_found error

CampfiresService CreateLine tests (3 new, replacing panic-based tests):
- NoOptions: POST with content only, no content_type in request body
- HTMLOption: content_type=text/html flows through to request body
- PlainOption: content_type=text/plain flows through to request body

Uses testBoostsServer/testCampfiresServer helpers that wire httptest.Server
through NewClient → ForAccount → service, exercising the full call path
including generated client, checkResponse, and type converters.
…ect extra opts

- Fix trailing newline gofmt issue in boosts_test.go
- Remove panic-recovery validation tests (superseded by httptest tests)
- Add httptest tests for ListEvent and CreateEvent (all 6 BoostsService
  operations now have service contract tests)
- Reject len(opts) > 1 in CreateLine with ErrUsage instead of silently
  ignoring extra options
- Fix unparam lint: test helpers return *Service only, not (*Service, *Server)
@jeremy jeremy merged commit 41dc6e1 into main Feb 8, 2026
22 checks passed
@jeremy jeremy deleted the bump-gap branch February 8, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants