feat: maniphest edit --parent/--unparent and --subtask/--unsubtask - #549
Merged
Merged
Conversation
A parent/subtask edge could only be written while creating one of the two tasks, so an existing task could not be put under an existing epic from the CLI (T3679). maniphest edit and phabfive edit take --parent and --subtask to add a link and --unparent and --unsubtask to remove one: a task monogram or PHID, repeatable and comma-separated like --attach and --detach, sent as parents.add/.remove and subtasks.add/.remove with only what changes. maniphest.edit accepts an edge to a PHID that does not exist, so every task is resolved once for the batch before anything is sent. A task named as its own parent or subtask, or as both a parent and a subtask, is refused for that task rather than answered by the server's "Graph cycle detected". The four transactions join IDEMPOTENT_TRANSACTIONS. Closes #548 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #548
maniphest editcould not link two tasks that both already exist: a parent/subtask edge could only be written while creating one of them (maniphest create --parent, or a create spec). So "an existing task belongs under an existing epic" had to be done in the web UI.What changes
maniphest editandphabfive edittake four new options:--parent/--unparentadd or remove a parent--subtask/--unsubtaskadd or remove a subtaskEach takes a task monogram or task PHID, repeatable and comma-separated like
--attach/--detach, and only a change is sent (parents.add/.remove,subtasks.add/.remove).maniphest.editaccepts an edge to a PHID that does not exist, so this lookup is the only check. An unknown task stops the edit before anything is sent.Graph cycle detected (type=3, ...)with raw PHIDs. Longer cycles are still left to the server.IDEMPOTENT_TRANSACTIONS: adding an existing edge or removing a missing one is a no-op.Verified
make up VERSION=phabricator). The edge fields predate the fork, but that is unverified.tests/test_edit_relations.py(31 unit tests), and a new e2e testtest_edit_links_and_unlinks_existing_tasks, run against the local Phorge. Full suite, ruff and mypy are clean.Mirrors T3679 on the Phabricator instance.
🤖 Generated with Claude Code