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)
Tue, Nov 19, 3:19 PM
Unknown Object (File)
Thu, Nov 14, 5:32 AM
Unknown Object (File)
Thu, Nov 7, 10:51 AM
Unknown Object (File)
Sep 27 2024, 9:16 PM
Unknown Object (File)
Sep 27 2024, 9:16 PM
Unknown Object (File)
Sep 27 2024, 9:16 PM
Unknown Object (File)
Sep 27 2024, 9:16 PM
Unknown Object (File)
Sep 19 2024, 5:40 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.