@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.

Expose "commits.add|set|remove" on "maniphest.edit" API calls

Summary: See PHI1396. Ideally this would be some kind of general-purpose tie-in to object relationships, but see D18456 for precedent.

Test Plan: Used `maniphest.edit` to edit associated commits for a task.

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

+20 -1
+20 -1
src/applications/maniphest/editor/ManiphestEditEngine.php
··· 261 261 262 262 $parent_type = ManiphestTaskDependedOnByTaskEdgeType::EDGECONST; 263 263 $subtask_type = ManiphestTaskDependsOnTaskEdgeType::EDGECONST; 264 + $commit_type = ManiphestTaskHasCommitEdgeType::EDGECONST; 264 265 265 266 $src_phid = $object->getPHID(); 266 267 if ($src_phid) { ··· 270 271 array( 271 272 $parent_type, 272 273 $subtask_type, 274 + $commit_type, 273 275 )); 274 276 $edge_query->execute(); 275 277 ··· 280 282 $subtask_phids = $edge_query->getDestinationPHIDs( 281 283 array($src_phid), 282 284 array($subtask_type)); 285 + 286 + $commit_phids = $edge_query->getDestinationPHIDs( 287 + array($src_phid), 288 + array($commit_type)); 283 289 } else { 284 290 $parent_phids = array(); 285 291 $subtask_phids = array(); 292 + $commit_phids = array(); 286 293 } 287 294 288 295 $fields[] = id(new PhabricatorHandlesEditField()) ··· 307 314 ->setIsFormField(false) 308 315 ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) 309 316 ->setMetadataValue('edge:type', $subtask_type) 310 - ->setValue($parent_phids); 317 + ->setValue($subtask_phids); 318 + 319 + $fields[] = id(new PhabricatorHandlesEditField()) 320 + ->setKey('commits') 321 + ->setLabel(pht('Commits')) 322 + ->setDescription(pht('Related commits.')) 323 + ->setConduitDescription(pht('Change the related commits for this task.')) 324 + ->setConduitTypeDescription(pht('List of related commit PHIDs.')) 325 + ->setUseEdgeTransactions(true) 326 + ->setIsFormField(false) 327 + ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) 328 + ->setMetadataValue('edge:type', $commit_type) 329 + ->setValue($commit_phids); 311 330 312 331 return $fields; 313 332 }