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

Fix two straggling pagination issues in Drydock

Summary:
Ref T13289. See <https://discourse.phabricator-community.org/t/fatal-error-in-pagination-in-drydock-resources-host-logs-all-logs/2735>.

`bin/drydock lease` and the web UI for reviewing all object logs when there is more than one page of logs didn't get fully updated to the new cursors.

- Use a cursor pager in `bin/drydock lease`.
- Implement `withIDs()` in `LeaseQuery` so the default paging works properly.

Test Plan:
- Ran `bin/drydock lease`, got a lease with log output along the way.
- Set page size to 2, viewed host logs with multiple pages, paged to page 2.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13289

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

+17 -2
+4 -2
src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
··· 151 151 while (!$is_active) { 152 152 $lease->reload(); 153 153 154 + $pager = id(new AphrontCursorPagerView()) 155 + ->setBeforeID($log_cursor); 156 + 154 157 // While we're waiting, show the user any logs which the daemons have 155 158 // generated to give them some clue about what's going on. 156 159 $logs = id(new DrydockLogQuery()) 157 160 ->setViewer($viewer) 158 161 ->withLeasePHIDs(array($lease->getPHID())) 159 - ->setBeforeID($log_cursor) 160 - ->execute(); 162 + ->executeWithCursorPager($pager); 161 163 if ($logs) { 162 164 $logs = mpull($logs, null, 'getID'); 163 165 ksort($logs);
+13
src/applications/drydock/query/DrydockLogQuery.php
··· 2 2 3 3 final class DrydockLogQuery extends DrydockQuery { 4 4 5 + private $ids; 5 6 private $blueprintPHIDs; 6 7 private $resourcePHIDs; 7 8 private $leasePHIDs; 8 9 private $operationPHIDs; 10 + 11 + public function withIDs(array $ids) { 12 + $this->ids = $ids; 13 + return $this; 14 + } 9 15 10 16 public function withBlueprintPHIDs(array $phids) { 11 17 $this->blueprintPHIDs = $phids; ··· 125 131 126 132 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { 127 133 $where = parent::buildWhereClauseParts($conn); 134 + 135 + if ($this->ids !== null) { 136 + $where[] = qsprintf( 137 + $conn, 138 + 'id IN (%Ls)', 139 + $this->ids); 140 + } 128 141 129 142 if ($this->blueprintPHIDs !== null) { 130 143 $where[] = qsprintf(