1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 22:32:41 +01:00

In "arc land", fix some coarse issues with build warnings

Summary: Ref T13546. In the new "arc land": actually reach build warnings; and show buildable URIs.

Test Plan: Ran "arc land ..." with intentionally broken builds, got more useful build warnings.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21347
This commit is contained in:
epriestley 2020-06-10 09:21:27 -07:00
parent 705c48effc
commit 727d73fec9
4 changed files with 24 additions and 13 deletions

View file

@ -635,7 +635,7 @@ abstract class ArcanistLandEngine
if (!isset($build_map[$revision_phid])) {
$build_map[$revision_phid] = array(
'revisionRef' => $revision_phid,
'revisionRef' => $revision_ref,
'buildRefs' => array(),
);
}
@ -666,14 +666,14 @@ abstract class ArcanistLandEngine
}
echo tsprintf(
"%!\n%s\n\n",
"%!\n%s\n",
pht('BUILD FAILURES'),
$message);
$prompt_key = 'arc.land.failed-builds';
} else if ($has_ongoing) {
echo tsprintf(
"%!\n%s\n\n",
"%!\n%s\n",
pht('ONGOING BUILDS'),
pht(
'%s revision(s) have ongoing builds:',
@ -700,15 +700,20 @@ abstract class ArcanistLandEngine
}
echo tsprintf(
"\n%s\n\n",
"\n%s\n",
pht('You can review build details here:'));
// TODO: Only show buildables with problem builds.
$workflow = $this->getWorkflow();
foreach ($buildable_refs as $buildable) {
$display_ref = $buildable->newDisplayRef();
// TODO: Include URI here.
$raw_uri = $buildable->getURI();
$raw_uri = $workflow->getAbsoluteURI($raw_uri);
$display_ref->setURI($raw_uri);
echo tsprintf('%s', $display_ref);
}
@ -909,7 +914,7 @@ abstract class ArcanistLandEngine
pht(
'TODO: You are forcing a revision, but commits are associated '.
'with some other revision. Are you REALLY sure you want to land '.
'ALL these commits wiht a different unrelated revision???'));
'ALL these commits with a different unrelated revision???'));
}
foreach ($confirm_force as $commit) {

View file

@ -29,7 +29,7 @@ final class ArcanistBuildBuildplanHardpointQuery
$plan_ref = ArcanistBuildPlanRef::newFromConduit($plan);
$plan_refs[] = $plan_ref;
}
$plan_refs = mpull($plan_refs, 'getPHID');
$plan_refs = mpull($plan_refs, null, 'getPHID');
$results = array();
foreach ($refs as $key => $build_ref) {

View file

@ -36,10 +36,6 @@ final class ArcanistBuildableRef
return idx($this->parameters, 'phid');
}
public function getName() {
return idxv($this->parameters, array('fields', 'name'));
}
public function getObjectPHID() {
return idxv($this->parameters, array('fields', 'objectPHID'));
}
@ -53,11 +49,21 @@ final class ArcanistBuildableRef
}
public function getDisplayRefTitle() {
return $this->getName();
return pht('Buildable %d', $this->getID());
}
public function getBuildRefs() {
return $this->getHardpoint(self::HARDPOINT_BUILDREFS);
}
public function getURI() {
$uri = idxv($this->parameters, array('fields', 'uri'));
if ($uri === null) {
$uri = '/'.$this->getMonogram();
}
return $uri;
}
}

View file

@ -2434,7 +2434,7 @@ abstract class ArcanistWorkflow extends Phobject {
return $stdin->read();
}
protected function getAbsoluteURI($raw_uri) {
final public function getAbsoluteURI($raw_uri) {
// TODO: "ArcanistRevisionRef", at least, may return a relative URI.
// If we get a relative URI, guess the correct absolute URI based on
// the Conduit URI. This might not be correct for Conduit over SSH.