Conversation
There was a problem hiding this comment.
Pull request overview
Adds a --by <person> flag to basecamp checkins answers so callers can fetch a single person’s check-in answers via the API’s native per-person endpoint (instead of fetching all answers and filtering client-side).
Changes:
- Add
--byflag tocheckins answersand route toListAnswersByUserwhen set. - Add a command test asserting the per-person answers endpoint path is used.
- Update skill docs and CLI surface snapshot to reflect the new flag.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
internal/commands/checkins.go |
Implements --by flag and switches API call to the per-person answers endpoint. |
internal/commands/checkins_test.go |
Adds coverage ensuring the expected per-person API route is invoked. |
skills/basecamp/SKILL.md |
Documents --by usage examples for check-in answers. |
.surface |
Updates snapshot to include the new --by flag in surfaced CLI metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
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/checkins.go">
<violation number="1" location="internal/commands/checkins.go:607">
P2: Treat explicitly empty `--by` values as invalid; this condition currently misses `--by=` and falls back to the unfiltered endpoint.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| if err != nil { | ||
| return convertSDKError(err) | ||
| trimmedBy := strings.TrimSpace(by) | ||
| if by != "" && trimmedBy == "" { |
There was a problem hiding this comment.
P2: Treat explicitly empty --by values as invalid; this condition currently misses --by= and falls back to the unfiltered endpoint.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/commands/checkins.go, line 607:
<comment>Treat explicitly empty `--by` values as invalid; this condition currently misses `--by=` and falls back to the unfiltered endpoint.</comment>
<file context>
@@ -603,9 +603,14 @@ Use --by to filter answers by a specific person (name, email, ID, or "me"):
}
+ trimmedBy := strings.TrimSpace(by)
+ if by != "" && trimmedBy == "" {
+ return output.ErrUsage("--by value cannot be blank")
+ }
</file context>
Summary
Closes #443
Adds a
--by <person>flag tobasecamp checkins answersto filter results to a single person's answers, using the BC3 API's native per-person endpoint (GET /questions/{id}/answers/by/{personId}.json) rather than fetching all answers and filtering client-side.The flag accepts a person name, email address, numeric ID, or the special value
"me"(resolves to the authenticated user):All existing flags (
--limit,--all,--page) work with--byand apply against the already-filtered result set.Changes
internal/commands/checkins.go—--byflag onnewCheckinsAnswersCmd; routes toListAnswersByUserwhen setinternal/commands/checkins_test.go—TestCheckinsAnswersByPersonFlagverifying the correct API path is calledskills/basecamp/SKILL.md— documented--byusage examples.surface— snapshot updated for the new flagDependencies
Depends on basecamp/basecamp-sdk#276 adding
ListAnswersByUserto the Go SDK. Once that PR is merged and the SDK is tagged, this PR needsmake bump-sdkbefore merging.Summary by cubic
Adds a
--byflag tobasecamp checkins answersto fetch a single person’s answers via the BC3 per-person endpoint. Accepts name, email, numeric ID, or "me", works with pagination, and trims whitespace with validation for blank values.New Features
--by; usesGET /questions/{id}/answers/by/{personId}.json.--byvalues; resolves names/emails to IDs.Dependencies
basecamp/basecamp-sdk#276forListAnswersByUser. After it’s tagged, runmake bump-sdkbefore merging.Written for commit c22c08c. Summary will update on new commits.