Skip to content

Commit 60f3402

Browse files
chore(deps): update module github.com/urfave/cli/v2 to v3 (#1116)
* chore(deps): update module github.com/urfave/cli/v2 to v3 * Remove references to cli/v2 * Update trigger-argo-workflow to use cli/v3 --------- Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> Co-authored-by: Horst Gutmann <[email protected]>
1 parent 0d74abc commit 60f3402

File tree

6 files changed

+57
-67
lines changed

6 files changed

+57
-67
lines changed

actions/techdocs-rewrite-relative-links/go.mod

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ require (
1111
github.com/spf13/afero v1.14.0
1212
github.com/stretchr/testify v1.10.0
1313
github.com/teekennedy/goldmark-markdown v0.5.1
14-
github.com/urfave/cli/v2 v2.27.7
1514
github.com/urfave/cli/v3 v3.3.8
1615
github.com/willabides/actionslog v0.5.1
1716
github.com/yuin/goldmark v1.7.12
@@ -20,16 +19,13 @@ require (
2019
)
2120

2221
require (
23-
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
2422
github.com/davecgh/go-spew v1.1.1 // indirect
2523
github.com/fatih/color v1.10.0 // indirect
2624
github.com/goccy/go-yaml v1.11.0 // indirect
2725
github.com/kr/pretty v0.1.0 // indirect
2826
github.com/mattn/go-colorable v0.1.8 // indirect
2927
github.com/mattn/go-isatty v0.0.12 // indirect
3028
github.com/pmezard/go-difflib v1.0.0 // indirect
31-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
32-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
3329
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
3430
golang.org/x/sys v0.33.0 // indirect
3531
golang.org/x/text v0.23.0 // indirect

actions/techdocs-rewrite-relative-links/go.sum

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY=
22
github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E=
3-
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
4-
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
53
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
64
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
75
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
@@ -35,21 +33,16 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3533
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3634
github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY=
3735
github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE=
38-
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
39-
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
4036
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
4137
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
4238
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
4339
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
4440
github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKEsEj+asVsu6M/0=
4541
github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM=
46-
github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU=
47-
github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4=
42+
github.com/urfave/cli/v3 v3.3.8 h1:BzolUExliMdet9NlJ/u4m5vHSotJ3PzEqSAZ1oPMa/E=
4843
github.com/urfave/cli/v3 v3.3.8/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
4944
github.com/willabides/actionslog v0.5.1 h1:dJ/Cxg8vO1pEohgC2O4CW1tCWFKJrYJXTZDWYJQK0+E=
5045
github.com/willabides/actionslog v0.5.1/go.mod h1:WDufDP3XZUMBOmau2BvfVCGYuUcVRZI6Eqy8ZRw4pJ8=
51-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
52-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
5346
github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY=
5447
github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
5548
go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o=

actions/techdocs-rewrite-relative-links/main.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/lmittmann/tint"
1717
"github.com/spf13/afero"
1818
markdown "github.com/teekennedy/goldmark-markdown"
19-
"github.com/urfave/cli/v2"
19+
"github.com/urfave/cli/v3"
2020
"github.com/willabides/actionslog"
2121
"github.com/willabides/actionslog/human"
2222
"github.com/yuin/goldmark"
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
func main() {
32-
app := cli.App{
32+
app := cli.Command{
3333
Name: "techdocs-rewrite-relative-links",
3434
Flags: []cli.Flag{
3535
&cli.StringFlag{
@@ -66,20 +66,19 @@ func main() {
6666
Value: false,
6767
},
6868
},
69-
Action: func(cliCtx *cli.Context) error {
70-
repoURL := cliCtx.String("repo-url")
71-
defaultBranch := cliCtx.String("default-branch")
72-
rootDir := cliCtx.String("root-dir")
69+
Action: func(ctx context.Context, cmd *cli.Command) error {
70+
repoURL := cmd.String("repo-url")
71+
defaultBranch := cmd.String("default-branch")
72+
rootDir := cmd.String("root-dir")
7373

7474
level := slog.LevelWarn
75-
if cliCtx.Bool("debug") {
75+
if cmd.Bool("debug") {
7676
level = slog.LevelDebug
7777
}
78-
if level == slog.LevelDebug && cliCtx.Bool("verbose") {
78+
if level == slog.LevelDebug && cmd.Bool("verbose") {
7979
level = slog.LevelInfo
8080
}
8181

82-
ctx := cliCtx.Context
8382
var logger *slog.Logger
8483
if os.Getenv("GITHUB_ACTIONS") == "true" {
8584
handler := &human.Handler{}
@@ -104,7 +103,7 @@ func main() {
104103
}
105104
ctrl := controller{
106105
filesys: afero.NewOsFs(),
107-
dryRun: cliCtx.Bool("dry-run"),
106+
dryRun: cmd.Bool("dry-run"),
108107
logger: logger,
109108
rootDirectory: rootDir,
110109
repoURL: repoURL,
@@ -114,7 +113,7 @@ func main() {
114113
},
115114
}
116115
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
117-
if err := app.RunContext(ctx, os.Args); err != nil {
116+
if err := app.Run(ctx, os.Args); err != nil {
118117
cancel()
119118
slog.Error(err.Error())
120119
os.Exit(1)

actions/trigger-argo-workflow/cmd/trigger-argo-workflow/main.go

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"context"
45
"fmt"
56
"log/slog"
67
"maps"
@@ -9,7 +10,7 @@ import (
910
"strings"
1011

1112
"github.com/lmittmann/tint"
12-
cli "github.com/urfave/cli/v2"
13+
cli "github.com/urfave/cli/v3"
1314
"github.com/willabides/actionslog"
1415
"github.com/willabides/actionslog/human"
1516
"golang.org/x/term"
@@ -69,35 +70,43 @@ func main() {
6970
)
7071
}
7172

72-
app := cli.NewApp()
73+
app := cli.Command{}
7374
app.Name = "Runs the Argo CLI"
7475

75-
app.Action = func(c *cli.Context) error { return run(c, &lv, logger) }
76+
app.Action = func(ctx context.Context, c *cli.Command) error { return run(ctx, c, &lv, logger) }
7677

7778
app.Flags = []cli.Flag{
7879
&cli.BoolFlag{
79-
Name: flagAddCILabels,
80-
EnvVars: []string{"ADD_CI_LABELS"},
81-
Value: false,
82-
Usage: "If true, the `--labels` argument will be added with values from the environment. This is forced for the `submit` command",
80+
Name: flagAddCILabels,
81+
Sources: cli.NewValueSourceChain(
82+
cli.EnvVar("ADD_CI_LABELS"),
83+
),
84+
Value: false,
85+
Usage: "If true, the `--labels` argument will be added with values from the environment. This is forced for the `submit` command",
8386
},
8487
&cli.StringFlag{
85-
Name: flagNamespace,
86-
EnvVars: []string{"ARGO_NAMESPACE"},
88+
Name: flagNamespace,
89+
Sources: cli.NewValueSourceChain(
90+
cli.EnvVar("ARGO_NAMESPACE"),
91+
),
8792
Required: true,
8893
},
8994
&cli.StringFlag{
90-
Name: flagArgoToken,
91-
EnvVars: []string{"ARGO_TOKEN"},
95+
Name: flagArgoToken,
96+
Sources: cli.NewValueSourceChain(
97+
cli.EnvVar("ARGO_TOKEN"),
98+
),
9299
Usage: "The Argo token to use for authentication",
93100
Required: true,
94101
},
95102
&cli.StringFlag{
96-
Name: flagLogLevel,
97-
EnvVars: []string{"LOG_LEVEL"},
98-
Usage: "Which log level to use",
99-
Value: "info",
100-
Action: func(c *cli.Context, level string) error {
103+
Name: flagLogLevel,
104+
Sources: cli.NewValueSourceChain(
105+
cli.EnvVar("LOG_LEVEL"),
106+
),
107+
Usage: "Which log level to use",
108+
Value: "info",
109+
Action: func(ctx context.Context, c *cli.Command, level string) error {
101110
level = strings.ToLower(level)
102111

103112
lvl, err := parseLogLevel(level)
@@ -111,10 +120,12 @@ func main() {
111120
},
112121
},
113122
&cli.StringFlag{
114-
Name: flagInstance,
115-
EnvVars: []string{"INSTANCE"},
116-
Value: "ops",
117-
Action: func(c *cli.Context, instance string) error {
123+
Name: flagInstance,
124+
Sources: cli.NewValueSourceChain(
125+
cli.EnvVar("INSTANCE"),
126+
),
127+
Value: "ops",
128+
Action: func(ctx context.Context, c *cli.Command, instance string) error {
118129
// Validate it is a known instance
119130
instances := slices.Collect(maps.Keys(instanceToHost))
120131
if !slices.Contains(instances, instance) {
@@ -129,16 +140,20 @@ func main() {
129140
Usage: "Parameters to pass to the workflow template. Given as `key=value`. Specify multiple times for multiple parameters",
130141
},
131142
&cli.UintFlag{
132-
Name: flagRetries,
133-
EnvVars: []string{"RETRIES"},
134-
Value: 3,
135-
Usage: "Number of retries to make if the command fails",
143+
Name: flagRetries,
144+
Sources: cli.NewValueSourceChain(
145+
cli.EnvVar("RETRIES"),
146+
),
147+
Value: 3,
148+
Usage: "Number of retries to make if the command fails",
136149
},
137150
&cli.StringFlag{
138-
Name: flagWorkflowTemplate,
139-
EnvVars: []string{"WORKFLOW_TEMPLATE"},
140-
Usage: "The workflow template to use",
141-
Action: func(c *cli.Context, tpl string) error {
151+
Name: flagWorkflowTemplate,
152+
Sources: cli.NewValueSourceChain(
153+
cli.EnvVar("WORKFLOW_TEMPLATE"),
154+
),
155+
Usage: "The workflow template to use",
156+
Action: func(ctx context.Context, c *cli.Command, tpl string) error {
142157
// Required if command is `submit`
143158
if c.Args().First() == "submit" && tpl == "" {
144159
return fmt.Errorf("required flag: %s", flagWorkflowTemplate)
@@ -148,13 +163,13 @@ func main() {
148163
},
149164
}
150165

151-
if err := app.Run(os.Args); err != nil {
166+
if err := app.Run(context.Background(), os.Args); err != nil {
152167
logger.With("error", err).Error("failed to run")
153168
os.Exit(1)
154169
}
155170
}
156171

157-
func run(c *cli.Context, level *slog.LevelVar, logger *slog.Logger) error {
172+
func run(ctx context.Context, c *cli.Command, level *slog.LevelVar, logger *slog.Logger) error {
158173
addCILabels := c.Bool(flagAddCILabels)
159174
argoToken := c.String(flagArgoToken)
160175
command := c.Args().First()

actions/trigger-argo-workflow/go.mod

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,21 @@ go 1.23.1
44

55
require (
66
github.com/cenkalti/backoff/v4 v4.3.0
7-
github.com/cenkalti/backoff/v5 v5.0.2
87
github.com/kelseyhightower/envconfig v1.4.0
98
github.com/lmittmann/tint v1.1.2
109
github.com/stretchr/testify v1.10.0
11-
github.com/urfave/cli/v2 v2.27.7
1210
github.com/urfave/cli/v3 v3.3.8
1311
github.com/willabides/actionslog v0.5.1
1412
golang.org/x/term v0.32.0
1513
)
1614

1715
require (
18-
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
1916
github.com/davecgh/go-spew v1.1.1 // indirect
2017
github.com/fatih/color v1.10.0 // indirect
2118
github.com/goccy/go-yaml v1.11.0 // indirect
2219
github.com/mattn/go-colorable v0.1.8 // indirect
2320
github.com/mattn/go-isatty v0.0.12 // indirect
2421
github.com/pmezard/go-difflib v1.0.0 // indirect
25-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
26-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
2722
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
2823
golang.org/x/sys v0.33.0 // indirect
2924
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect

actions/trigger-argo-workflow/go.sum

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
22
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
3-
github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
4-
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
5-
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
63
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
74
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
85
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
@@ -29,17 +26,12 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
2926
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
3027
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
3128
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
32-
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
33-
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
3429
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
3530
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
36-
github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU=
37-
github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4=
31+
github.com/urfave/cli/v3 v3.3.8 h1:BzolUExliMdet9NlJ/u4m5vHSotJ3PzEqSAZ1oPMa/E=
3832
github.com/urfave/cli/v3 v3.3.8/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
3933
github.com/willabides/actionslog v0.5.1 h1:dJ/Cxg8vO1pEohgC2O4CW1tCWFKJrYJXTZDWYJQK0+E=
4034
github.com/willabides/actionslog v0.5.1/go.mod h1:WDufDP3XZUMBOmau2BvfVCGYuUcVRZI6Eqy8ZRw4pJ8=
41-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
42-
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
4335
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
4436
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
4537
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=

0 commit comments

Comments
 (0)