mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 17:54:07 +01:00
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:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -31,7 +31,7 @@ var Command = &cli.Command{
|
||||
Name: "pipeline",
|
||||
Usage: "manage pipelines",
|
||||
Commands: []*cli.Command{
|
||||
pipelineListCmd,
|
||||
buildPipelineListCmd(),
|
||||
pipelineLastCmd,
|
||||
pipelineLogsCmd,
|
||||
pipelineInfoCmd,
|
||||
|
||||
Reference in New Issue
Block a user