Skip to content

Add --project to document update#248

Open
schpetbot wants to merge 1 commit into
mainfrom
schpet/push-puonzpzkwunw
Open

Add --project to document update#248
schpetbot wants to merge 1 commit into
mainfrom
schpet/push-puonzpzkwunw

Conversation

@schpetbot

Copy link
Copy Markdown
Collaborator

What

document create accepts --project, but document update didn't — so a document's project attachment was fixed at creation time; changing it meant using the web UI. This adds --project <uuid|slug|name> to document update, reusing the same resolveProjectId path as create (consistent resolution and not-found errors).

linear document update <id> --project F-FOO          # by slug ID
linear document update <id> --project "Some Project" # by name
linear document update <id> --project <uuid>         # by UUID

On the reporter's --remove / multi-link framing

The issue framed this around Linear's web UI supporting multiple project links per document with add/remove semantics (--project X --remove). The API models it differently: a Document has a single related project (the scalar DocumentUpdateInput.projectId; there's no document-links mutation), and document create requires exactly one anchor — so a document always has one project and setting simply replaces it.

I prototyped a --clear-project detach flag, but live testing showed the API silently ignores projectId: null (returns success while keeping the project). Shipping it would have been a silent no-op, so it was dropped rather than lie about detaching. Re-pointing to a different project works and is verified end-to-end.

Tests

Command snapshots for set-by-UUID, set-by-name (resolution + mutation), combined --title + --project, and project-not-found. Manually QA'd against a live workspace (create → change by UUID → change by name → confirmed the API ignores clear).

Fixes #225

`document create` accepts --project but `document update` did not, so a
document's project attachment was fixed at creation time — changing it required
the web UI. Add --project to update (UUID, slug ID, or name), reusing the same
resolveProjectId path as create so resolution and errors stay consistent.

The reporter framed this around Linear's web UI supporting multiple project
links per document with add/remove semantics (--project X --remove). The API
tells a different story: a Document has a single related project (the scalar
DocumentUpdateInput.projectId), and create requires exactly one anchor — so a
document always has one project and setting merely replaces it. A detach flag
was prototyped, but live testing showed the API silently ignores
`projectId: null` (returns success, keeps the project), so shipping it would
have been a silent no-op; it was dropped rather than lie about detaching.

Github-Issue: Fixes #225
Github-Issue-Url: #225
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.

document update lacks --project flag (can't re-link or add project attachments via CLI)

2 participants