Skip to content

Releases: rootlyhq/rootly-go

v0.8.0: post-release fixes

24 Feb 19:26
b2beffa

Choose a tag to compare

v0.8.0

Breaking changes

Warning

Note that this release introduces a number of breaking changes to the public exported API.

This release was planned to be a patch release, but due to the breaking changes, is being released as a (breaking) minor release.

Additional initialisms are now used #40

In addition to the initialism changes from last release, we now also treat the plural of "ID", IDs, as an initialism.

Fix regression to query parameters' handling of omitempty (#39)

For anyone upgrading from v0.6.0 to v0.7.0, you may have noticed that optional query parameters may have been serialized as part of requests, subtly (or very clearly) breaking API calls.

This is now fixed.

Nullable fields (inside arrays) are now nullable.Nullable'd

As part of upstream changes in oapi-codegen, we now generate a nullable.Nullable for any elements inside arrays which are marked as nullable: true.

🚀 New features and improvements

🐛 Bug fixes

  • Fix regression to query parameters' handling of omitempty (#39)

📦 Dependency updates

  • fix(deps): update github.com/oapi-codegen/oapi-codegen/v2 digest to 99eadbe (#43) @renovate[bot]
  • chore(deps): use latest commit for oapi-codegen (#41) @jamietanna

v0.7.0: future proofing our Go API contract

20 Feb 19:52

Choose a tag to compare

v0.7.0

Breaking changes

Warning

Note that this release introduces a number of breaking changes to the public exported API.

This aligns with a number of best practices for the code generator we use (oapi-codegen).

These breaking changes will allow us to future-proof consumers of this library, as our code generation should be more consistent in the future, and the breaking changes should be reduced.

Please note that as a 0.x release, breaking changes may still occur in the future, but we'll try our hardest to minimise them.

Go initialisms will now be used #37

Go initialisms, such as ID and URL will now be used instead of Id and Url.

The full list of initialisms that have changed are:

  • API
  • HTML
  • HTTP
  • ID
  • JSON
  • URL
  • UUID

Consistent type for IDs #28

When interacting with Rootly APIs, it's possible to provide either a slug-based ID or a UUID.

We represent this in our OpenAPI schema in a way that expresses the two types in an OpenAPI native way.

However, when we come to represent this in Go, we hit Go's type system being unable to represent union types.

This manifested itself in unhelpful ways, such as:

func (c *ClientWithResponses) GetTeamWithResponse(ctx context.Context, id struct {
   union json.RawMessage
}, params *GetTeamParams, reqEditors ...RequestEditorFn) (*GetTeamResponse, error) {

As part of this release, there is now an ID type which will be used for all API requests that use either of these ID formats, which does not expose the same issue seen with the union type.

Additionally, this ID type provides helper methods to determine if the ID is a slug or UUID.

When migrating you will need to perform type casting to the new ID type, such as:

-client.GetAlertEventWithResponse(ctx, "my-slug", /* ... */)
+client.GetAlertEventWithResponse(ctx, rootly.ID("my-slug"), /* ... */)

"Optional pointers" are no longer used on container types #33

When fields are optional (but not marked as nullable: true), we use a pointer to denote the type is optional.

For instance, as of v0.6.0:

type ListShiftsParams struct {
	// ...

	To          *string   `...`
	UserIds     *[]int    `...`
	ScheduleIds *[]string `...`
}

Using a pointer for the To field is reasonable, but when UserIds and ScheduleIds are used, this results in a difficult-to-use API, and has no impact on the resulting JSON marshalling.

Container types will no longer receive the "optional pointer" as part of this release.

Enums now always include a prefix

Previously, constants for enum values would not always include a prefix i.e.

const (
      AddActionItem AddActionItemTaskParamsTaskType = "add_action_item"
      AddActionItem SomeOtherEnum = "add_action_item"
)

When the OpenAPI spec was updated, if there was a new field such as:

const (
      AddActionItem SomeOtherEnum = "add_action_item"
)

This would then result in both enums being prefixed with their type name, such as:

 // whitespace added for readability only
 const (
-      AddActionItem                                AddActionItemTaskParamsTaskType = "add_action_item"
+      AddActionItemTaskParamsTaskTypeAddActionItem AddActionItemTaskParamsTaskType = "add_action_item"
-      AddActionItem              SomeOtherEnum = "add_action_item"
+      SomeOtherEnumAddActionItem SomeOtherEnum = "add_action_item"
 )

This would lead to breaking changes at that time, and it would not be possible to predict.

We will now always specify the prefix, so conflicts will not arise in the future.

Notable changes

A toolchain directive is no longer enforced #14

As we do not need to explicitly enforce a Go toolchain to be used by consumers, we have now removed this requirement.

🚀 New features and improvements

🐛 Bug fixes

  • fix: don't use optional pointers on container types (#33) @jamietanna

👻 Maintenance

📦 Dependency updates

6 changes

v0.6.0

31 Jan 20:46
v0.6.0
cf7ac63

Choose a tag to compare

  • Add Catalog Fields API endpoints for managing custom catalog fields:
    • Causes: ListCauseCatalogFields, CreateCauseCatalogField
    • Environments: ListEnvironmentCatalogFields, CreateEnvironmentCatalogField
    • Functionalities: ListFunctionalityCatalogFields, CreateFunctionalityCatalogField
    • Incident Types: ListIncidentTypeCatalogFields, CreateIncidentTypeCatalogField
    • Services: ListServiceCatalogFields, CreateServiceCatalogField
    • Groups: ListGroupCatalogFields, CreateGroupCatalogField
  • Add AlertPayloadConditions to AlertTriggerParams for advanced alert filtering with operators (IS, IS NOT, CONTAINS, CONTAINS_ALL, CONTAINS_NONE, SET, UNSET, ANY, NONE)
  • Add UserNotificationRuleNotificationType (audible/quiet) for notification preferences
  • Add CommunicationsTemplateCommunicationTemplateStages for template stage management
  • Add Slug field to various types for identifier support
  • Add JsmopsId field to User type for Jira Service Management integration

Full Changelog: v0.5.0...v0.6.0

v0.5.0

15 Jan 19:58
c7ab24a

Choose a tag to compare

What's Changed

Added

  • Add Meta struct for pagination support
  • Add ISNOT condition for workflow tasks via SDK

Fixed

  • Fix Shift struct for correct response type
  • Fix required and optional types for Dashboard Params
  • Fix LCR required and optional params
  • (OC-3189): Fix Go SDK Types for Shifts & Add CI Testing by @Hchanni in #9

New Contributors

Full Changelog: v0.4.0...v0.5.0

v0.4.0

06 Jan 19:48

Choose a tag to compare

Added

  • Add Meta struct for pagination support (CurrentPage, NextPage, PrevPage, TotalCount, TotalPages)
  • Add Meta field to list response types for pagination metadata
  • Add ShortId field to Alert type for human-readable short identifiers
  • Add StartedAt and EndedAt fields to Alert type for alert timing

Full Changelog: v0.3.0...v0.4.0

v0.3.0

06 Jan 02:36

Choose a tag to compare

Full Changelog: v0.2.0...v0.3.0

v0.3.0

06 Jan 02:36

Choose a tag to compare

Added

  • Add MutedServiceIds field to Incident, NewIncident, and UpdateIncident types for muting alerts during maintenance windows
  • Add Labels union type support for Alert, NewAlert, and UpdateAlert (string, float32, or bool values)
  • Add granular permissions to OnCallRole types:
    • AlertFieldsPermissions
    • AlertGroupsPermissions
    • AlertRoutingRulesPermissions
    • OnCallReadinessReportPermissions
    • OnCallRolesPermissions
    • ScheduleOverridePermissions
    • SchedulesPermissions
    • ServicesPermissions

Changed

  • Change VoicemailGreeting field in LiveCallRouter from optional to required

Full Changelog: v0.2.0...v0.3.0

v0.2.0

18 Dec 19:25

Choose a tag to compare

Full Changelog: v0.1.0...v0.2.0

v0.1.0

23 Apr 17:42

Choose a tag to compare

feat: include all types from the OpenAPI spec in the generated code