Skip to content

Commit f215e07

Browse files
authored
chore(deps): bump jsonapi, update RunTrigger use deprecated relation (#1027)
Prerequisite for #1016. Bumps the jsonapi version to address a bug with interactions between `polyrelation` and deprecated `relation`. Updates run triggers to backfill the deprecated Sourceable field in the RunTrigger struct.
1 parent cec7ba3 commit f215e07

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/hashicorp/go-slug v0.16.0
1010
github.com/hashicorp/go-uuid v1.0.3
1111
github.com/hashicorp/go-version v1.7.0
12-
github.com/hashicorp/jsonapi v1.3.1
12+
github.com/hashicorp/jsonapi v1.3.2
1313
github.com/stretchr/testify v1.9.0
1414
go.uber.org/mock v0.4.0
1515
golang.org/x/sync v0.8.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C
1616
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
1717
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
1818
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
19-
github.com/hashicorp/jsonapi v1.3.1 h1:GtPvnmcWgYwCuDGvYT5VZBHcUyFdq9lSyCzDjn1DdPo=
20-
github.com/hashicorp/jsonapi v1.3.1/go.mod h1:kWfdn49yCjQvbpnvY1dxxAuAFzISwrrMDQOcu6NsFoM=
19+
github.com/hashicorp/jsonapi v1.3.2 h1:gP3fX2ZT7qXi+PbwieptzkspIohO2kCSiBUvUTBAbMs=
20+
github.com/hashicorp/jsonapi v1.3.2/go.mod h1:kWfdn49yCjQvbpnvY1dxxAuAFzISwrrMDQOcu6NsFoM=
2121
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
2222
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
2323
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

run_trigger.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ func (s *runTriggers) List(ctx context.Context, workspaceID string, options *Run
121121
return nil, err
122122
}
123123

124+
for i := range rtl.Items {
125+
backfillDeprecatedSourceable(rtl.Items[i])
126+
}
127+
124128
return rtl, nil
125129
}
126130

@@ -145,6 +149,8 @@ func (s *runTriggers) Create(ctx context.Context, workspaceID string, options Ru
145149
return nil, err
146150
}
147151

152+
backfillDeprecatedSourceable(rt)
153+
148154
return rt, nil
149155
}
150156

@@ -166,6 +172,8 @@ func (s *runTriggers) Read(ctx context.Context, runTriggerID string) (*RunTrigge
166172
return nil, err
167173
}
168174

175+
backfillDeprecatedSourceable(rt)
176+
169177
return rt, nil
170178
}
171179

@@ -203,6 +211,14 @@ func (o *RunTriggerListOptions) valid() error {
203211
return nil
204212
}
205213

214+
func backfillDeprecatedSourceable(runTrigger *RunTrigger) {
215+
if runTrigger.Sourceable != nil || runTrigger.SourceableChoice == nil {
216+
return
217+
}
218+
219+
runTrigger.Sourceable = runTrigger.SourceableChoice.Workspace
220+
}
221+
206222
func validateRunTriggerFilterParam(filterParam RunTriggerFilterOp, includeParams []RunTriggerIncludeOpt) error {
207223
switch filterParam {
208224
case RunTriggerOutbound, RunTriggerInbound:

0 commit comments

Comments
 (0)