Skip to content

Commit

Permalink
Merge pull request #50 from codeship/support-branch
Browse files Browse the repository at this point in the history
Update build object to support branch attribute
  • Loading branch information
Kyle Rames authored May 14, 2018
2 parents f14b2a2 + ce9f796 commit 5e92a56
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions builds.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 2 additions & 0 deletions builds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions testdata/fixtures/builds/get.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions testdata/fixtures/builds/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 5e92a56

Please sign in to comment.