Provide a real object ("PhabricatorRepositoryPushEvent") to represent an entire push transaction
Summary: Ref T4677. Currently, we record individual actions in a push as PhabricatorRepositoryPushLogs, but tie them together only loosely with a `transactionKey`. Provide a real PushEvent object, and move some of the denormalized fields to it. This primarily just gives us more robust infrastructure for building, e.g., email about pushes, for T4677, since we can act on real PHIDs rather than passing awkward identifiers around. Test Plan: - Performed migration. - Looked at database for consistency. - Browsed/queried push logs. - Pushed a bunch of stuff. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T4677 Differential Revision: https://secure.phabricator.com/D8615
This commit is contained in:
@@ -52,7 +52,7 @@ final class DiffusionPushLogListController extends DiffusionController
|
||||
// Reveal this if it's valid and the user can edit the repository.
|
||||
$remote_addr = '-';
|
||||
if (isset($editable_repos[$log->getRepositoryPHID()])) {
|
||||
$remote_long = $log->getRemoteAddress();
|
||||
$remote_long = $log->getPushEvent()->getRemoteAddress();
|
||||
if ($remote_long) {
|
||||
$remote_addr = long2ip($remote_long);
|
||||
}
|
||||
@@ -60,6 +60,7 @@ final class DiffusionPushLogListController extends DiffusionController
|
||||
|
||||
$callsign = $log->getRepository()->getCallsign();
|
||||
$rows[] = array(
|
||||
$log->getPushEvent()->getID(),
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
@@ -68,7 +69,7 @@ final class DiffusionPushLogListController extends DiffusionController
|
||||
$callsign),
|
||||
$this->getHandle($log->getPusherPHID())->renderLink(),
|
||||
$remote_addr,
|
||||
$log->getRemoteProtocol(),
|
||||
$log->getPushEvent()->getRemoteProtocol(),
|
||||
$log->getRefType(),
|
||||
$log->getRefName(),
|
||||
phutil_tag(
|
||||
@@ -86,7 +87,7 @@ final class DiffusionPushLogListController extends DiffusionController
|
||||
|
||||
// TODO: Make these human-readable.
|
||||
$log->getChangeFlags(),
|
||||
$log->getRejectCode(),
|
||||
$log->getPushEvent()->getRejectCode(),
|
||||
phabricator_datetime($log->getEpoch(), $viewer),
|
||||
);
|
||||
}
|
||||
@@ -94,6 +95,7 @@ final class DiffusionPushLogListController extends DiffusionController
|
||||
$table = id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Push'),
|
||||
pht('Repository'),
|
||||
pht('Pusher'),
|
||||
pht('From'),
|
||||
@@ -113,6 +115,7 @@ final class DiffusionPushLogListController extends DiffusionController
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'wide',
|
||||
'n',
|
||||
'n',
|
||||
|
||||
Reference in New Issue
Block a user