From 41bfa310a70410e02d0580457b50a880ae151dd0 Mon Sep 17 00:00:00 2001 From: Kyle Rames Date: Mon, 14 May 2018 11:04:54 -0500 Subject: [PATCH 1/2] update build object to support branch attribute --- builds.go | 1 + builds_test.go | 2 ++ testdata/fixtures/builds/get.json | 1 + testdata/fixtures/builds/list.json | 2 ++ 4 files changed, 6 insertions(+) diff --git a/builds.go b/builds.go index ed1c48c..f5c711a 100644 --- a/builds.go +++ b/builds.go @@ -19,6 +19,7 @@ type BuildLinks struct { // Build structure of Build object type Build struct { AllocatedAt time.Time `json:"allocated_at,omitempty"` + Branch string `json:"branch,omitempty"` CommitMessage string `json:"commit_message,omitempty"` CommitSha string `json:"commit_sha,omitempty"` FinishedAt time.Time `json:"finished_at,omitempty"` diff --git a/builds_test.go b/builds_test.go index 6bfb712..32d81e3 100644 --- a/builds_test.go +++ b/builds_test.go @@ -381,6 +381,7 @@ func TestGetBuild(t *testing.T) { FinishedAt: finishedAt, AllocatedAt: allocatedAt, QueuedAt: queuedAt, + Branch: "test-branch", Links: codeship.BuildLinks{ Services: "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/services", Steps: "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/steps", @@ -489,6 +490,7 @@ func TestListBuilds(t *testing.T) { FinishedAt: finishedAt, AllocatedAt: allocatedAt, QueuedAt: queuedAt, + Branch: "test-branch", Links: codeship.BuildLinks{ Services: "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/services", Steps: "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/steps", diff --git a/testdata/fixtures/builds/get.json b/testdata/fixtures/builds/get.json index 80b0ef9..88c4192 100644 --- a/testdata/fixtures/builds/get.json +++ b/testdata/fixtures/builds/get.json @@ -12,6 +12,7 @@ "finished_at": "2017-09-13T17:13:55.193+00:00", "allocated_at": "2017-09-13T17:13:36.967+00:00", "queued_at": "2017-09-13T17:13:39.314+00:00", + "branch": "test-branch", "links": { "services": "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/services", "steps": "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/steps" diff --git a/testdata/fixtures/builds/list.json b/testdata/fixtures/builds/list.json index 2891143..61f117d 100644 --- a/testdata/fixtures/builds/list.json +++ b/testdata/fixtures/builds/list.json @@ -13,6 +13,7 @@ "finished_at": "2017-09-13T17:13:55.193+00:00", "allocated_at": "2017-09-13T17:13:36.967+00:00", "queued_at": "2017-09-13T17:13:39.314+00:00", + "branch": "test-branch", "links": { "services": "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/services", "steps": "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe621342/steps" @@ -31,6 +32,7 @@ "finished_at": "2017-09-13T17:13:55.193+00:00", "allocated_at": "2017-09-13T17:13:36.967+00:00", "queued_at": "2017-09-13T17:13:39.314+00:00", + "branch": "test-branch", "links": { "services": "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe611111/services", "steps": "https://api.codeship.com/v2/organizations/28123f10-e33d-5533-b53f-111ef8d7b14f/projects/28123f10-e33d-5533-b53f-111ef8d7b14f/builds/25a3dd8c-eb3e-4e75-1298-8cbcbe611111/steps" From ce9f796cb89c183ded976f412299cce0140be4fa Mon Sep 17 00:00:00 2001 From: Kyle Rames Date: Mon, 14 May 2018 11:17:30 -0500 Subject: [PATCH 2/2] update change log --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d3e572..b17b30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.3.0 - 2018-05-14 + +### Added + +- Added `branch` to `Build` + ## 0.2.2 - 2018-04-11 ### Fixed