Releases: rootlyhq/rootly-go
v0.8.0: post-release fixes
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
- feat: make
IDsan initialism (#40) @jamietanna
🐛 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
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:
APIHTMLHTTPIDJSONURLUUID
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
- feat: use idiomatic Go initialisms (#37) @jamietanna
- feat: generate server URLs (#36) @jamietanna
- feat: always prefix enums (#35) @jamietanna
- feat: use an Overlay to use a single type for API IDs (#28) @jamietanna
🐛 Bug fixes
- fix: don't use optional pointers on container types (#33) @jamietanna
👻 Maintenance
- chore(deps): update OpenAPI spec (#30) @github-actions[bot]
- build: periodically update OpenAPI spec (#31) @jamietanna
- chore(oapi-codegen): version-pin JSON schema (#32) @jamietanna
- build(release-drafter): correct config (#29) @jamietanna
- chore: remove Dependabot (#27) @jamietanna
- chore: Configure Renovate (#13) @renovate[bot]
- build: onboard to Release Drafter (#15) @jamietanna
- chore: remove
toolchaindirective (#14) @jamietanna
📦 Dependency updates
6 changes
- chore(config): migrate Renovate config (#34) @renovate[bot]
- chore(deps): update actions/setup-go action to v6.2.0 (#21) @renovate[bot]
- chore(deps): update release-drafter/release-drafter action to v6.2.0 - autoclosed (#23) @renovate[bot]
- chore(deps): update golangci/golangci-lint-action action to v9 (#24) @renovate[bot]
- chore(deps): update actions/checkout action to v6.0.2 (#17) @renovate[bot]
- chore(deps): pin dependencies (#16) @renovate[bot]
v0.6.0
- 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
- Causes:
- Add
AlertPayloadConditionstoAlertTriggerParamsfor 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
CommunicationsTemplateCommunicationTemplateStagesfor template stage management - Add
Slugfield to various types for identifier support - Add
JsmopsIdfield to User type for Jira Service Management integration
Full Changelog: v0.5.0...v0.6.0
v0.5.0
What's Changed
Added
- Add
Metastruct for pagination support - Add
ISNOTcondition for workflow tasks via SDK
Fixed
- Fix
Shiftstruct for correct response type - Fix required and optional types for Dashboard Params
- Fix LCR required and optional params
New Contributors
Full Changelog: v0.4.0...v0.5.0
v0.4.0
Added
- Add
Metastruct for pagination support (CurrentPage,NextPage,PrevPage,TotalCount,TotalPages) - Add
Metafield to list response types for pagination metadata - Add
ShortIdfield toAlerttype for human-readable short identifiers - Add
StartedAtandEndedAtfields toAlerttype for alert timing
Full Changelog: v0.3.0...v0.4.0
v0.3.0
Full Changelog: v0.2.0...v0.3.0
v0.3.0
Added
- Add
MutedServiceIdsfield toIncident,NewIncident, andUpdateIncidenttypes for muting alerts during maintenance windows - Add
Labelsunion type support forAlert,NewAlert, andUpdateAlert(string, float32, or bool values) - Add granular permissions to
OnCallRoletypes:AlertFieldsPermissionsAlertGroupsPermissionsAlertRoutingRulesPermissionsOnCallReadinessReportPermissionsOnCallRolesPermissionsScheduleOverridePermissionsSchedulesPermissionsServicesPermissions
Changed
- Change
VoicemailGreetingfield inLiveCallRouterfrom optional to required
Full Changelog: v0.2.0...v0.3.0
v0.2.0
Full Changelog: v0.1.0...v0.2.0
v0.1.0
feat: include all types from the OpenAPI spec in the generated code