summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2018-12-12Provide OpenAPI spec for BlubberoidDan Duvall4-28/+310
Wrote an OpenAPI 3.0 spec for Blubberoid that provides `x-amples` entries compatible with service-checker. The written spec includes basic schema for Blubber config objects that may be later factored out for use in validation. Note that OpenAPI 3.0 supports only the v4 draft of the JSON Schema standard, so some parts of the configuration could not be fully described. Specifically, v4 does not include the `patternProperties` definition introduced in the JSON Schema v6 draft that would allow us to describe `variants` and `runs.environment` and everything beneath. Blubberoid was refactored slightly to incorporate the new spec as well as assume JSON as the canonical and default configuration format. It was also refactored to include a versioned namespace ("v1") after the server endpoint. Bug: T205920 Change-Id: I28a341aa503b8920d802715660d4c4d62be45475
2018-12-12Support "application/json" in BlubberoidDan Duvall2-1/+79
JSON seems a better option for a web service in general—other toolchains in the Docker/Kubernetes space typically prefer YAML for human-edited configs but convert to JSON on the wire. The "application/json" media type is well established—unlike "application/yaml" which has no official assignment by IANA—and is better supported by the OpenAPI (formerly Swagger) specification. Added content-type media type validation in the Blubberoid HTTP server handler, and added a check for `json.Valid(body)` upon receiving a "application/json" media type. Since any given valid JSON is also valid YAML, Blubberoid simply does a shallow validation of the JSON body before punting to `config.ReadConfig` for YAML unmarshalling and thorough config validation. Bug: T205920 Change-Id: I970acbde497ed446eb8eed568b1328f8c6f5aa55
2018-12-10Use JSON as canonical config formatTyler Cipriani1-1/+1
Uses the github.com/ghodss/yaml library to convert YAML to JSON before unmarshaling for the purposes of supporting YAML and JSON input while converting to only support JSON internally. Bug: T207694 Change-Id: I00668014907e9ea54917f5d5067cac08d0668053
2018-09-26Merge "Test basic functionality of blubberoid"jenkins-bot1-0/+30
2018-09-17Test basic functionality of blubberoidDan Duvall1-0/+30
Change-Id: I4a946ebbf1545a226457456ffeb8fc6971c46b33
2018-09-13Remove some types that will be inferredTyler Cipriani2-7/+7
Adding types to variables that would have their types inferred from function return types causes lint errors in go1.10.3 (my local machine). Change-Id: I71ffbe7843084b4bd22b15ed223ed05d4ccc9aaa
2018-08-29Provide a stateless blubberoid microserviceDan Duvall2-0/+203
The `blubber` command already gets everything it needs from explicit inputs, which makes it an easy candidate for running as a simple microservice. This patch provides exactly that in the form of `blubberoid`, an HTTP server that processes Blubber configuration. To start the daemon: make && blubberoid To use it: curl -i -X POST --data-binary @blubber.example.yaml http://:8748/[variant] Change-Id: Ieea73048d092b974da424ba40ddc90eaf693af0b