Skip to content

Migrate campfire.go to use SDK CampfiresService - #64

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

Migrate campfire.go to use SDK CampfiresService#64
jeremy merged 1 commit into
mainfrom
sdk-campfires

Conversation

@jeremy

@jeremy jeremy commented Jan 26, 2026

Copy link
Copy Markdown
Member

Replace direct API calls with SDK methods:

  • Use app.SDK.Campfires().List() for account-wide listing
  • Use app.SDK.Campfires().Get() for single campfire details
  • Use app.SDK.Campfires().ListLines() for messages
  • Use app.SDK.Campfires().GetLine() for single message
  • Use app.SDK.Campfires().CreateLine() for posting messages
  • Use app.SDK.Campfires().DeleteLine() for deletion

Remove local CampfireLine struct in favor of basecamp.CampfireLine
from the SDK.

@jeremy
jeremy force-pushed the sdk-campfires branch 2 times, most recently from 698d83e to 2f1b0d7 Compare January 26, 2026 02:21

@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: b3497d5894

ℹ️ 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 +468 to +470
bucketID, _ := strconv.ParseInt(resolvedProjectID, 10, 64)
campfireIDInt, _ := strconv.ParseInt(effectiveCampfireID, 10, 64)
lineIDInt, _ := strconv.ParseInt(lineID, 10, 64)

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 Validate numeric IDs before DeleteLine call

Here the strconv.ParseInt calls ignore their errors, so a non-numeric --campfire, lineID, or an unexpected non-numeric resolvedProjectID will silently become 0 and the SDK call will target bucket/campfire/line ID 0. That shifts a user input error into a potentially wrong delete (or at least a confusing 404) rather than a clear usage error. It would be safer to check the parse errors and fail fast before calling DeleteLine.

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 - added proper error checking for ParseInt calls and return usage errors for invalid IDs.

Replace direct API calls with SDK methods:
- Use app.SDK.Campfires().List() for account-wide listing
- Use app.SDK.Campfires().Get() for single campfire details
- Use app.SDK.Campfires().ListLines() for messages
- Use app.SDK.Campfires().GetLine() for single message
- Use app.SDK.Campfires().CreateLine() for posting messages
- Use app.SDK.Campfires().DeleteLine() for deletion

Remove local CampfireLine struct in favor of basecamp.CampfireLine
from the SDK.
@jeremy
jeremy merged commit c8924d9 into main Jan 26, 2026
8 checks passed
@jeremy
jeremy deleted the sdk-campfires branch January 26, 2026 02:24
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 methods:
- Use app.SDK.Campfires().List() for account-wide listing
- Use app.SDK.Campfires().Get() for single campfire details
- Use app.SDK.Campfires().ListLines() for messages
- Use app.SDK.Campfires().GetLine() for single message
- Use app.SDK.Campfires().CreateLine() for posting messages
- Use app.SDK.Campfires().DeleteLine() for deletion

Remove local CampfireLine struct in favor of basecamp.CampfireLine
from the SDK.
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