Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15405306
D21207.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21207.diff
View Options
diff --git a/src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php b/src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php
@@ -385,4 +385,64 @@
return $errors;
}
+
+ public function getTransactionTypeForConduit($xaction) {
+ return 'reviewers';
+ }
+
+ public function getFieldValuesForConduit($xaction, $data) {
+ $old_value = $xaction->getOldValue();
+ $new_value = $xaction->getNewValue();
+
+ $status_blocking = DifferentialReviewerStatus::STATUS_BLOCKING;
+
+ $add_phids = array_diff_key($new_value, $old_value);
+ foreach ($add_phids as $add_phid => $value) {
+ $add_phids[$add_phid] = array(
+ 'operation' => 'add',
+ 'phid' => $add_phid,
+ 'oldStatus' => null,
+ 'newStatus' => $value,
+ 'isBlocking' => ($value === $status_blocking),
+ );
+ }
+
+ $rem_phids = array_diff_key($old_value, $new_value);
+ foreach ($rem_phids as $rem_phid => $value) {
+ $rem_phids[$rem_phid] = array(
+ 'operation' => 'remove',
+ 'phid' => $rem_phid,
+ 'oldStatus' => $value,
+ 'newStatus' => null,
+ 'isBlocking' => false,
+ );
+ }
+
+ $mod_phids = array_intersect_key($old_value, $new_value);
+ foreach ($mod_phids as $mod_phid => $ignored) {
+ $old = $old_value[$mod_phid];
+ $new = $new_value[$mod_phid];
+
+ if ($old === $new) {
+ unset($mod_phids[$mod_phid]);
+ continue;
+ }
+
+ $mod_phids[$mod_phid] = array(
+ 'operation' => 'update',
+ 'phid' => $mod_phid,
+ 'oldStatus' => $old,
+ 'newStatus' => $new,
+ 'isBlocking' => ($new === $status_blocking),
+ );
+ }
+
+ $all_ops = $add_phids + $rem_phids + $mod_phids;
+ $all_ops = array_select_keys($all_ops, $new_value) + $all_ops;
+ $all_ops = array_values($all_ops);
+
+ return array(
+ 'operations' => $all_ops,
+ );
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 11:03 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7315845
Default Alt Text
D21207.diff (2 KB)
Attached To
Mode
D21207: Provide detailed information about reviewer changes in "transaction.search"
Attached
Detach File
Event Timeline
Log In to Comment