Repository navigation
feat(branch): add --clickup to create a branch from a ClickUp task - #175
Conversation
…action Phase 1 of #129. src/integrations/clickup.ts parses short and custom task ids, fetches a task with the bare personal token under a 15 s bound, maps 401/403, 404, 429, other non-2xx and malformed bodies to distinct ClickUp messages, and derives the branch name from the typed id and the task's tags. clickup.apiToken (secret) and clickup.workspaceId join the config keys and validators, and redactSecrets masks the pk_ token shape. Gate 1: pnpm check, typecheck, docs typecheck, build, test (1286), docs:test (69) and the test-marker grep all exit 0. Gate 2: reviewer subagent, PASS WITH NOTES after one loopback (a test pinning that the branch segment follows the typed id).
Phase 2 of #129. worktree config gains a ClickUp group: one confirm, the clickup.apiToken prompt (no default or prefill; an empty answer keeps the stored token; non-interactive runs name `worktree config clickup.apiToken <token>`) and an optional clickup.workspaceId prompt that an empty answer skips. config --list masks the token. Landed from the round's phase tree (base 6f37585, tip a4da4e7). Gate 1: pnpm check, typecheck, docs typecheck, build, test (1301), docs:test (69) and the test-marker grep all exit 0. Gate 2: reviewer subagent, PASS WITH NOTES.
Phase 3 of #129. worktree branch gains --clickup <task-id> (-c), exclusive with --github, --jira and --linear. It requires clickup.apiToken, derives the branch from the task (CU-<id> for a short id, the custom id for a custom one, prefix from tags), and reports issue {provider:"clickup", key, url} in --json. --assign --clickup warns that assignment is not supported yet. Landed from the round's phase tree (base 6f37585, tip 4b19a93), plus one loopback test in this tree. Gate 1: pnpm check, typecheck, docs typecheck, build, test (1317), docs:test (69) and the test-marker grep all exit 0. Gate 2: reviewer subagent, PASS WITH NOTES after one loopback (a test pinning that issue.key is the task's custom_id, not the typed id).
Phase 4 of #129. A new ClickUp integration guide (both id kinds, how names are built, the tag rule, token and workspace id setup, and what is not verified yet), plus ClickUp beside Linear in the README, the shipped worktree skill, the branch, config and configuration pages, the guides index, the chat route map (docs-routes.generated.ts regenerated) and context/stack.md. The README's ClickUp checkbox is checked. No changeset: context/release.md writes the note once per feature, at /feature-close, which overrides the plan's Phase 4 Files line. Gate 1: pnpm check, typecheck, docs typecheck, build, test (1317), docs:test (69) and the test-marker grep all exit 0. Gate 2: reviewer subagent, PASS WITH NOTES after one loopback (custom ids are sent to ClickUp as typed, not "in any case"); two follow-up one-line doc fixes from its notes read by the host.
There was a problem hiding this comment.
code-reviewer: minor issues
This adds worktree branch --clickup <ID> with its ClickUp client, the clickup.apiToken and clickup.workspaceId config keys, the wizard group, token redaction, and docs, skill and README updates. The change is sound. The base URL is fixed, so the token only ever goes to ClickUp; ids are checked against a closed pattern and encoded before any request; the workspace id is encoded in the query; and a missing token or workspace id fails as missing_value before anything is created. The new paths have thorough tests, and the documentation surfaces listed in context/stack.md were all updated in the same change. My only point is minor: a body read that times out is reported under the wrong error code.
Reviewed 2fb611b for baldurpan · claude-opus-5-5 · 26 files · $0.71
The fetch signal also bounds reading the body, so a response whose headers arrive in time but whose body stalls rejects response.json() with a TimeoutError. readBody swallowed it and the user saw 'Unexpected response' with code failed, where the docs promise timeout. It now rethrows the same 'did not answer within 15s' error fetchClickUp raises.
craig-o-curtis
left a comment
There was a problem hiding this comment.
Approving. Read the diff against 2fb611b; CI is green so I didn't rerun the gates.
Checked specifically:
- Token goes only to the fixed
https://api.clickup.com/api/v2base; ids are matched against a closed pattern andencodeURIComponent'd;workspaceIdis digits-only in both the wizard andconfig <key> <value>, and encoded in the query. - Missing token fails as
missing_valuebefore the worktree exists; missing workspace id for a custom id also fails beforegitCreateWorktree. clickup.apiTokenis inSECRET_CONFIG_NAMESandpk_…is in the redaction shapes; the wizard never echoes the stored token as a default.-cdoesn't collide with any other flag onbranchor the base command.minoris right: new flag and new config keys.- Docs surfaces from
context/stack.mdare all touched (README, command/config/configuration pages, new guide,_meta, chat route map + generated routes, skill).
Non-blocking:
- The body-read timeout the review bot raised is shared by all four integrations (replied on the thread). Worth one follow-up issue rather than a ClickUp-only fix.
- A short task id that happens to look like
ABC-123is parsed as a custom id. ClickUp shows short ids asCU-<id>in some places, so someone pastingCU-8675309would hit the custom-id path and be asked for a workspace id. Probably fine and #173 covers id shapes, but worth confirming there.
|
@craig-o-curtis on the |
|
@baldurpan Thanks, both settled. Leaving the |
Summary
Adds
worktree branch --clickup <ID>, which starts a worktree from a ClickUp task, withclickup.apiTokenandclickup.workspaceIdconfig keys set byworktree config. The plan is #129.Phases
worktree configClickUp prompt group (069bf9e)--clickuponworktree branch(0e0fe7f)The release note is
.changeset/clickup-support.md(minor). The final commit adds it and removes the branch'scontext/notes.md.Not yet checked against a real ClickUp Workspace
Nothing in the repository can call ClickUp, so every response and error shape comes from its documentation. Four owner checks are filed: #171 (live run), #172 (tag rules), #173 (id shapes), #174 (error responses).
Closes #129