@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When publishing a commit, copy "Related Tasks" from the associated revision (if one exists)

Summary:
Fixes T13463. Currently, if you use the web UI to set "Related Tasks" for a revision, the resulting commit does not link to the tasks.

If you use "Ref ..." in the message instead, the resulting commit does link to the tasks.

Broadly, this should all be cleaner (see T3577) but we can step toward better behavior by just copying these edges when commits are published.

Test Plan:
- Created a revision.
- Used the web UI to edit "Related Tasks".
- Landed the revision.
- Saw the commit link to the tasks as though I'd used "Ref ..." in the message.

Maniphest Tasks: T13463

Differential Revision: https://secure.phabricator.com/D20961

+25
+25
src/applications/audit/editor/PhabricatorAuditEditor.php
··· 405 405 $phid_map[] = $reverted_phids; 406 406 } 407 407 408 + // See T13463. Copy "related task" edges from the associated revision, if 409 + // one exists. 410 + 411 + $revision = DiffusionCommitRevisionQuery::loadRevisionForCommit( 412 + $actor, 413 + $object); 414 + if ($revision) { 415 + $task_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 416 + $revision->getPHID(), 417 + DifferentialRevisionHasTaskEdgeType::EDGECONST); 418 + $task_phids = array_fuse($task_phids); 419 + 420 + if ($task_phids) { 421 + $related_edge = DiffusionCommitHasTaskEdgeType::EDGECONST; 422 + $result[] = id(new PhabricatorAuditTransaction()) 423 + ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) 424 + ->setMetadataValue('edge:type', $related_edge) 425 + ->setNewValue(array('+' => $task_phids)); 426 + } 427 + 428 + // Mark these objects as unmentionable, since the explicit relationship 429 + // is stronger and any mentions are redundant. 430 + $phid_map[] = $task_phids; 431 + } 432 + 408 433 $phid_map = array_mergev($phid_map); 409 434 $this->addUnmentionablePHIDs($phid_map); 410 435