Skip to content

Migrate webhooks.go to use SDK WebhooksService - #58

Merged
jeremy merged 1 commit into
mainfrom
sdk-webhooks
Jan 26, 2026
Merged

Migrate webhooks.go to use SDK WebhooksService#58
jeremy merged 1 commit into
mainfrom
sdk-webhooks

Conversation

@jeremy

@jeremy jeremy commented Jan 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace direct API calls with SDK WebhooksService methods (List, Get, Create, Update, Delete)
  • Use typed basecamp.Webhook and request structs instead of raw JSON
  • Apply consistent error handling with convertSDKError

Test plan

  • make check passes (vet, lint, tests)

Replace direct API calls with SDK WebhooksService methods:
- List, Get, Create, Update, Delete webhooks via SDK
- Use basecamp.Webhook type and request structs
- Apply consistent error handling with convertSDKError
@jeremy
jeremy merged commit d3388c8 into main Jan 26, 2026
8 checks passed
@jeremy
jeremy deleted the sdk-webhooks branch January 26, 2026 01:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f309908276

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +230 to 233
} else {
// Default to all types if not specified
typeArray = []string{"Todo", "Todolist", "Message", "Comment", "Document", "Upload", "Vault", "Schedule::Entry", "Kanban::Card", "Question", "Question::Answer"}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve server default webhook types

If the API’s default behavior for a missing types field is “all supported types,” hard-coding a fixed list changes semantics: bcq webhooks create without --types will silently omit any event types the server adds later (or any account-specific types), so those events never fire. This regression happens whenever Basecamp introduces new webhook types beyond this list. Consider leaving Types unset when the flag is omitted so the server can supply its current default set.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in PR #73 - removed hard-coded default types. Now when --types is not specified, we leave Types nil so the server uses its default set.

jeremy added a commit that referenced this pull request Jan 26, 2026
Fixes for Codex review comments:

1. webhooks.go: Let server use default webhook types instead of hard-coding
   (PR #58 feedback)

2. templates.go: Use raw API for archived/trashed status since SDK List()
   only returns active templates (PR #60 feedback)

3. campfire.go: Validate ParseInt errors before DeleteLine to avoid
   silent 0 IDs (PR #64 feedback)

4. recordings.go: Add comment clarifying that Unarchive() works for both
   archived AND trashed recordings via status/active endpoint (PR #68)

5. files.go: Preserve SDK errors in auto-detect mode instead of masking
   auth/permission errors as "not found" (PR #70 feedback)
jeremy added a commit that referenced this pull request Jan 26, 2026
Fixes for Codex review comments:

1. webhooks.go: Let server use default webhook types instead of hard-coding
   (PR #58 feedback)

2. templates.go: Use raw API for archived/trashed status since SDK List()
   only returns active templates (PR #60 feedback)

3. campfire.go: Validate ParseInt errors before DeleteLine to avoid
   silent 0 IDs (PR #64 feedback)

4. recordings.go: Add comment clarifying that Unarchive() works for both
   archived AND trashed recordings via status/active endpoint (PR #68)

5. files.go: Preserve SDK errors in auto-detect mode instead of masking
   auth/permission errors as "not found" (PR #70 feedback)
jeremy added a commit that referenced this pull request Feb 19, 2026
Replace direct API calls with SDK WebhooksService methods:
- List, Get, Create, Update, Delete webhooks via SDK
- Use basecamp.Webhook type and request structs
- Apply consistent error handling with convertSDKError
jeremy added a commit that referenced this pull request Feb 19, 2026
Fixes for Codex review comments:

1. webhooks.go: Let server use default webhook types instead of hard-coding
   (PR #58 feedback)

2. templates.go: Use raw API for archived/trashed status since SDK List()
   only returns active templates (PR #60 feedback)

3. campfire.go: Validate ParseInt errors before DeleteLine to avoid
   silent 0 IDs (PR #64 feedback)

4. recordings.go: Add comment clarifying that Unarchive() works for both
   archived AND trashed recordings via status/active endpoint (PR #68)

5. files.go: Preserve SDK errors in auto-detect mode instead of masking
   auth/permission errors as "not found" (PR #70 feedback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant