Releases: OpsLevel/opslevel-go
v2025.2.10
February 10, 2025
Welcome to 2025! With this release of opslevel-go we have made a series of breaking changes in opslevel-go around how we handle pushing "null" through to our API. Historically we've not been able to do this consistently on input type fields because JSON struct tags omitempty
works differently depending on the target field type, especially when you get pointers involved. Additionally some of our API mutations for update differentiate functionality between null
and ""
(empty) - which gets even more complicated by custom scalar types and such.
So for nearly every input type field we need 4 logical states the field can be in:
- not present in the json variables
- present but json
null
AKA "unset" during update mutations - present but empty state
- present but filled state
For example with a string
type this is not possible today with only *string
so we've introduced a new wrapper type Nullable[T]
that has special JSON marshalling that gives us the 2nd state above - present but json null
This is a pretty big sweeping change to opslevel-go and any usages of it are going to need a refactor when you build out the data for your input types. Where before you might have had:
desc := "Hello World"
input := opslevel.DomainInput{
Description: &desc
}
you will now need
input := opslevel.DomainInput{
Description: opslevel.RefOf("Hello World")
}
For types other then standard go types it may become a bit more complicated. Please check out the tests for the resource types you are having issues with to get a sense for what you need to do.
Codegen
Additionally if you've been following the project for a while you'll know what we've been trying to codegenerate the client library for sometime now. 2025 takes us 1 step closer to having more structures under code generation. Additionally we've moved the codegen out to a separate repository - https://github.com/OpsLevel/client-gen
Over the course of 2025 we will continue to keep pushing more and more of the client library to be generated and we may take on expanding that out to other languages - python, javascript, rust, etc
Feature
- 'metadata' field has been added to AlertSource struct
- 'description' field has been added to Category struct
- Struct 'Scorecard' has been updated to match all the fields possible in the API
- Add ability to CRUD 'ComponentType'
- Add aliases functions for CRUD components that use the old services CRUD functions
- Add support for the
provisionedBy
field on User type
Refactor
- BREAKING CHANGE: "Nullable" type now wraps some optional struct fields of API input objects. This "Nullable" type enables fields to be set to the JSON "null" value.
- convert enum consts into vars for easier pointer referencing
- enums converted from consts to vars, e.g. opslevel.RefOf(opslevel.AlertSourceTypeEnumDatadog) should now be &opslevel.AlertSourceTypeEnumDatadog
- BREAKING CHANGE: 'OpsLevelErrors' has been renamed to 'Error'
- BREAKING CHANGE: Struct 'GoogleCloudProject' fields
ID
andURL
are nowId
andUrl
respectively - Field 'ChecksCount' has been renamed to 'TotalChecks' on the struct 'Scorecard' to match the API definition
- Field 'ID' on struct 'Secret' has been renamed to 'Id' for consistency
- BREAKING CHANGE: struct 'OpsLevelWarnings' was renamed to 'Warning'
- BREAKING CHANGE: client.GetService now properly takes in an identifier and calls the appropreate queries for alias or id
- BREAKING CHANGE: the
notes
field on check input types doesn't supportnull
only""
and"filled"
values or not present.
Removed
- removed NullableString func, no longer used
Dependency
- Bump github.com/gosimple/slug from 1.14.0 to 1.15.0
- Bump github.com/go-playground/validator/v10 from 10.23.0 to 10.24.0
- Bump github.com/go-resty/resty/v2 from 2.16.2 to 2.16.5
v2024.12.24
December 24, 2024
Dependency
- Bump goreleaser/goreleaser-action from 6.0.0 to 6.1.0
- Bump codecov/codecov-action from 4 to 5
- Bump github.com/go-playground/validator/v10 from 10.22.1 to 10.23.0
- Bump github.com/go-resty/resty/v2 from 2.15.3 to 2.16.2
- Bump opslevel/report-deploy-github-action from 1.0.0 to 2.0.0
- Bump opslevel/report-deploy-github-action from 2.0.0 to 3.0.0
- Bump golang.org/x/crypto from 0.26.0 to 0.31.0
v2024.11.8
November 08, 2024
Refactor
- BREAKING CHANGE revert ServiceCreateInput and ServiceUpdateInput YAML struct tags back to before 2024 convention
v2024.10.28
October 28, 2024
Bugfix
- BREAKING CHANGE: CheckPackageVersionUpdateInput changed to allow MissingPackageResult to be nullable
Feature
- add CodeIssue check type
- Add new 'Aliasable' interface for working with resources that are allowed to have aliases
Dependency
- Bump github.com/relvacode/iso8601 from 1.4.0 to 1.5.0
v2024.10.15
v2024.10.11
October 11, 2024
Feature
- add regionOverride field to AWS integration, for overriding multiple regions
- new
IntegrationReactivate
mutation to reactivate an invalidated or deactivated integration - added HasBadHttpStatus for better error handling
Refactor
- BREAKING CHANGE: new argument sendInvite added to UserInvite() method to force send a user invite e-mail
Dependency
- Bump github.com/go-playground/validator/v10 from 10.22.0 to 10.22.1
- Bump github.com/hasura/go-graphql-client from 0.13.0 to 0.13.1
- Bump github.com/go-resty/resty/v2 from 2.14.0 to 2.15.3
v2024.9.18
v2024.9.3
September 03, 2024
Bugfix
- Fix bug with ReconcileTags not properly reconciling the tags due to incorrect behavior of TagAssign mutation.
Feature
- add Systems to Cacher struct, and related caching operations
Dependency
- Bump opslevel/report-deploy-github-action from 0.7.0 to 0.10.0
- Bump github.com/Masterminds/sprig/v3 from 3.2.3 to 3.3.0
v2024.8.16
August 16, 2024
Bugfix
- Fix bug where AlertSource and InfraResource queries failed because field name should be
ownerLocked
instead oflocked
field
Feature
- Add support for Google Cloud Integrations
- add filter query param to ListUsers() to filter out deactivated users
- add ManagedAliases field and UniqueIdentifiers member function to System struct
Refactor
- Updated graphql operation names for infrastructure resources, and their schemas.
- BREAKING CHANGE - must explicitly access
Aliases
,OwnershipTagKeys
,TagsOverrideOwnership
on Integration nested Fragment structs to avoidambiguous selector
errors
v2024.8.1
August 01, 2024
Feature
- Add support for Azure Resource Integrations
- Add ability to create, update, list and get 'PackageVersion' checks
- add Locked field to AlertSource, InfrastructureResource, Repository, Service, and System structs
- Add Service Property Definition check
Dependency
- bump opslevel-go module version to go 1.22