Skip to content

Latest commit

 

History

History
338 lines (242 loc) · 22.9 KB

CHANGELOG.md

File metadata and controls

338 lines (242 loc) · 22.9 KB

v4.1.0 (2024-11-06)

  • Support Team Suites and Team Pipelines API #205 (lizrabuya)
  • Expand the Teams service to support additional endpoints #204 (mstifflin)

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 (2024-08-27)

  • Add Name field to buildkite.Package struct #190 (moskyb)

v3.12.0 (2024-08-19)

  • Deprecate buildkite.NewClient and its associated authenticating roundtrippers, and replace them with a new function buildkite.NewOpts #185 (moskyb)
  • Add bindings for Buildkite Packages APIs #187 (moskyb)

v3.11.0 (2024-02-08)

  • Expose retry_source and retry_type on jobs #171 (drcapulet)
  • Expose additional webhook fields on builds and jobs #173 (mstifflin)
  • SUP-1697 Add username to Author struct #174 (lizrabuya)
  • SUP-1681: Webhook event type definition for struct literal creation #175 (james2791)
  • Adding job priority as part of job struct #176 (pankti11)

v3.10.0 (2023-11-15)

v3.9.0 (2023-11-14)

v3.8.0 (2023-11-02)

  • SUP-1537: Annotations create endpoint interaction #163 (james2791)

v3.7.0 (2023-10-31)

  • Add support for user_id query string parameter when loading teams #159 (mwgamble)
  • jobs: add cluster_id and cluster_queue_id to job #160 (gmichelo)

v3.6.0 (2023-09-18)

v3.5.0 (2023-09-01)

  • Addition of issue/new feature/release templates, Codeowners #148 (james2791)
  • Add tag fields to pipeline object #147 (DeanBruntThirdfort)
  • SUP-1053: Ability to set trigger_mode for Pipelines with GitHub Enterprise ProviderSettings #149 (james2791)
  • SUP-1410: Addition of unblocked_at to Jobs struct #152 (james2791)

v3.4.0 (2023-08-10)

  • Support build.failing events #141 (mcncl)
  • SUP-1314: Test Analytics Integration #142 (james2791)
  • SUP-1321: Pipeline updates utilising dedicated PipelineUpdate struct #145 (james2791)

Notice

As part of this release, the properties that can be set when updating a pipeline using the PipelinesService have changed to reflect the permitted request body properties in the pipeline update REST API endpoint.

v3.3.1 (2023-06-08)

  • Resolved issue on 500 error when request body is null #137 (lizrabuya)
  • Bump to v3.3.1 #138 (lizrabuya)

v3.3.0 (2023-06-08)

v3.2.1 (2023-03-16)

  • Change parallel indices type in job struct to int (bug fix) #121 (yqiu24)

v3.2.0 (2023-03-14)

  • Add GraphQLID to more api objects #116 (benmoss)
  • fix "more than one error-wrapping directive %w" #112 (mdb)
  • Add Label to steps #117 (benmoss)
  • Add missing parallel job fields to struct #119 (yqiu24)
  • Update docs to reference pkg.go.dev #92 (y-yagi)

v3.1.0 (2023-01-11)

v3.0.1 (2021-10-26)

  • add build_branches param to all provider settings properties #94 (carol-he)

v3.0.0 (2021-08-20)

v2.9.0 (2021-08-03)

v2.8.1 (2021-07-14)

  • add missing organization fields as per api docs #86 (alam0rt)

v2.8.0 (2021-06-16)

  • Support for Arching/Unarchiving pipelines #85 (ksepehr)

v2.7.1 (2021-06-09)

  • Adding cluster_id fields to Pipeline and CreatePipeline structs #84 (ksepehr)

v2.7.0 (2021-06-08)

  • Updated PipelinesService to include AddWebhook #83 (ksepehr)

v2.6.1 (2021-03-25)

v2.6.0 (2021-01-05)

  • Add soft_failed attribute for job #77 (qinjin)
  • add Job unblocker/unblocking fields #76 (jsleeio)

v2.5.1 (2020-10-28)

Changed

  • Add missing fields to CreatePipeline, Pipeline, and GitHubSettings structs #74 (kushmansingh)

v2.5.0 (2020-08-20)

Changed

v2.4.0 (2019-02-15)

Full Changelog

Changed

  • Added support for rebuilding builds #27 (@kevsmith)
  • Add typed provider settings #23 (@haines)
  • Add blocked to build struct #30 (@jsm)
  • Add JobsService with unblockJob method #31 (@dschofie)
  • Support Job.runnable_at #26 (@lox)
  • Parse AgentQueryRules and TimeoutInMinutes for Steps #25 (@lox)
  • Parse the timestamp format webhooks use #19 (@euank)

v2.3.1 (2020-02-19)

Full Changelog

Changed

  • Go Modules: /v2 suffix on module path #63 (@pda)

v2.3.0 (2020-02-18)

Full Changelog

Changed

  • Add Annotations API support #62 (@toolmantim)
  • Add the step_key field to Jobs #61 (@toolmantim)
  • Add header times to job log #59 (@kushmansingh)
  • run tests on go 1.13 #58 (@yob)
  • Fix tests: compile error, segfault. #57 (@pda)
  • Go modules; delete vendor/ #56 (@pda)
  • License/Copyright tidy #55 (@pda)
  • Add functionality for teams endpoint #54 (@pyasi)
  • Add client func for the Artifacts ListByJob endpoint #53 (@aashishkapur)
  • Add support for the Job ArtifactsURL field #52 (@aashishkapur)
  • Added include_retried_jobs for BuildsListOptions #51 (@NorseGaud)
  • Add support for getting a job's log output #48 (@y-yagi)
  • Fixed spelling errors in comment #46 (@eightseventhreethree)
  • Add YAML support to types #44 (@gdhagger)
  • Include source field for the builds API response #49 (@angulito)
  • Add missing AgentListOptions. #50 (@philwo)
  • Add filtering option for listing builds by commit #47 (@srmocher)
  • Add cancel build function #45 (@dschofie)
  • Add pull request build information to CreateBuild #43 (@jradtilbrook)
  • Allow updating pipeline provider settings #41 (@gdhagger)
  • Explicitly set JSON content-type on API requests #40 (@matthewd)

v2.2.0 (2019-02-20)

Full Changelog

Changed

  • Update comments to have func name, run gofmt and golint #36 (@charlottestjohn)
  • Added support for rebuilding builds #27 (@kevsmith)
  • Add typed provider settings #23 (@haines)
  • Add blocked to build struct #30 (@jsm)
  • Add JobsService with unblockJob method #31 (@dschofie)
  • Support Job.runnable_at #26 (@lox)
  • Parse AgentQueryRules and TimeoutInMinutes for Steps #25 (@lox)
  • Parse the timestamp format webhooks use #19 (@euank)
  • Pipeline CRUD #22 (@mubeta06)
  • Actually bump version to 2.1.1 #17 (@lox)

v2.1.0 (2017-11-23)

Full Changelog

Changed

  • Add retry with exp backoff for GET/429 responses #16 (@lox)
  • Add Create() to BuildsService #11 (@bshi)
  • Update README.md #15 (@lox)
  • Fix the build and bump to 1.7.3 #13 (@toolmantim)
  • Add Artifacts Service #10 (@pquerna)
  • Removed the deprecated/dead featured_build pipeline property #7 (@tobyjoe)
  • Added BadgeURL property to Pipeline #6 (@tobyjoe)
  • Changed the wolfeidau refs to buildkite #9 (@tobyjoe)

v2.0.0 (2016-03-31)

Full Changelog

Changed

  • Changes for v2 #5 (@lox)

v1.0.0 (2016-01-10)

Full Changelog

  • Initial implementation