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

Enrich the "change project tags" transaction in "transaction.search"

Summary:
Depends on D20208. Ref T13255. See that task for some long-winded discussion and rationale. Short version:

- This is a list of operations instead of a list of old/new PHIDs because of scalability issues for large lists (T13056).
- This is a fairly verbose list (instead of, for example, the more concise internal map we sometimes use with "+" and "-" as keys) to try to make the structure obvious and extensible in the future.
- The "add" and "remove" echo the `*.edit` operations.

Test Plan: Called `transaction.search` on an object with project tag changes, saw them in the results.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13255

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

+32
+32
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
··· 202 202 case PhabricatorTransactions::TYPE_CREATE: 203 203 $type = 'create'; 204 204 break; 205 + case PhabricatorTransactions::TYPE_EDGE: 206 + switch ($xaction->getMetadataValue('edge:type')) { 207 + case PhabricatorProjectObjectHasProjectEdgeType::EDGECONST: 208 + $type = 'projects'; 209 + $fields = $this->newEdgeTransactionFields($xaction); 210 + break; 211 + } 212 + break; 205 213 } 206 214 } 207 215 ··· 264 272 return $query; 265 273 } 266 274 275 + private function newEdgeTransactionFields( 276 + PhabricatorApplicationTransaction $xaction) { 277 + 278 + $record = PhabricatorEdgeChangeRecord::newFromTransaction($xaction); 279 + 280 + $operations = array(); 281 + foreach ($record->getAddedPHIDs() as $phid) { 282 + $operations[] = array( 283 + 'operation' => 'add', 284 + 'phid' => $phid, 285 + ); 286 + } 287 + 288 + foreach ($record->getRemovedPHIDs() as $phid) { 289 + $operations[] = array( 290 + 'operation' => 'remove', 291 + 'phid' => $phid, 292 + ); 293 + } 294 + 295 + return array( 296 + 'operations' => $operations, 297 + ); 298 + } 267 299 268 300 }