Page MenuHomePhabricator

Add harbormaster.buildable.search API Method
ClosedPublic

Authored by jlinahan on Nov 16 2018, 10:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 6, 3:16 AM
Unknown Object (File)
Wed, Dec 4, 2:18 PM
Unknown Object (File)
Wed, Dec 4, 2:17 PM
Unknown Object (File)
Wed, Dec 4, 2:17 PM
Unknown Object (File)
Wed, Dec 4, 2:00 PM
Unknown Object (File)
Tue, Dec 3, 1:38 AM
Unknown Object (File)
Sun, Dec 1, 4:52 AM
Unknown Object (File)
Sun, Nov 24, 4:23 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.