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

Make push log "flags", "reject code" human readable; add crumbs to pull/push logs

Summary:
Depends on D18972. Ref T13049.

Currently, the "flags" columns renders an inscrutible bitmask which you have to go hunt down in the code. Show a list of flags in human-readable text instead.

The "code" column renders a meaningless integer code. Show a text description instead.

The pull logs and push logs pages don't have a crumb to go back up out of the current query. Add one.

Test Plan: Viewed push logs, no more arcane numbers. Saw and clicked crumbs on each log page.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13049

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

+35 -5
+5
src/applications/diffusion/controller/DiffusionPullLogListController.php
··· 9 9 ->buildResponse(); 10 10 } 11 11 12 + protected function buildApplicationCrumbs() { 13 + return parent::buildApplicationCrumbs() 14 + ->addTextCrumb(pht('Pull Logs'), $this->getApplicationURI('pulllog/')); 15 + } 16 + 12 17 }
+5
src/applications/diffusion/controller/DiffusionPushLogListController.php
··· 9 9 ->buildResponse(); 10 10 } 11 11 12 + protected function buildApplicationCrumbs() { 13 + return parent::buildApplicationCrumbs() 14 + ->addTextCrumb(pht('Push Logs'), $this->getApplicationURI('pushlog/')); 15 + } 16 + 12 17 }
+25 -5
src/applications/diffusion/view/DiffusionPushLogListView.php
··· 28 28 // Only administrators can view remote addresses. 29 29 $remotes_visible = $viewer->getIsAdmin(); 30 30 31 + $flag_map = PhabricatorRepositoryPushLog::getFlagDisplayNames(); 32 + $reject_map = PhabricatorRepositoryPushLog::getRejectCodeDisplayNames(); 33 + 31 34 $rows = array(); 32 35 $any_host = false; 33 36 foreach ($logs as $log) { ··· 59 62 $device = null; 60 63 } 61 64 65 + $flags = $log->getChangeFlags(); 66 + $flag_names = array(); 67 + foreach ($flag_map as $flag_key => $flag_name) { 68 + if (($flags & $flag_key) === $flag_key) { 69 + $flag_names[] = $flag_name; 70 + } 71 + } 72 + $flag_names = phutil_implode_html( 73 + phutil_tag('br'), 74 + $flag_names); 75 + 76 + $reject_code = $log->getPushEvent()->getRejectCode(); 77 + $reject_label = idx( 78 + $reject_map, 79 + $reject_code, 80 + pht('Unknown ("%s")', $reject_code)); 81 + 62 82 $rows[] = array( 63 83 phutil_tag( 64 84 'a', ··· 85 105 'href' => $repository->getCommitURI($log->getRefNew()), 86 106 ), 87 107 $log->getRefNewShort()), 88 - 89 - // TODO: Make these human-readable. 90 - $log->getChangeFlags(), 91 - $log->getPushEvent()->getRejectCode(), 108 + $flag_names, 109 + $reject_label, 92 110 $viewer->formatShortDateTime($log->getEpoch()), 93 111 ); 94 112 } ··· 107 125 pht('Old'), 108 126 pht('New'), 109 127 pht('Flags'), 110 - pht('Code'), 128 + pht('Result'), 111 129 pht('Date'), 112 130 )) 113 131 ->setColumnClasses( ··· 122 140 'wide', 123 141 'n', 124 142 'n', 143 + '', 144 + '', 125 145 'right', 126 146 )) 127 147 ->setColumnVisibility(