Conversation
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
There was a problem hiding this comment.
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.CreateLineto accept optionalcontent_typewith validation and new constants. - Enhance and enforce
check-service-drift.shviamake checkand 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.
- 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the implementation and process gaps from PR #83 (Boosts API sync).
ListRecording,ListEvent,Get,CreateRecording,CreateEvent,Delete), with type converter, client wiring, fixtures, and testsCampfiresService.CreateLinenow accepts*CreateLineOptionsto sendtext/htmlortext/plaincontent; validates the value and rejects arbitrary strings. AddsLineContentTypePlain/LineContentTypeHTMLconstantsscripts/check-service-drift.shnow detects wrapped-but-untested operations (warning).go-check-driftadded tomake checkand CI so drift is caught before mergeTest plan
go build ./...compiles cleango test ./pkg/basecamp/... -run TestBoost— new boost fixture tests passgo 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 passts-checkfailure confirmed on base branch (unrelated node type issue)