Page MenuHomePhabricator

D7302.diff

diff --git a/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php b/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php
--- a/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php
+++ b/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php
@@ -46,6 +46,9 @@
foreach ($releephRequests as $releephRequest) {
$branch = $releephRequest->loadReleephBranch();
+ if (!$branch) {
+ continue;
+ }
$request_commit_phid = $releephRequest->getRequestCommitPHID();
$revisionPHID =
$query->getRevisionPHID($request_commit_phid);
diff --git a/src/applications/releeph/query/ReleephRequestQuery.php b/src/applications/releeph/query/ReleephRequestQuery.php
--- a/src/applications/releeph/query/ReleephRequestQuery.php
+++ b/src/applications/releeph/query/ReleephRequestQuery.php
@@ -10,6 +10,7 @@
private $severities;
private $requestorPHIDs;
private $branchIDs;
+ private $revisionPHIDs;
const STATUS_ALL = 'status-all';
const STATUS_OPEN = 'status-open';
@@ -67,22 +68,8 @@
}
public function withRevisionPHIDs(array $revision_phids) {
- $type = PhabricatorEdgeConfig::TYPE_DREV_HAS_COMMIT;
-
- $edges = id(new PhabricatorEdgeQuery())
- ->withSourcePHIDs($revision_phids)
- ->withEdgeTypes(array($type))
- ->execute();
-
- $this->commitToRevMap = array();
-
- foreach ($edges as $revision_phid => $edge) {
- foreach ($edge[$type] as $commitPHID => $item) {
- $this->commitToRevMap[$commitPHID] = $revision_phid;
- }
- }
-
- $this->requestedCommitPHIDs = array_keys($this->commitToRevMap);
+ $this->revisionPHIDs = $revision_phids;
+ return $this;
}
public function loadPage() {
@@ -172,6 +159,31 @@
$this->requestorPHIDs);
}
+ if ($this->revisionPHIDs) {
+ $type = PhabricatorEdgeConfig::TYPE_DREV_HAS_COMMIT;
+
+ $edges = id(new PhabricatorEdgeQuery())
+ ->withSourcePHIDs($this->revisionPHIDs)
+ ->withEdgeTypes(array($type))
+ ->execute();
+
+ $this->commitToRevMap = array();
+ foreach ($edges as $revision_phid => $edge) {
+ foreach ($edge[$type] as $commitPHID => $item) {
+ $this->commitToRevMap[$commitPHID] = $revision_phid;
+ }
+ }
+
+ if (!$this->commitToRevMap) {
+ throw new PhabricatorEmptyQueryException("Malformed Revision Phids");
+ }
+
+ $where[] = qsprintf(
+ $conn_r,
+ 'requestCommitPHID IN (%Ls)',
+ array_keys($this->commitToRevMap));
+ }
+
$where[] = $this->buildPagingClause($conn_r);
return $this->formatWhereClause($where);
diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php
--- a/src/applications/releeph/storage/ReleephRequest.php
+++ b/src/applications/releeph/storage/ReleephRequest.php
@@ -55,6 +55,10 @@
*/
public function getPusherIntent() {
$project = $this->loadReleephProject();
+ if (!$project) {
+ return null;
+ }
+
if (!$project->getPushers()) {
return self::INTENT_WANT;
}
@@ -228,7 +232,10 @@
}
public function loadReleephProject() {
- return $this->loadReleephBranch()->loadReleephProject();
+ $branch = $this->loadReleephBranch();
+ if ($branch) {
+ return $branch->loadReleephProject();
+ }
}
public function loadPhabricatorRepositoryCommit() {

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/ll/2n/4vi2qwi2f4czm4jv
Default Alt Text
D7302.diff (3 KB)

Event Timeline