fix(deps): update golang-packages (#4401)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-11-18 19:40:45 +01:00
committed by GitHub
parent e95db23794
commit 78cc9eba4d
6 changed files with 81 additions and 79 deletions

View File

@@ -17,9 +17,9 @@ var (
cancelWaitForUpdate context.CancelCauseFunc
)
func Before(ctx context.Context, c *cli.Command) error {
func Before(ctx context.Context, c *cli.Command) (context.Context, error) {
if err := setupGlobalLogger(ctx, c); err != nil {
return err
return ctx, err
}
go func(context.Context) {
@@ -50,7 +50,7 @@ func Before(ctx context.Context, c *cli.Command) error {
}
}(ctx)
return config.Load(ctx, c)
return ctx, config.Load(ctx, c)
}
func After(_ context.Context, _ *cli.Command) error {

View File

@@ -24,31 +24,33 @@ import (
"go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker"
)
//nolint:mnd
var pipelineListCmd = &cli.Command{
Name: "ls",
Usage: "show pipeline history",
ArgsUsage: "<repo-id|repo-full-name>",
Action: List,
Flags: append(common.OutputFlags("table"), []cli.Flag{
&cli.StringFlag{
Name: "branch",
Usage: "branch filter",
},
&cli.StringFlag{
Name: "event",
Usage: "event filter",
},
&cli.StringFlag{
Name: "status",
Usage: "status filter",
},
&cli.IntFlag{
Name: "limit",
Usage: "limit the list size",
Value: 25,
},
}...),
func buildPipelineListCmd() *cli.Command {
return &cli.Command{
Name: "ls",
Usage: "show pipeline history",
ArgsUsage: "<repo-id|repo-full-name>",
Action: List,
Flags: append(common.OutputFlags("table"), []cli.Flag{
&cli.StringFlag{
Name: "branch",
Usage: "branch filter",
},
&cli.StringFlag{
Name: "event",
Usage: "event filter",
},
&cli.StringFlag{
Name: "status",
Usage: "status filter",
},
&cli.IntFlag{
Name: "limit",
Usage: "limit the list size",
//nolint:mnd
Value: 25,
},
}...),
}
}
func List(ctx context.Context, c *cli.Command) error {

View File

@@ -110,7 +110,7 @@ func TestPipelineList(t *testing.T) {
mockClient.On("PipelineList", mock.Anything).Return(tt.pipelines, tt.pipelineErr)
mockClient.On("RepoLookup", mock.Anything).Return(&woodpecker.Repo{ID: tt.repoID}, nil)
command := pipelineListCmd
command := buildPipelineListCmd()
command.Writer = io.Discard
command.Action = func(ctx context.Context, c *cli.Command) error {
pipelines, err := pipelineList(ctx, c, mockClient)

View File

@@ -31,7 +31,7 @@ var Command = &cli.Command{
Name: "pipeline",
Usage: "manage pipelines",
Commands: []*cli.Command{
pipelineListCmd,
buildPipelineListCmd(),
pipelineLastCmd,
pipelineLogsCmd,
pipelineInfoCmd,