/** * @deprecated Use {@see \Bart\Gerrit\Change} * Query gerrit for an approved change * @param string $changeId Gerrit Change-Id * @param string $commitHash Latest commit hash pushed to gerrit */ public function getApprovedChange($changeId, $commitHash) { $reviewScore = $this->config->reviewScore(); $verifiedScore = $this->config->verifiedScore(); $verifiedOption = ''; if ($verifiedScore !== null) { $verifiedOption = ",Verified={$verifiedScore}"; } return $this->getChange($changeId, array('commit' => $commitHash, 'label' => "CodeReview={$reviewScore}{$verifiedOption}")); }
private function createGerritApiForQuery($status, $json) { $changeId = $this->changeId; $commitHash = $this->commitHash; $this->gerritConfigs->expects($this->once())->method('reviewScore')->will($this->returnValue(10)); $this->gerritConfigs->expects($this->once())->method('verifiedScore')->will($this->returnValue(null)); $remoteGerritCmd = 'gerrit query --format=JSON ' . $changeId . " commit:{$commitHash} label:CodeReview=10"; $will = $status != 0 ? $this->throwException(new CommandException($status)) : $this->returnValue($json); return $this->configureApiForCmd($remoteGerritCmd, $will); }