Skip to content

Releases: buildkite/go-buildkite

v4.1.0 (Teams Work)

07 Nov 00:28
f02ac5f
Compare
Choose a tag to compare

What's Changed

  • Expand the Teams service to support additional endpoints by @mstifflin in #204
  • Support Team Suites and Team Pipelines API by @lizrabuya in #205
  • Update CHANGELOG.md and version.go for new release version by @lizrabuya in #206

Full Changelog: v4.0.1...v4.1.0

v4.0.1

23 Oct 06:55
e1be45c
Compare
Choose a tag to compare

What's Changed

  • Fix unmarshal into non-pointer on Build Create by @moskyb in #203

Full Changelog: v4.0.0...v4.0.1

v4.0.0 (Major Tom)

21 Oct 04:29
d08519f
Compare
Choose a tag to compare

v4.0.0 (2024-10-21)

Our first major release in a little while! This release is mostly a cleanup release, which does not contain any major feature releases.

Notable Breaking Changes

Import Path

The module import path has changed from github.com/buildkite/go-buildkite/v3/buildkite to github.com/buildkite/go-buildkite/v4. Note that the version number has changed, and that the buildkite package is now at the root of the module.

Contexts

All methods that interact with Buildkite API now require a context parameter. This is to allow for better control over timeouts and cancellations. For example, to spend a maximum of five seconds trying to get a list of builds for a pipeline, you could run:

ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
builds, _, err := client.Builds.ListByPipeline(ctx, "my-org", "my-pipeline", nil)

Removal of pointers

Previously, this library had a lot of pointers in its method signatures and struct values. Where practical, we've removed these pointers to make the API clearer and more idiomatic. This means that you'll need to update your code to pass values directly instead of pointers. For example, previously you might have done:

pipeline := &buildkite.Pipeline{
  Name: buildkite.String("My Pipeline"),
}
_, _, err := client.Pipelines.Create(ctx, "my-org", pipeline)

Now, you should do:

pipeline := buildkite.Pipeline{
  Name: "My Pipeline",
}
_, _, err := client.Pipelines.Create(ctx, "my-org", pipeline)

Along with this change, we've removed the buildkite.String, buildkite.Bool, and buildkite.Int helper functions. You should now pass values directly to the struct fields.

One notable difference in API after this change is that many (but not all!) Update methods for various API resources previously unmarshalled their response into a parameter that was passed into them. This is no longer the case, and the response is now returned directly from the method. For example, previously you might have done:

updatePipeline := buildkite.UpdatePipeline{
  Name: buildkite.String("My Pipeline"),
}

_, err := client.Pipelines.Update("my-org", "my-pipeline", &updatePipeline)
// Result of update is unmarshalled into updatePipeline, with surprising results in some cases

now, you should do:

updatePipeline := buildkite.UpdatePipeline{
  Name: "My Pipeline",
}
updated, _, err := client.Pipelines.Update(ctx, "my-org", "my-pipeline", updatePipeline)
// updated is the result of the update
// updatePipeline is unchanged

New Client Creation

We've changed the buildkite.NewClient method so that it includes functional args. Previously, you would have done something like this to create a client:

config, err := buildkite.NewTokenConfig(apiToken, debug)
if err != nil {
  return fmt.Errorf("client config failed: %w", err)
}

client := buildkite.NewClient(config.Client())

Config creation has been moved inside the NewClient method and its functional arguments, so the new equivalent is:

client, err := buildkite.NewClient(
  buildkite.WithTokenAuth(apitoken),
  buildkite.WithHTTPDebug(debug),
)

For a full list of functional arguments to NewClient, see the godoc.

The NewOpts method, which was introduced in v3.12.0, remains in place as an alias for NewClient.

Removal of YAML Bindings

We've removed the YAML bindings for exported data types. This means that marshalling the data types to and from YAML will no longer work. Code like the following will no longer work, and will produce undefined behaviour:

pipeline := buildkite.Pipeline{
  Name: "My Pipeline",
  Repository: "https://github.com/buildkite/go-buildkite",
}

yamlBytes, err := yaml.Marshal(pipeline)

These YAML bindings weren't used within the library itself, and so aren't necessary for the operation of this library. If you were marshalling this library's data types to YAML, you should be able to use the encoding/json package instead, as all JSON is a subset of YAML.

Other Changes

Changed

  • Create packages using presigned uploads, rather than transiting them through the buildkite backend #194 #195 (@moskyb)

Internal

  • Use golang-ci lint in CI #199 (@moskyb)
  • Update README with NewOpts client/kingpin example #192 (@james2791)
  • Update tests to use cmp.Diff instead of reflect.DeepEqual #198 (@moskyb)

v3.13.0 (Just a wee one)

26 Aug 23:01
8af625b
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.12.0...v3.13.0

v3.12.0 (Packages Aplenty 📦)

18 Aug 22:47
d1a5b24
Compare
Choose a tag to compare

What's Changed

  • Deprecate authenticating roundtrippers, replace with new client constructor by @moskyb in #185
  • Test cleanups by @moskyb in #187
  • Add bindings for Buildkite Packages APIs by @moskyb in #186

New Contributors

Full Changelog: v3.11.0...v3.12.0

v3.11.0 (February Complimentary ✅)

07 Feb 22:31
3ba55bf
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.10.0...v3.11.0

v3.10.0 (Cluster Updates ✨)

15 Nov 00:29
4d8d271
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.9.0...v3.10.0

v3.9.0 (Template Taxonomy 📙)

14 Nov 01:31
74b3227
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.8.0...v3.9.0

v3.8.0 (Annotations Addition 💬)

02 Nov 02:34
77e050a
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.7.0...v3.8.0

v3.7.0 (Tweaking and Tinkering 🔧)

30 Oct 21:43
80fce2d
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.6.0...v3.7.0