fix(cards): carry over step title when updating assignees or due date#496
fix(cards): carry over step title when updating assignees or due date#496nnemirovsky wants to merge 5 commits into
Conversation
The step update endpoint rejects requests without a title even though the API docs mark it optional. Updating only assignees or the due date sent a body with no title and the server returned 400 Bad Request. Carry over the current title instead. The step update command fetches the step first when no new title is given. Assign and unassign reuse the step they already fetched.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR ensures step updates always include a title to satisfy the Basecamp API requirement, even when the user only changes other fields (e.g., assignees).
Changes:
- Carry over the current step title during
cards step updatewhen no explicit title is provided. - Include the existing step title when assigning/unassigning step assignees.
- Add tests to verify title carry-over behavior and that unnecessary fetches are skipped when a title is provided.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/commands/cards.go | Fetches current step to populate Title when updating other fields without an explicit title. |
| internal/commands/assign.go | Ensures step assignee updates include Title in the update request. |
| internal/commands/cards_test.go | Adds tests + a mock transport to assert fetch behavior and request payload content. |
💡 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 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Validate that step updates hit the single-step endpoint so a stray call to the wrong path fails the test instead of passing on stale data. Echo the title back in the PUT response and surface IO errors from the mock transport.
Suffix matching keeps the routing assertion while tolerating account ID and prefix changes in the SDK path shape.
The assign and unassign step paths must send the current title or the API rejects the update with 400. Add tests asserting the captured PUT body includes the carried-over title for both paths.
There was a problem hiding this comment.
3 issues found across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Fail on unexpected GET routes, assert the PUT targets the step endpoint, and check assignee_ids is sent as an explicit empty array on unassign.
Problem
basecamp cards step update <id> --assignees <person>always fails with 400 Bad Request. Same forbasecamp assign <id> --stepandbasecamp unassign <id> --step.The server rejects a step update whose body has no
titlekey, even though the API docs list every parameter as optional. All three code paths sent{"assignee_ids": [...]}with no title, so every assignee-only or due-date-only update failed. The same request with the current title included succeeds.Fix
Carry over the current title when the caller does not provide a new one:
cards step update: when invoked without a new title, fetch the step first and reuse its title.assign --step/unassign --step: pass the title of the step object these paths already fetch. No extra request.Tests
Added two unit tests with a capturing mock transport: assignee-only updates fetch the step once and send its current title, and explicit-title updates skip the fetch and send the new title as-is.
bin/ciis green.Summary by cubic
Carry over the current step title when updating only assignees or the due date to prevent 400 Bad Request errors. This fixes
basecamp cards step update,basecamp assign --step, andbasecamp unassign --stepwhen no new title is given.cards step update: if no title is provided, fetch the step and include its current title in the update.assign --step/unassign --step: includestep.Titlein the update without extra requests; sendassignee_ids: []explicitly on unassign.Written for commit 84c2c5f. Summary will update on new commits.