1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42: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])) { if (!isset($build_map[$revision_phid])) {
$build_map[$revision_phid] = array( $build_map[$revision_phid] = array(
'revisionRef' => $revision_phid, 'revisionRef' => $revision_ref,
'buildRefs' => array(), 'buildRefs' => array(),
); );
} }
@ -666,14 +666,14 @@ abstract class ArcanistLandEngine
} }
echo tsprintf( echo tsprintf(
"%!\n%s\n\n", "%!\n%s\n",
pht('BUILD FAILURES'), pht('BUILD FAILURES'),
$message); $message);
$prompt_key = 'arc.land.failed-builds'; $prompt_key = 'arc.land.failed-builds';
} else if ($has_ongoing) { } else if ($has_ongoing) {
echo tsprintf( echo tsprintf(
"%!\n%s\n\n", "%!\n%s\n",
pht('ONGOING BUILDS'), pht('ONGOING BUILDS'),
pht( pht(
'%s revision(s) have ongoing builds:', '%s revision(s) have ongoing builds:',
@ -700,15 +700,20 @@ abstract class ArcanistLandEngine
} }
echo tsprintf( echo tsprintf(
"\n%s\n\n", "\n%s\n",
pht('You can review build details here:')); pht('You can review build details here:'));
// TODO: Only show buildables with problem builds. // TODO: Only show buildables with problem builds.
$workflow = $this->getWorkflow();
foreach ($buildable_refs as $buildable) { foreach ($buildable_refs as $buildable) {
$display_ref = $buildable->newDisplayRef(); $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); echo tsprintf('%s', $display_ref);
} }
@ -909,7 +914,7 @@ abstract class ArcanistLandEngine
pht( pht(
'TODO: You are forcing a revision, but commits are associated '. 'TODO: You are forcing a revision, but commits are associated '.
'with some other revision. Are you REALLY sure you want to land '. '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) { foreach ($confirm_force as $commit) {

View file

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

View file

@ -36,10 +36,6 @@ final class ArcanistBuildableRef
return idx($this->parameters, 'phid'); return idx($this->parameters, 'phid');
} }
public function getName() {
return idxv($this->parameters, array('fields', 'name'));
}
public function getObjectPHID() { public function getObjectPHID() {
return idxv($this->parameters, array('fields', 'objectPHID')); return idxv($this->parameters, array('fields', 'objectPHID'));
} }
@ -53,11 +49,21 @@ final class ArcanistBuildableRef
} }
public function getDisplayRefTitle() { public function getDisplayRefTitle() {
return $this->getName(); return pht('Buildable %d', $this->getID());
} }
public function getBuildRefs() { public function getBuildRefs() {
return $this->getHardpoint(self::HARDPOINT_BUILDREFS); 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(); return $stdin->read();
} }
protected function getAbsoluteURI($raw_uri) { final public function getAbsoluteURI($raw_uri) {
// TODO: "ArcanistRevisionRef", at least, may return a relative URI. // TODO: "ArcanistRevisionRef", at least, may return a relative URI.
// If we get a relative URI, guess the correct absolute URI based on // 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. // the Conduit URI. This might not be correct for Conduit over SSH.