Skip to content

Commit b687ba8

Browse files
stainless-app[bot]yjp20
authored andcommitted
fix: pass through context parameter correctly
1 parent 0d046de commit b687ba8

File tree

8 files changed

+40
-40
lines changed

8 files changed

+40
-40
lines changed

pkg/cmd/build.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ var buildsCompare = cli.Command{
460460
HideHelpCommand: true,
461461
}
462462

463-
func handleBuildsCreate(_ context.Context, cmd *cli.Command) error {
463+
func handleBuildsCreate(ctx context.Context, cmd *cli.Command) error {
464464
cc := getAPICommandContext(cmd)
465465
unusedArgs := cmd.Args().Slice()
466466
if len(unusedArgs) > 0 {
@@ -480,7 +480,7 @@ func handleBuildsCreate(_ context.Context, cmd *cli.Command) error {
480480
buildGroup := Info("Creating build...")
481481
params := stainless.BuildNewParams{}
482482
res, err := cc.client.Builds.New(
483-
context.TODO(),
483+
ctx,
484484
params,
485485
option.WithMiddleware(cc.AsMiddleware()),
486486
)
@@ -517,7 +517,7 @@ func handleBuildsCreate(_ context.Context, cmd *cli.Command) error {
517517
return ShowJSON("builds create", data, format, transform)
518518
}
519519

520-
func handleBuildsRetrieve(_ context.Context, cmd *cli.Command) error {
520+
func handleBuildsRetrieve(ctx context.Context, cmd *cli.Command) error {
521521
cc := getAPICommandContext(cmd)
522522
unusedArgs := cmd.Args().Slice()
523523
if !cmd.IsSet("build-id") && len(unusedArgs) > 0 {
@@ -529,7 +529,7 @@ func handleBuildsRetrieve(_ context.Context, cmd *cli.Command) error {
529529
}
530530
var res []byte
531531
_, err := cc.client.Builds.Get(
532-
context.TODO(),
532+
ctx,
533533
cmd.Value("build-id").(string),
534534
option.WithMiddleware(cc.AsMiddleware()),
535535
option.WithResponseBodyInto(&res),
@@ -813,7 +813,7 @@ func pullOutput(output, url, ref, targetDir string, targetGroup *Group) error {
813813
return nil
814814
}
815815

816-
func handleBuildsList(_ context.Context, cmd *cli.Command) error {
816+
func handleBuildsList(ctx context.Context, cmd *cli.Command) error {
817817
cc := getAPICommandContext(cmd)
818818
unusedArgs := cmd.Args().Slice()
819819
if len(unusedArgs) > 0 {
@@ -822,7 +822,7 @@ func handleBuildsList(_ context.Context, cmd *cli.Command) error {
822822
params := stainless.BuildListParams{}
823823
var res []byte
824824
_, err := cc.client.Builds.List(
825-
context.TODO(),
825+
ctx,
826826
params,
827827
option.WithMiddleware(cc.AsMiddleware()),
828828
option.WithResponseBodyInto(&res),
@@ -837,7 +837,7 @@ func handleBuildsList(_ context.Context, cmd *cli.Command) error {
837837
return ShowJSON("builds list", json, format, transform)
838838
}
839839

840-
func handleBuildsCompare(_ context.Context, cmd *cli.Command) error {
840+
func handleBuildsCompare(ctx context.Context, cmd *cli.Command) error {
841841
cc := getAPICommandContext(cmd)
842842
unusedArgs := cmd.Args().Slice()
843843
if len(unusedArgs) > 0 {
@@ -846,7 +846,7 @@ func handleBuildsCompare(_ context.Context, cmd *cli.Command) error {
846846
params := stainless.BuildCompareParams{}
847847
var res []byte
848848
_, err := cc.client.Builds.Compare(
849-
context.TODO(),
849+
ctx,
850850
params,
851851
option.WithMiddleware(cc.AsMiddleware()),
852852
option.WithResponseBodyInto(&res),

pkg/cmd/builddiagnostic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var buildsDiagnosticsList = cli.Command{
6767
HideHelpCommand: true,
6868
}
6969

70-
func handleBuildsDiagnosticsList(_ context.Context, cmd *cli.Command) error {
70+
func handleBuildsDiagnosticsList(ctx context.Context, cmd *cli.Command) error {
7171
cc := getAPICommandContext(cmd)
7272
unusedArgs := cmd.Args().Slice()
7373
if !cmd.IsSet("build-id") && len(unusedArgs) > 0 {
@@ -80,7 +80,7 @@ func handleBuildsDiagnosticsList(_ context.Context, cmd *cli.Command) error {
8080
params := stainless.BuildDiagnosticListParams{}
8181
var res []byte
8282
_, err := cc.client.Builds.Diagnostics.List(
83-
context.TODO(),
83+
ctx,
8484
cmd.Value("build-id").(string),
8585
params,
8686
option.WithMiddleware(cc.AsMiddleware()),

pkg/cmd/buildtargetoutput.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var buildsTargetOutputsRetrieve = cli.Command{
6565
Action: handleBuildsTargetOutputsRetrieve,
6666
}
6767

68-
func handleBuildsTargetOutputsRetrieve(_ context.Context, cmd *cli.Command) error {
68+
func handleBuildsTargetOutputsRetrieve(ctx context.Context, cmd *cli.Command) error {
6969
cc := getAPICommandContext(cmd)
7070
unusedArgs := cmd.Args().Slice()
7171
if len(unusedArgs) > 0 {
@@ -86,7 +86,7 @@ func handleBuildsTargetOutputsRetrieve(_ context.Context, cmd *cli.Command) erro
8686
}
8787
var resBytes []byte
8888
res, err := cc.client.Builds.TargetOutputs.Get(
89-
context.TODO(),
89+
ctx,
9090
params,
9191
option.WithMiddleware(cc.AsMiddleware()),
9292
option.WithResponseBodyInto(&resBytes),

pkg/cmd/org.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var orgsList = cli.Command{
3131
HideHelpCommand: true,
3232
}
3333

34-
func handleOrgsRetrieve(_ context.Context, cmd *cli.Command) error {
34+
func handleOrgsRetrieve(ctx context.Context, cmd *cli.Command) error {
3535
cc := getAPICommandContext(cmd)
3636
unusedArgs := cmd.Args().Slice()
3737
if !cmd.IsSet("org") && len(unusedArgs) > 0 {
@@ -43,7 +43,7 @@ func handleOrgsRetrieve(_ context.Context, cmd *cli.Command) error {
4343
}
4444
var res []byte
4545
_, err := cc.client.Orgs.Get(
46-
context.TODO(),
46+
ctx,
4747
cmd.Value("org").(string),
4848
option.WithMiddleware(cc.AsMiddleware()),
4949
option.WithResponseBodyInto(&res),
@@ -58,15 +58,15 @@ func handleOrgsRetrieve(_ context.Context, cmd *cli.Command) error {
5858
return ShowJSON("orgs retrieve", json, format, transform)
5959
}
6060

61-
func handleOrgsList(_ context.Context, cmd *cli.Command) error {
61+
func handleOrgsList(ctx context.Context, cmd *cli.Command) error {
6262
cc := getAPICommandContext(cmd)
6363
unusedArgs := cmd.Args().Slice()
6464
if len(unusedArgs) > 0 {
6565
return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs)
6666
}
6767
var res []byte
6868
_, err := cc.client.Orgs.List(
69-
context.TODO(),
69+
ctx,
7070
option.WithMiddleware(cc.AsMiddleware()),
7171
option.WithResponseBodyInto(&res),
7272
)

pkg/cmd/project.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var projectsList = cli.Command{
126126
HideHelpCommand: true,
127127
}
128128

129-
func handleProjectsCreate(_ context.Context, cmd *cli.Command) error {
129+
func handleProjectsCreate(ctx context.Context, cmd *cli.Command) error {
130130
cc := getAPICommandContext(cmd)
131131
unusedArgs := cmd.Args().Slice()
132132
if len(unusedArgs) > 0 {
@@ -135,7 +135,7 @@ func handleProjectsCreate(_ context.Context, cmd *cli.Command) error {
135135
params := stainless.ProjectNewParams{}
136136
var res []byte
137137
_, err := cc.client.Projects.New(
138-
context.TODO(),
138+
ctx,
139139
params,
140140
option.WithMiddleware(cc.AsMiddleware()),
141141
option.WithResponseBodyInto(&res),
@@ -150,7 +150,7 @@ func handleProjectsCreate(_ context.Context, cmd *cli.Command) error {
150150
return ShowJSON("projects create", json, format, transform)
151151
}
152152

153-
func handleProjectsRetrieve(_ context.Context, cmd *cli.Command) error {
153+
func handleProjectsRetrieve(ctx context.Context, cmd *cli.Command) error {
154154
cc := getAPICommandContext(cmd)
155155
unusedArgs := cmd.Args().Slice()
156156
if len(unusedArgs) > 0 {
@@ -162,7 +162,7 @@ func handleProjectsRetrieve(_ context.Context, cmd *cli.Command) error {
162162
}
163163
var res []byte
164164
_, err := cc.client.Projects.Get(
165-
context.TODO(),
165+
ctx,
166166
params,
167167
option.WithMiddleware(cc.AsMiddleware()),
168168
option.WithResponseBodyInto(&res),
@@ -177,7 +177,7 @@ func handleProjectsRetrieve(_ context.Context, cmd *cli.Command) error {
177177
return ShowJSON("projects retrieve", json, format, transform)
178178
}
179179

180-
func handleProjectsUpdate(_ context.Context, cmd *cli.Command) error {
180+
func handleProjectsUpdate(ctx context.Context, cmd *cli.Command) error {
181181
cc := getAPICommandContext(cmd)
182182
unusedArgs := cmd.Args().Slice()
183183
if len(unusedArgs) > 0 {
@@ -189,7 +189,7 @@ func handleProjectsUpdate(_ context.Context, cmd *cli.Command) error {
189189
}
190190
var res []byte
191191
_, err := cc.client.Projects.Update(
192-
context.TODO(),
192+
ctx,
193193
params,
194194
option.WithMiddleware(cc.AsMiddleware()),
195195
option.WithResponseBodyInto(&res),
@@ -204,7 +204,7 @@ func handleProjectsUpdate(_ context.Context, cmd *cli.Command) error {
204204
return ShowJSON("projects update", json, format, transform)
205205
}
206206

207-
func handleProjectsList(_ context.Context, cmd *cli.Command) error {
207+
func handleProjectsList(ctx context.Context, cmd *cli.Command) error {
208208
cc := getAPICommandContext(cmd)
209209
unusedArgs := cmd.Args().Slice()
210210
if len(unusedArgs) > 0 {
@@ -213,7 +213,7 @@ func handleProjectsList(_ context.Context, cmd *cli.Command) error {
213213
params := stainless.ProjectListParams{}
214214
var res []byte
215215
_, err := cc.client.Projects.List(
216-
context.TODO(),
216+
ctx,
217217
params,
218218
option.WithMiddleware(cc.AsMiddleware()),
219219
option.WithResponseBodyInto(&res),

pkg/cmd/projectbranch.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var projectsBranchesRebase = cli.Command{
134134
HideHelpCommand: true,
135135
}
136136

137-
func handleProjectsBranchesCreate(_ context.Context, cmd *cli.Command) error {
137+
func handleProjectsBranchesCreate(ctx context.Context, cmd *cli.Command) error {
138138
cc := getAPICommandContext(cmd)
139139
unusedArgs := cmd.Args().Slice()
140140
if len(unusedArgs) > 0 {
@@ -146,7 +146,7 @@ func handleProjectsBranchesCreate(_ context.Context, cmd *cli.Command) error {
146146
}
147147
var res []byte
148148
_, err := cc.client.Projects.Branches.New(
149-
context.TODO(),
149+
ctx,
150150
params,
151151
option.WithMiddleware(cc.AsMiddleware()),
152152
option.WithResponseBodyInto(&res),
@@ -161,7 +161,7 @@ func handleProjectsBranchesCreate(_ context.Context, cmd *cli.Command) error {
161161
return ShowJSON("projects:branches create", json, format, transform)
162162
}
163163

164-
func handleProjectsBranchesRetrieve(_ context.Context, cmd *cli.Command) error {
164+
func handleProjectsBranchesRetrieve(ctx context.Context, cmd *cli.Command) error {
165165
cc := getAPICommandContext(cmd)
166166
unusedArgs := cmd.Args().Slice()
167167
if !cmd.IsSet("branch") && len(unusedArgs) > 0 {
@@ -177,7 +177,7 @@ func handleProjectsBranchesRetrieve(_ context.Context, cmd *cli.Command) error {
177177
}
178178
var res []byte
179179
_, err := cc.client.Projects.Branches.Get(
180-
context.TODO(),
180+
ctx,
181181
cmd.Value("branch").(string),
182182
params,
183183
option.WithMiddleware(cc.AsMiddleware()),
@@ -193,7 +193,7 @@ func handleProjectsBranchesRetrieve(_ context.Context, cmd *cli.Command) error {
193193
return ShowJSON("projects:branches retrieve", json, format, transform)
194194
}
195195

196-
func handleProjectsBranchesList(_ context.Context, cmd *cli.Command) error {
196+
func handleProjectsBranchesList(ctx context.Context, cmd *cli.Command) error {
197197
cc := getAPICommandContext(cmd)
198198
unusedArgs := cmd.Args().Slice()
199199
if len(unusedArgs) > 0 {
@@ -205,7 +205,7 @@ func handleProjectsBranchesList(_ context.Context, cmd *cli.Command) error {
205205
}
206206
var res []byte
207207
_, err := cc.client.Projects.Branches.List(
208-
context.TODO(),
208+
ctx,
209209
params,
210210
option.WithMiddleware(cc.AsMiddleware()),
211211
option.WithResponseBodyInto(&res),
@@ -220,7 +220,7 @@ func handleProjectsBranchesList(_ context.Context, cmd *cli.Command) error {
220220
return ShowJSON("projects:branches list", json, format, transform)
221221
}
222222

223-
func handleProjectsBranchesDelete(_ context.Context, cmd *cli.Command) error {
223+
func handleProjectsBranchesDelete(ctx context.Context, cmd *cli.Command) error {
224224
cc := getAPICommandContext(cmd)
225225
unusedArgs := cmd.Args().Slice()
226226
if !cmd.IsSet("branch") && len(unusedArgs) > 0 {
@@ -236,7 +236,7 @@ func handleProjectsBranchesDelete(_ context.Context, cmd *cli.Command) error {
236236
}
237237
var res []byte
238238
_, err := cc.client.Projects.Branches.Delete(
239-
context.TODO(),
239+
ctx,
240240
cmd.Value("branch").(string),
241241
params,
242242
option.WithMiddleware(cc.AsMiddleware()),
@@ -252,7 +252,7 @@ func handleProjectsBranchesDelete(_ context.Context, cmd *cli.Command) error {
252252
return ShowJSON("projects:branches delete", json, format, transform)
253253
}
254254

255-
func handleProjectsBranchesRebase(_ context.Context, cmd *cli.Command) error {
255+
func handleProjectsBranchesRebase(ctx context.Context, cmd *cli.Command) error {
256256
cc := getAPICommandContext(cmd)
257257
unusedArgs := cmd.Args().Slice()
258258
if !cmd.IsSet("branch") && len(unusedArgs) > 0 {
@@ -268,7 +268,7 @@ func handleProjectsBranchesRebase(_ context.Context, cmd *cli.Command) error {
268268
}
269269
var res []byte
270270
_, err := cc.client.Projects.Branches.Rebase(
271-
context.TODO(),
271+
ctx,
272272
cmd.Value("branch").(string),
273273
params,
274274
option.WithMiddleware(cc.AsMiddleware()),

pkg/cmd/projectconfig.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var projectsConfigsGuess = cli.Command{
7070
HideHelpCommand: true,
7171
}
7272

73-
func handleProjectsConfigsRetrieve(_ context.Context, cmd *cli.Command) error {
73+
func handleProjectsConfigsRetrieve(ctx context.Context, cmd *cli.Command) error {
7474
cc := getAPICommandContext(cmd)
7575
unusedArgs := cmd.Args().Slice()
7676
if len(unusedArgs) > 0 {
@@ -82,7 +82,7 @@ func handleProjectsConfigsRetrieve(_ context.Context, cmd *cli.Command) error {
8282
}
8383
var res []byte
8484
_, err := cc.client.Projects.Configs.Get(
85-
context.TODO(),
85+
ctx,
8686
params,
8787
option.WithMiddleware(cc.AsMiddleware()),
8888
option.WithResponseBodyInto(&res),
@@ -97,7 +97,7 @@ func handleProjectsConfigsRetrieve(_ context.Context, cmd *cli.Command) error {
9797
return ShowJSON("projects:configs retrieve", json, format, transform)
9898
}
9999

100-
func handleProjectsConfigsGuess(_ context.Context, cmd *cli.Command) error {
100+
func handleProjectsConfigsGuess(ctx context.Context, cmd *cli.Command) error {
101101
cc := getAPICommandContext(cmd)
102102
unusedArgs := cmd.Args().Slice()
103103
if len(unusedArgs) > 0 {
@@ -109,7 +109,7 @@ func handleProjectsConfigsGuess(_ context.Context, cmd *cli.Command) error {
109109
}
110110
var res []byte
111111
_, err := cc.client.Projects.Configs.Guess(
112-
context.TODO(),
112+
ctx,
113113
params,
114114
option.WithMiddleware(cc.AsMiddleware()),
115115
option.WithResponseBodyInto(&res),

pkg/cmd/spec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var specRetrieveDecoratedSpec = cli.Command{
2727
HideHelpCommand: true,
2828
}
2929

30-
func handleSpecRetrieveDecoratedSpec(_ context.Context, cmd *cli.Command) error {
30+
func handleSpecRetrieveDecoratedSpec(ctx context.Context, cmd *cli.Command) error {
3131
cc := getAPICommandContext(cmd)
3232
unusedArgs := cmd.Args().Slice()
3333
if !cmd.IsSet("project-name") && len(unusedArgs) > 0 {
@@ -43,7 +43,7 @@ func handleSpecRetrieveDecoratedSpec(_ context.Context, cmd *cli.Command) error
4343
}
4444
var res []byte
4545
_, err := cc.client.Spec.GetDecoratedSpec(
46-
context.TODO(),
46+
ctx,
4747
cmd.Value("project-name").(string),
4848
params,
4949
option.WithMiddleware(cc.AsMiddleware()),

0 commit comments

Comments
 (0)