Page MenuHomePhabricator

Add harbormaster.buildable.search API Method
ClosedPublic

Authored by jlinahan on Nov 16 2018, 10:34 PM.
Tags
None
Referenced Files
F14449872: D19818.id47339.diff
Fri, Dec 27, 12:34 AM
F14449055: D19818.id47370.diff
Thu, Dec 26, 7:35 PM
Unknown Object (File)
Fri, Dec 20, 1:56 PM
Unknown Object (File)
Sat, Dec 14, 4:11 PM
Unknown Object (File)
Thu, Dec 12, 10:36 PM
Unknown Object (File)
Thu, Dec 12, 10:36 PM
Unknown Object (File)
Thu, Dec 12, 10:36 PM
Unknown Object (File)
Thu, Dec 12, 10:36 PM
Subscribers
Restricted Owners Package

Details

Summary

This revision adds a Conduit search method for buildables. It exposes:

  • objectPHID
  • containerPHID
  • buildableStatus
  • isManual
Test Plan

Use the API Console to run searches. Example:

{
  "data": [
    {
      "id": 2,
      "type": "HMBB",
      "phid": "PHID-HMBB-m4k5lodx6naq22576a7d",
      "fields": {
        "objectPHID": "PHID-DIFF-vzvgqqcyscpd7ta4osy2",
        "containerPHID": "PHID-DREV-vsivs5276c7vtgpmssn2",
        "buildableStatus": {
          "value": "passed"
        },
        "isManual": true,
        "dateCreated": 1542407155,
        "dateModified": 1542407156,
        "policy": {
          "view": "users",
          "edit": "users"
        }
      },
      "attachments": {}
    },
    {
      "id": 1,
      "type": "HMBB",
      "phid": "PHID-HMBB-opxfl4auoz3ey5klplrx",
      "fields": {
        "objectPHID": "PHID-DIFF-vzvgqqcyscpd7ta4osy2",
        "containerPHID": null,
        "buildableStatus": {
          "value": "passed"
        },
        "isManual": false,
        "dateCreated": 1542406968,
        "dateModified": 1542406968,
        "policy": {
          "view": "users",
          "edit": "users"
        }
      },
      "attachments": {}
    }
  ],
  "maps": {},
  "query": {
    "queryKey": null
  },
  "cursor": {
    "limit": 100,
    "after": null,
    "before": null,
    "order": null
  }
}

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 21189
Build 28811: Run Core Tests
Build 28810: arc lint + arc unit

Event Timeline

Owners added a subscriber: Restricted Owners Package.Nov 16 2018, 10:34 PM

One minor tweak inline, but this looks good otherwise. Thanks!

src/applications/harbormaster/storage/HarbormasterBuildable.php
374

Make this a map<string, wild>...

387

...and this an array, like:

'buildableStatus' => array(
  'value' => $this->getBuildableStatus(),
),

See HarbormasterBuild for an example. This lets us add a name (human-readable, translatable name) too, and statuses tend to pick up other attributes sooner or later (like color.ansi for letting arc render the status without arc needing to know what all the possible values are).

(We could do this with a separate harbormaster.buildable.status.search but that's relatively cumbersome and just putting the data on the object feels like it strikes a better practical balance.)

This revision now requires changes to proceed.Nov 17 2018, 1:06 AM

Put 'buildableStatus' into array

Thanks! You're in Blessed Committers so you should be able to land this yourself (see that project description for some instructions). Let me know if you run into issues.

This revision is now accepted and ready to land.Nov 19 2018, 11:19 PM
This revision was automatically updated to reflect the committed changes.

The initial "Land Revision" failed because the saux001.phacility.net device didn't get its address updated after it changed when AWS prompted it to cycle in T13207. This is rare and somewhat one-off so I just fixed the configuration and clicked the button again.