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

Use LiskDAOSet's loadRelativeEdges with ReleephRequest

Summary:
`ReleephRequest`s contain the PHID for a `PhabricatorRepositoryCommit`, and commits have an edge to a `DifferentialRevision`.

Commits are loaded with the `loadOneRelative()` method that loads the commits for every `ReleephRequest` in a `LiskDAOSet`, but the edges are loaded indivdually. A page with N RQs on it makes one DB query for the commits, but N queries for the `TYPE_COMMIT_HAS_DREV` edges.

This diff uses `loadRelativeEdges` instead to load the edges all in one query.

Test Plan: {F42290}

Reviewers: wez, epriestley

Reviewed By: epriestley

CC: epriestley, vrana, aran

Maniphest Tasks: T2714

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

+7 -4
+7 -4
src/applications/releeph/storage/ReleephRequest.php
··· 228 228 } 229 229 230 230 public function loadRequestCommitDiffPHID() { 231 - $revision_phid = PhabricatorEdgeQuery::loadDestinationPHIDs( 232 - $this->getRequestCommitPHID(), 233 - PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV); 234 - return reset($revision_phid); 231 + $commit = $this->loadPhabricatorRepositoryCommit(); 232 + if ($commit) { 233 + $edges = $this 234 + ->loadPhabricatorRepositoryCommit() 235 + ->loadRelativeEdges(PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV); 236 + return head(array_keys($edges)); 237 + } 235 238 } 236 239 237 240