buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

REST API: include `org` field in pipeline section #338

Open joscha opened 6 years ago

joscha commented 6 years ago

I recently used the webhook service to write a small webhook that uses the pipeline slug and the organization. I noticed that the organization is not part of the pipeline section as a field, hence I parse it out of the API URL:

https://github.com/joscha/buildkite-failed-builds-notifier/blob/112b16d9fee73fb9992693e7a065468a1a7a7837/failed-builds-notification.js#L6-L14

Ideally, however, the org would be next to the slug field, e.g.:

    "pipeline": {
        "id": "f1ad1196-926b-43c9-a9e0-c80420302e60",
        "url": "https://api.buildkite.com/v2/organizations/my-org/pipelines/my-build",
        "web_url": "https://buildkite.com/my-org/my-build",
        "slug": "canva-web-build",

would become:

    "pipeline": {
        "id": "f1ad1196-926b-43c9-a9e0-c80420302e60",
        "url": "https://api.buildkite.com/v2/organizations/my-org/pipelines/my-build",
        "web_url": "https://buildkite.com/my-org/my-build",
        "slug": "canva-web-build",
        "organization": "my-org"
        ~~~~~~~~~~~
                                ^---- new field