Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

Commit 984f549

Browse files
dependabot[bot]kwentclaude
authored
chore(deps): bump github.com/rootlyhq/rootly-go from 0.1.0 to 0.2.0 (#17)
* chore(deps): bump github.com/rootlyhq/rootly-go from 0.1.0 to 0.2.0 Bumps [github.com/rootlyhq/rootly-go](https://github.com/rootlyhq/rootly-go) from 0.1.0 to 0.2.0. - [Release notes](https://github.com/rootlyhq/rootly-go/releases) - [Changelog](https://github.com/rootlyhq/rootly-go/blob/master/CHANGELOG.md) - [Commits](rootlyhq/rootly-go@v0.1.0...v0.2.0) --- updated-dependencies: - dependency-name: github.com/rootlyhq/rootly-go dependency-version: 0.2.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Fix compatibility with rootly-go v0.2.0 nullable types - Update convert.go to use nullable.NewNullableWithValue for fields that changed from pointer types to nullable.Nullable types in rootly-go v0.2.0 - Update test expectations to match new JSON serialization behavior where unset nullable fields are omitted rather than serialized as null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Quentin Rousseau <contact@quent.in> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2ba5f3a commit 984f549

4 files changed

Lines changed: 25 additions & 18 deletions

File tree

go.mod

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ require (
1010
github.com/gleich/lumber v1.1.4
1111
github.com/gleich/release v0.0.0-20250104214451-94c42533123f
1212
github.com/oapi-codegen/oapi-codegen/v2 v2.5.1
13-
github.com/rootlyhq/rootly-go v0.1.0
13+
github.com/rootlyhq/rootly-go v0.2.0
1414
github.com/spf13/cobra v1.10.2
1515
github.com/stretchr/testify v1.11.1
1616
golang.org/x/sys v0.38.0 // indirect
1717
)
1818

19-
require golang.org/x/text v0.32.0
19+
require (
20+
github.com/oapi-codegen/nullable v1.1.0
21+
golang.org/x/text v0.32.0
22+
)
2023

2124
require (
2225
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
2326
github.com/davecgh/go-spew v1.1.1 // indirect
24-
github.com/go-openapi/jsonpointer v0.22.3 // indirect
27+
github.com/go-openapi/jsonpointer v0.22.4 // indirect
2528
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
2629
github.com/google/uuid v1.6.0 // indirect
2730
github.com/inconshreveable/mousetrap v1.1.0 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ github.com/gleich/lumber v1.1.4 h1:D5vvjNEkCXDF3AWzSQFPQyb3L1nqtTapKDbwKvcRRcY=
1515
github.com/gleich/lumber v1.1.4/go.mod h1:75ouHzEEAdbryal0MZlYuaXrPwwDcRdpA9tTzZga6c4=
1616
github.com/gleich/release v0.0.0-20250104214451-94c42533123f h1:cKtxXU+pVUp5pN0ad4Gd2sg4O2fETjdwYNO7GOjtzBE=
1717
github.com/gleich/release v0.0.0-20250104214451-94c42533123f/go.mod h1:HuKPpW9n3WzYSIpI0lzxFB8+WoZ1uNxw3ywAHPzlg14=
18-
github.com/go-openapi/jsonpointer v0.22.3 h1:dKMwfV4fmt6Ah90zloTbUKWMD+0he+12XYAsPotrkn8=
19-
github.com/go-openapi/jsonpointer v0.22.3/go.mod h1:0lBbqeRsQ5lIanv3LHZBrmRGHLHcQoOXQnf88fHlGWo=
18+
github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4=
19+
github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80=
2020
github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI=
2121
github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag=
2222
github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls=
@@ -40,6 +40,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
4040
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
4141
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
4242
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
43+
github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs=
44+
github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY=
4345
github.com/oapi-codegen/oapi-codegen/v2 v2.5.1 h1:5vHNY1uuPBRBWqB2Dp0G7YB03phxLQZupZTIZaeorjc=
4446
github.com/oapi-codegen/oapi-codegen/v2 v2.5.1/go.mod h1:ro0npU1BWkcGpCgGD9QwPp44l5OIZ94tB3eabnT7DjQ=
4547
github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI=
@@ -54,8 +56,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
5456
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
5557
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
5658
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
57-
github.com/rootlyhq/rootly-go v0.1.0 h1:w/ocKIcbUXMjQtoNIEYLnSfGwJxCiL/3LVsHhLmjRP0=
58-
github.com/rootlyhq/rootly-go v0.1.0/go.mod h1:Kh80WUrMsfhJ81S14WyoABD8ICOdezH+yfoRa5u2c58=
59+
github.com/rootlyhq/rootly-go v0.2.0 h1:ipfi7qcjoNBeBhra2E6iknjD168hCjxkjLabc1HdFVg=
60+
github.com/rootlyhq/rootly-go v0.2.0/go.mod h1:/vIONsKgglT/kXbqB3WYx+cZvZKvXAsdpf6yLERa3Ek=
5961
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
6062
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
6163
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=

pkg/api/convert.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package api
22

33
import (
44
"encoding/json"
5+
"time"
56

7+
"github.com/oapi-codegen/nullable"
68
"github.com/rootlyhq/cli/pkg/log"
79
"github.com/rootlyhq/cli/pkg/models"
810
"github.com/rootlyhq/rootly-go"
@@ -33,22 +35,22 @@ func convertObject(maps []map[string]string) []struct {
3335
func convertPulse(pulse models.Pulse) (string, log.CtxErr) {
3436
// Putting data into rootly.NewPulse
3537
// We need to add optional data conditionally because the
36-
// rootly library uses pointers for everything
38+
// rootly library uses nullable types for optional fields
3739
var data rootly.NewPulse
3840
data.Data.Type = "pulses"
3941
data.Data.Attributes.Summary = pulse.Summary
40-
data.Data.Attributes.Source = &pulse.Source
42+
data.Data.Attributes.Source = nullable.NewNullableWithValue(pulse.Source)
4143
if !pulse.EndedAt.IsZero() {
42-
data.Data.Attributes.EndedAt = &pulse.EndedAt
44+
data.Data.Attributes.EndedAt = nullable.NewNullableWithValue[time.Time](pulse.EndedAt)
4345
}
4446
if !pulse.StartedAt.IsZero() {
45-
data.Data.Attributes.StartedAt = &pulse.StartedAt
47+
data.Data.Attributes.StartedAt = nullable.NewNullableWithValue[time.Time](pulse.StartedAt)
4648
}
4749
if len(pulse.ServiceIds) != 0 {
48-
data.Data.Attributes.ServiceIds = &pulse.ServiceIds
50+
data.Data.Attributes.ServiceIds = nullable.NewNullableWithValue(pulse.ServiceIds)
4951
}
5052
if len(pulse.EnvironmentIds) != 0 {
51-
data.Data.Attributes.EnvironmentIds = &pulse.EnvironmentIds
53+
data.Data.Attributes.EnvironmentIds = nullable.NewNullableWithValue(pulse.EnvironmentIds)
5254
}
5355
labels := convertObject(pulse.Labels)
5456
if len(labels) != 0 {

pkg/api/convert_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestConvertPulse(t *testing.T) {
1616
}{
1717
{
1818
pulse: models.Pulse{Summary: "Hello World!"},
19-
expected: "{\"data\":{\"attributes\":{\"data\":null,\"ended_at\":null,\"environment_ids\":null,\"external_url\":null,\"service_ids\":null,\"source\":\"\",\"started_at\":null,\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
19+
expected: "{\"data\":{\"attributes\":{\"source\":\"\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
2020
},
2121
{
2222
pulse: models.Pulse{
@@ -28,7 +28,7 @@ func TestConvertPulse(t *testing.T) {
2828
},
2929
},
3030
},
31-
expected: "{\"data\":{\"attributes\":{\"data\":null,\"ended_at\":null,\"environment_ids\":null,\"external_url\":null,\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"}],\"service_ids\":null,\"source\":\"\",\"started_at\":null,\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
31+
expected: "{\"data\":{\"attributes\":{\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"}],\"source\":\"\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
3232
},
3333
{
3434
pulse: models.Pulse{
@@ -41,7 +41,7 @@ func TestConvertPulse(t *testing.T) {
4141
},
4242
StartedAt: time.Date(2001, 1, 1, 1, 1, 1, 1, time.UTC),
4343
},
44-
expected: "{\"data\":{\"attributes\":{\"data\":null,\"ended_at\":null,\"environment_ids\":null,\"external_url\":null,\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"}],\"service_ids\":null,\"source\":\"\",\"started_at\":\"2001-01-01T01:01:01.000000001Z\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
44+
expected: "{\"data\":{\"attributes\":{\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"}],\"source\":\"\",\"started_at\":\"2001-01-01T01:01:01.000000001Z\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
4545
},
4646
{
4747
pulse: models.Pulse{
@@ -55,7 +55,7 @@ func TestConvertPulse(t *testing.T) {
5555
EndedAt: time.Date(2001, 1, 1, 1, 1, 1, 1, time.UTC),
5656
StartedAt: time.Date(2001, 1, 1, 1, 1, 1, 1, time.UTC),
5757
},
58-
expected: "{\"data\":{\"attributes\":{\"data\":null,\"ended_at\":\"2001-01-01T01:01:01.000000001Z\",\"environment_ids\":null,\"external_url\":null,\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"}],\"service_ids\":null,\"source\":\"\",\"started_at\":\"2001-01-01T01:01:01.000000001Z\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
58+
expected: "{\"data\":{\"attributes\":{\"ended_at\":\"2001-01-01T01:01:01.000000001Z\",\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"}],\"source\":\"\",\"started_at\":\"2001-01-01T01:01:01.000000001Z\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
5959
},
6060
{
6161
pulse: models.Pulse{
@@ -86,7 +86,7 @@ func TestConvertPulse(t *testing.T) {
8686
},
8787
},
8888
},
89-
expected: "{\"data\":{\"attributes\":{\"data\":null,\"ended_at\":\"2001-01-01T01:01:01.000000001Z\",\"environment_ids\":[\"production\",\"staging\"],\"external_url\":null,\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"},{\"key\":\"Exit Code\",\"value\":\"1\"}],\"refs\":[{\"key\":\"sha\",\"value\":\"cd62148cbc5eb42168fe99fdb50a364e12b206ac\"},{\"key\":\"image\",\"value\":\"registry.rootly.com/rootly/my-service:cd6214\"}],\"service_ids\":[\"elasticsearch-prod\"],\"source\":\"k8s\",\"started_at\":\"2001-01-01T01:01:01.000000001Z\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
89+
expected: "{\"data\":{\"attributes\":{\"ended_at\":\"2001-01-01T01:01:01.000000001Z\",\"environment_ids\":[\"production\",\"staging\"],\"labels\":[{\"key\":\"platform\",\"value\":\"osx\"},{\"key\":\"Exit Code\",\"value\":\"1\"}],\"refs\":[{\"key\":\"sha\",\"value\":\"cd62148cbc5eb42168fe99fdb50a364e12b206ac\"},{\"key\":\"image\",\"value\":\"registry.rootly.com/rootly/my-service:cd6214\"}],\"service_ids\":[\"elasticsearch-prod\"],\"source\":\"k8s\",\"started_at\":\"2001-01-01T01:01:01.000000001Z\",\"summary\":\"Hello World!\"},\"type\":\"pulses\"}}",
9090
},
9191
}
9292

0 commit comments

Comments
 (0)