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

Record which cluster host received a push

Summary: Ref T4292. When we write a push log, also log which node received the request.

Test Plan: {F1230467}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4292

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

+39 -1
+2
resources/sql/autopatches/20160419.pushlog.1.sql
··· 1 + ALTER TABLE {$NAMESPACE}_repository.repository_pushlog 2 + ADD devicePHID VARBINARY(64);
+8
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
··· 1058 1058 // up. 1059 1059 $phid = id(new PhabricatorRepositoryPushLog())->generatePHID(); 1060 1060 1061 + $device = AlmanacKeys::getLiveDevice(); 1062 + if ($device) { 1063 + $device_phid = $device->getPHID(); 1064 + } else { 1065 + $device_phid = null; 1066 + } 1067 + 1061 1068 return PhabricatorRepositoryPushLog::initializeNewLog($this->getViewer()) 1062 1069 ->setPHID($phid) 1070 + ->setDevicePHID($device_phid) 1063 1071 ->setRepositoryPHID($this->getRepository()->getPHID()) 1064 1072 ->attachRepository($this->getRepository()) 1065 1073 ->setEpoch(time());
+21
src/applications/diffusion/view/DiffusionPushLogListView.php
··· 38 38 } 39 39 40 40 $rows = array(); 41 + $any_host = false; 41 42 foreach ($logs as $log) { 42 43 $repository = $log->getRepository(); 43 44 ··· 59 60 $log->getRefOldShort()); 60 61 } 61 62 63 + $device_phid = $log->getDevicePHID(); 64 + if ($device_phid) { 65 + $device = $handles[$device_phid]->renderLink(); 66 + $any_host = true; 67 + } else { 68 + $device = null; 69 + } 70 + 62 71 $rows[] = array( 63 72 phutil_tag( 64 73 'a', ··· 75 84 $handles[$log->getPusherPHID()]->renderLink(), 76 85 $remote_address, 77 86 $log->getPushEvent()->getRemoteProtocol(), 87 + $device, 78 88 $log->getRefType(), 79 89 $log->getRefName(), 80 90 $old_ref_link, ··· 100 110 pht('Pusher'), 101 111 pht('From'), 102 112 pht('Via'), 113 + pht('Host'), 103 114 pht('Type'), 104 115 pht('Name'), 105 116 pht('Old'), ··· 116 127 '', 117 128 '', 118 129 '', 130 + '', 119 131 'wide', 120 132 'n', 121 133 'n', 122 134 'right', 135 + )) 136 + ->setColumnVisibility( 137 + array( 138 + true, 139 + true, 140 + true, 141 + true, 142 + true, 143 + $any_host, 123 144 )); 124 145 125 146 return $table;
+6 -1
src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
··· 95 95 protected function getRequiredHandlePHIDsForResultList( 96 96 array $logs, 97 97 PhabricatorSavedQuery $query) { 98 - return mpull($logs, 'getPusherPHID'); 98 + $phids = array(); 99 + $phids[] = mpull($logs, 'getPusherPHID'); 100 + $phids[] = mpull($logs, 'getDevicePHID'); 101 + $phids = array_mergev($phids); 102 + $phids = array_filter($phids); 103 + return $phids; 99 104 } 100 105 101 106 protected function renderResultList(
+2
src/applications/repository/storage/PhabricatorRepositoryPushLog.php
··· 34 34 protected $epoch; 35 35 protected $pusherPHID; 36 36 protected $pushEventPHID; 37 + protected $devicePHID; 37 38 protected $refType; 38 39 protected $refNameHash; 39 40 protected $refNameRaw; ··· 81 82 'refNew' => 'text40', 82 83 'mergeBase' => 'text40?', 83 84 'changeFlags' => 'uint32', 85 + 'devicePHID' => 'phid?', 84 86 ), 85 87 self::CONFIG_KEY_SCHEMA => array( 86 88 'key_repository' => array(