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

Provide detailed information about reviewer changes in "transaction.search"

Summary:
See PHI1722, which requests transaction details about reviewer changes.

This adds them; they're structured to be similar to "projects" and "subscribers" transactions and the "reviewers" attachment on revisions.

Test Plan: {F7410675}

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

+60
+60
src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php
··· 385 385 return $errors; 386 386 } 387 387 388 + 389 + public function getTransactionTypeForConduit($xaction) { 390 + return 'reviewers'; 391 + } 392 + 393 + public function getFieldValuesForConduit($xaction, $data) { 394 + $old_value = $xaction->getOldValue(); 395 + $new_value = $xaction->getNewValue(); 396 + 397 + $status_blocking = DifferentialReviewerStatus::STATUS_BLOCKING; 398 + 399 + $add_phids = array_diff_key($new_value, $old_value); 400 + foreach ($add_phids as $add_phid => $value) { 401 + $add_phids[$add_phid] = array( 402 + 'operation' => 'add', 403 + 'phid' => $add_phid, 404 + 'oldStatus' => null, 405 + 'newStatus' => $value, 406 + 'isBlocking' => ($value === $status_blocking), 407 + ); 408 + } 409 + 410 + $rem_phids = array_diff_key($old_value, $new_value); 411 + foreach ($rem_phids as $rem_phid => $value) { 412 + $rem_phids[$rem_phid] = array( 413 + 'operation' => 'remove', 414 + 'phid' => $rem_phid, 415 + 'oldStatus' => $value, 416 + 'newStatus' => null, 417 + 'isBlocking' => false, 418 + ); 419 + } 420 + 421 + $mod_phids = array_intersect_key($old_value, $new_value); 422 + foreach ($mod_phids as $mod_phid => $ignored) { 423 + $old = $old_value[$mod_phid]; 424 + $new = $new_value[$mod_phid]; 425 + 426 + if ($old === $new) { 427 + unset($mod_phids[$mod_phid]); 428 + continue; 429 + } 430 + 431 + $mod_phids[$mod_phid] = array( 432 + 'operation' => 'update', 433 + 'phid' => $mod_phid, 434 + 'oldStatus' => $old, 435 + 'newStatus' => $new, 436 + 'isBlocking' => ($new === $status_blocking), 437 + ); 438 + } 439 + 440 + $all_ops = $add_phids + $rem_phids + $mod_phids; 441 + $all_ops = array_select_keys($all_ops, $new_value) + $all_ops; 442 + $all_ops = array_values($all_ops); 443 + 444 + return array( 445 + 'operations' => $all_ops, 446 + ); 447 + } 388 448 }