Page MenuHomePhabricator

Make "arc land" accommodate a minor API change in Harbormaster build statuses
ClosedPublic

Authored by epriestley on Dec 22 2017, 5:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 7:28 AM
Unknown Object (File)
Thu, Apr 25, 6:32 AM
Unknown Object (File)
Thu, Apr 25, 1:34 AM
Unknown Object (File)
Fri, Apr 19, 7:03 PM
Unknown Object (File)
Tue, Apr 16, 5:20 PM
Unknown Object (File)
Sun, Apr 14, 12:53 PM
Unknown Object (File)
Sat, Apr 13, 9:21 AM
Unknown Object (File)
Sat, Apr 13, 2:42 AM
Subscribers
None

Details

Summary

See PHI261. Currently "arc land" shows every build staus (passed, failed, building, etc) as yellow. Intended behavior is that passed builds are green, failed builds are red, and so on.

This is because of an unintended API change a while ago in D16356. Since the only impact was a cosmetic color issue, this escaped notice until now.

Additionally, try to use the modern harbormaster.build.search if it is available.

Test Plan
  • Ran arc land with running builds, got reasonable coloration.
  • Faked the new method not being available, still got sensible behavior from the old method.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

  • Various minor fixes after actually executing the test plan.

Specifically, the old API result looked like this:

'buildStatus' => 'passed'

The newer one looks like this:

'buildStatus' => array(
  'value' => 'passed',
  'name' => 'Passed',
)

That caused the switch() (see inline) to always hit the default case and go yellow.

src/workflow/ArcanistLandWorkflow.php
1429

This became switch (array(...)) { ... }.

This revision is now accepted and ready to land.Dec 23 2017, 5:27 PM
This revision was automatically updated to reflect the committed changes.