Skip to content

Fix campfire list on multi-campfire projects#275

Merged
jeremy merged 3 commits intomainfrom
multi-campfire
Mar 12, 2026
Merged

Fix campfire list on multi-campfire projects#275
jeremy merged 3 commits intomainfrom
multi-campfire

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • campfire list --in <project> failed with CodeAmbiguous on projects with multiple campfires because it routed through getDockToolID, which requires a single match
  • Rewrite the project-scoped list path to fetch the dock directly and return all enabled chat entries (mirrors the todosets list pattern)
  • Thread the -c flag into newCampfireListCmd so campfire list -c <id> works
  • Update agent_notes to reflect that projects may have multiple campfires

Fixes card

Design note

campfire list intentionally bypasses getDockToolID because listing must enumerate all chat dock entries in a project. Single-campfire commands (messages, post, upload, line, delete) still use the existing getCampfireIDgetDockToolID disambiguation path, which requires -c when multiple campfires exist.

Test plan

  • bin/ci green
  • TestCampfireListMultipleCampfires — 2 campfires returned, no ambiguous error
  • TestCampfireListWithCampfireFlag-c <id> filters to single campfire
  • TestCampfireListNoCampfires — not-found error with "no campfire" hint
  • TestCampfireListDisabledCampfire — not-found error with "disabled" hint
  • Manual: basecamp campfire list --in 37331921 --json — returns both Fizzy campfires
  • Manual: basecamp campfire list -c 9301300227 --in 37331921 --json — returns only "Chatter"

jeremy added 2 commits March 11, 2026 16:18
…ojects

`campfire list --in <project>` routed through `getDockToolID` which errors
with CodeAmbiguous when a project has more than one campfire. Rewrite the
project-scoped list path to fetch the dock directly and return all enabled
chat entries (mirroring the `todosets list` pattern). Thread the `-c` flag
into the list command so `campfire list -c <id>` works. Update agent_notes
to reflect that projects may have multiple campfires.
Cover the new campfire list flow: multiple campfires returned without
ambiguous error, -c flag filtering to a single campfire, not-found when
no chat entries exist, and disabled-campfire hint.
@jeremy jeremy requested a review from a team as a code owner March 11, 2026 23:18
Copilot AI review requested due to automatic review settings March 11, 2026 23:18
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) bug Something isn't working labels Mar 11, 2026
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 fixes campfire list --in <project> failing with CodeAmbiguous on projects with multiple campfires. The root cause was that the list command routed through getDockToolID, which errors when multiple dock entries match.

Changes:

  • Rewrote the project-scoped campfire list path to fetch the dock directly and return all enabled chat entries (mirroring the todosets list pattern)
  • Threaded the -c flag into newCampfireListCmd so campfire list -c <id> works to filter to a single campfire
  • Added comprehensive tests for multi-campfire, single campfire flag, no campfires, and disabled campfire scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/commands/campfire.go Rewrote runCampfireList to fetch project dock directly, iterate over all chat entries, and support -c flag filtering; extracted campfireTitle and campfireListBreadcrumbs helpers; updated agent_notes annotation
internal/commands/campfire_test.go Added 4 tests covering multi-campfire listing, -c flag, no campfires, and disabled campfire error cases; added reusable newTestAppWithTransport helper and mock transports

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

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.

3 issues found across 2 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/campfire_test.go">

<violation number="1" location="internal/commands/campfire_test.go:333">
P2: `assert.Len` does not halt the test on failure. If `Data` has fewer than 2 elements, the next line panics with an index-out-of-range instead of a clean failure. Use `require.Len` here since subsequent lines depend on the length.</violation>

<violation number="2" location="internal/commands/campfire_test.go:353">
P2: Same issue: `assert.Len` won't halt the test, and the next line indexes into `Data[0]` unconditionally. Use `require.Len` to guard against a panic.</violation>
</file>

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

<violation number="1" location="internal/commands/campfire.go:146">
P3: Reuse the existing `DockTool` type from helpers.go instead of re-declaring an identical anonymous struct. The same package already defines and exports this type with identical fields.</violation>
</file>

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

Use the existing DockTool type from helpers.go instead of redeclaring an
identical anonymous struct. Switch assert.Len to require.Len where
subsequent lines index into the result, preventing panics on failure.
@github-actions github-actions bot added the breaking Breaking change label Mar 11, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Potential breaking changes detected:

  • The campfire list command now supports an additional --campfire (-c) flag, which modifies its behavior. If scripts were not designed to account for this flag, they might behave differently or fail when receiving unexpected input or outputs.
  • The output of campfire list now includes multiple campfires instead of just one. This change in the output format may break scripts or tools relying on the previous single-campfire output structure.

Review carefully before merging. Consider a major version bump.

@jeremy jeremy merged commit 7ff2a44 into main Mar 12, 2026
26 checks passed
@jeremy jeremy deleted the multi-campfire branch March 12, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change bug Something isn't working commands CLI command implementations tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants