v2023.1.21
January 21, 2023
The first release of 2023 so you will need to upgrade the library from v2022
-> v2023
BREAKING CHANGES
This release contains a number of breaking changes so please read the changelog carefully. The major change is in the signature of alot of our structures with regards to the ID
fields. We have upgraded the underlying graphql framework we rely upon and they changed the ID
from an interface{}
to a string
. This cause some problems with our API and being able to "unset" a field during an Update mutation because the JSON marshaller is no longer able to generate the following JSON {"filterId": null}
To this end we've implemented our own ID
type which has custom JSON marshaling and we've written tests around it to 100% ensure it marshal the way our API expects. We've then refactored the entire library to use this new ID
type and have ensured that everything should work the same as before and in somecases has fixed bugs where you would be unable to "unset" a value - for example a check's filter can be "unset" so there is no filter applied. With our new ID
type this behaviour is now consistent.
This change may require you to refactor your code to support this new type in some cases but so far we've found that in most of the common cases it should not. It will mostly affect Update mutation inputs.
If you were doing this before
input := opslevel.ToolUpdateInput{
Id: graphql.ID("XXXXXXXXXXXXX"),
}
OR
client.GetCheck(graphql.ID("XXXXXXXXXXXXX"))
You can now do
input := opslevel.ToolUpdateInput{
Id: "XXXXXXXXXXXXX",
}
OR
client.GetCheck("XXXXXXXXXXXXX")
Bugfix
- Fixing issue where check notes were being deleted on updates
Feature
- Add CRUD for custom actions webhook actions
- Add CRUD for custom actions trigger definitions
- Add a new input type "JSON" which supports turning a map[string]string into escaped json when used in mutation input
Refactor
- removed "NewEmptyString" function by refactoring "NewString" to work in the expected way. This maybe cause a BREAKING CHANGE!
- Add a "HandleErrors" method that wraps "FormatErrors" to reduce code paths and increase test coverage
- refactor "NewId" method to allow for "null" as a value for Update mutations where the input can have a null ID field that acts as an "unset" this field
- BREAKING CHANGE: Make new ID type that works like our API expects. The entire codebase has been refactor and method signatures have been changed to use the builtin ID type instead of graphql.ID type. This will fix a number of bugs with Update mutations being unable to "unset" or null out an IDs where permitted.
- Refactored error handling in methods to increase code coverage and reduce branching code paths
- Deprecated
DeleteGroupWithAlias
in favor ofDeleteGroup
handling both ID or Alias
Dependency
- Bump github.com/relvacode/iso8601 from 1.1.0 to 1.3.0
- Bump github.com/hashicorp/go-retryablehttp from 0.7.1 to 0.7.2