Releases: buildkite/go-buildkite
v4.1.0 (Teams Work)
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
v4.0.0 (Major Tom)
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
v3.13.0 (Just a wee one)
What's Changed
Full Changelog: v3.12.0...v3.13.0
v3.12.0 (Packages Aplenty 📦)
v3.11.0 (February Complimentary ✅)
What's Changed
- Expose retry_source and retry_type on jobs by @drcapulet in #171
- Expose additional webhook fields on builds and jobs by @mstifflin in #173
- SUP-1697 Add username to Author struct by @lizrabuya in #174
- SUP-1681: Webhook event type definition for struct literal creation by @james2791 in #175
- Adding job priority as part of job struct by @pankti11 in #176
- v3.11.0 Release by @james2791 in #177
New Contributors
- @drcapulet made their first contribution in #171
- @mstifflin made their first contribution in #173
- @pankti11 made their first contribution in #176
Full Changelog: v3.10.0...v3.11.0
v3.10.0 (Cluster Updates ✨)
What's Changed
- cluster_tokens: expose token string by @gmichelo in #168
- v3.10.0 Release by @lizrabuya in #169
Full Changelog: v3.9.0...v3.10.0
v3.9.0 (Template Taxonomy 📙)
What's Changed
- SUP-1448: Pipeline Templates integration by @james2791 in #165
- v3.9.0 Release by @james2791 in #167
Full Changelog: v3.8.0...v3.9.0
v3.8.0 (Annotations Addition 💬)
What's Changed
- Bump golang.org/x/net from 0.7.0 to 0.17.0 by @dependabot in #162
- SUP-1537: Annotations create endpoint interaction by @james2791 in #163
- v3.8.0 Release by @james2791 in #164
Full Changelog: v3.7.0...v3.8.0
v3.7.0 (Tweaking and Tinkering 🔧)
What's Changed
- Add support for "user_id" query string parameter when loading teams by @mwgamble in #159
- jobs: add cluster_id and cluster_queue_id to job by @gmichelo in #160
- V3.7.0 release by @james2791 in #161
New Contributors
Full Changelog: v3.6.0...v3.7.0