Skip to content

Commit e0f62e4

Browse files
authored
Revert "chore(deps): update module github.com/urfave/cli/v2 to v3" (#1124)
Revert "chore(deps): update module github.com/urfave/cli/v2 to v3 (#1116)" This reverts commit 60f3402.
1 parent 254923a commit e0f62e4

File tree

6 files changed

+67
-57
lines changed

6 files changed

+67
-57
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ 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
1415
github.com/urfave/cli/v3 v3.3.8
1516
github.com/willabides/actionslog v0.5.1
1617
github.com/yuin/goldmark v1.7.12
@@ -19,13 +20,16 @@ require (
1920
)
2021

2122
require (
23+
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
2224
github.com/davecgh/go-spew v1.1.1 // indirect
2325
github.com/fatih/color v1.10.0 // indirect
2426
github.com/goccy/go-yaml v1.11.0 // indirect
2527
github.com/kr/pretty v0.1.0 // indirect
2628
github.com/mattn/go-colorable v0.1.8 // indirect
2729
github.com/mattn/go-isatty v0.0.12 // indirect
2830
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
2933
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
3034
golang.org/x/sys v0.33.0 // indirect
3135
golang.org/x/text v0.23.0 // indirect

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
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=
35
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
46
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
57
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
@@ -33,16 +35,21 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
3335
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
3436
github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY=
3537
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=
3640
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
3741
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
3842
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
3943
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
4044
github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKEsEj+asVsu6M/0=
4145
github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM=
42-
github.com/urfave/cli/v3 v3.3.8 h1:BzolUExliMdet9NlJ/u4m5vHSotJ3PzEqSAZ1oPMa/E=
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=
4348
github.com/urfave/cli/v3 v3.3.8/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
4449
github.com/willabides/actionslog v0.5.1 h1:dJ/Cxg8vO1pEohgC2O4CW1tCWFKJrYJXTZDWYJQK0+E=
4550
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=
4653
github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY=
4754
github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
4855
go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o=

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

Lines changed: 11 additions & 10 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/v3"
19+
"github.com/urfave/cli/v2"
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.Command{
32+
app := cli.App{
3333
Name: "techdocs-rewrite-relative-links",
3434
Flags: []cli.Flag{
3535
&cli.StringFlag{
@@ -66,19 +66,20 @@ func main() {
6666
Value: false,
6767
},
6868
},
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")
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")
7373

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

82+
ctx := cliCtx.Context
8283
var logger *slog.Logger
8384
if os.Getenv("GITHUB_ACTIONS") == "true" {
8485
handler := &human.Handler{}
@@ -103,7 +104,7 @@ func main() {
103104
}
104105
ctrl := controller{
105106
filesys: afero.NewOsFs(),
106-
dryRun: cmd.Bool("dry-run"),
107+
dryRun: cliCtx.Bool("dry-run"),
107108
logger: logger,
108109
rootDirectory: rootDir,
109110
repoURL: repoURL,
@@ -113,7 +114,7 @@ func main() {
113114
},
114115
}
115116
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
116-
if err := app.Run(ctx, os.Args); err != nil {
117+
if err := app.RunContext(ctx, os.Args); err != nil {
117118
cancel()
118119
slog.Error(err.Error())
119120
os.Exit(1)

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

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

33
import (
4-
"context"
54
"fmt"
65
"log/slog"
76
"maps"
@@ -10,7 +9,7 @@ import (
109
"strings"
1110

1211
"github.com/lmittmann/tint"
13-
cli "github.com/urfave/cli/v3"
12+
cli "github.com/urfave/cli/v2"
1413
"github.com/willabides/actionslog"
1514
"github.com/willabides/actionslog/human"
1615
"golang.org/x/term"
@@ -70,43 +69,35 @@ func main() {
7069
)
7170
}
7271

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

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

7877
app.Flags = []cli.Flag{
7978
&cli.BoolFlag{
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",
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",
8683
},
8784
&cli.StringFlag{
88-
Name: flagNamespace,
89-
Sources: cli.NewValueSourceChain(
90-
cli.EnvVar("ARGO_NAMESPACE"),
91-
),
85+
Name: flagNamespace,
86+
EnvVars: []string{"ARGO_NAMESPACE"},
9287
Required: true,
9388
},
9489
&cli.StringFlag{
95-
Name: flagArgoToken,
96-
Sources: cli.NewValueSourceChain(
97-
cli.EnvVar("ARGO_TOKEN"),
98-
),
90+
Name: flagArgoToken,
91+
EnvVars: []string{"ARGO_TOKEN"},
9992
Usage: "The Argo token to use for authentication",
10093
Required: true,
10194
},
10295
&cli.StringFlag{
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 {
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 {
110101
level = strings.ToLower(level)
111102

112103
lvl, err := parseLogLevel(level)
@@ -120,12 +111,10 @@ func main() {
120111
},
121112
},
122113
&cli.StringFlag{
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 {
114+
Name: flagInstance,
115+
EnvVars: []string{"INSTANCE"},
116+
Value: "ops",
117+
Action: func(c *cli.Context, instance string) error {
129118
// Validate it is a known instance
130119
instances := slices.Collect(maps.Keys(instanceToHost))
131120
if !slices.Contains(instances, instance) {
@@ -140,20 +129,16 @@ func main() {
140129
Usage: "Parameters to pass to the workflow template. Given as `key=value`. Specify multiple times for multiple parameters",
141130
},
142131
&cli.UintFlag{
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",
132+
Name: flagRetries,
133+
EnvVars: []string{"RETRIES"},
134+
Value: 3,
135+
Usage: "Number of retries to make if the command fails",
149136
},
150137
&cli.StringFlag{
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 {
138+
Name: flagWorkflowTemplate,
139+
EnvVars: []string{"WORKFLOW_TEMPLATE"},
140+
Usage: "The workflow template to use",
141+
Action: func(c *cli.Context, tpl string) error {
157142
// Required if command is `submit`
158143
if c.Args().First() == "submit" && tpl == "" {
159144
return fmt.Errorf("required flag: %s", flagWorkflowTemplate)
@@ -163,13 +148,13 @@ func main() {
163148
},
164149
}
165150

166-
if err := app.Run(context.Background(), os.Args); err != nil {
151+
if err := app.Run(os.Args); err != nil {
167152
logger.With("error", err).Error("failed to run")
168153
os.Exit(1)
169154
}
170155
}
171156

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

actions/trigger-argo-workflow/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@ 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
78
github.com/kelseyhightower/envconfig v1.4.0
89
github.com/lmittmann/tint v1.1.2
910
github.com/stretchr/testify v1.10.0
11+
github.com/urfave/cli/v2 v2.27.7
1012
github.com/urfave/cli/v3 v3.3.8
1113
github.com/willabides/actionslog v0.5.1
1214
golang.org/x/term v0.32.0
1315
)
1416

1517
require (
18+
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
1619
github.com/davecgh/go-spew v1.1.1 // indirect
1720
github.com/fatih/color v1.10.0 // indirect
1821
github.com/goccy/go-yaml v1.11.0 // indirect
1922
github.com/mattn/go-colorable v0.1.8 // indirect
2023
github.com/mattn/go-isatty v0.0.12 // indirect
2124
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
2227
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
2328
golang.org/x/sys v0.33.0 // indirect
2429
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect

actions/trigger-argo-workflow/go.sum

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
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=
36
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
47
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
58
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
@@ -26,12 +29,17 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
2629
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
2730
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2831
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=
2934
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
3035
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
31-
github.com/urfave/cli/v3 v3.3.8 h1:BzolUExliMdet9NlJ/u4m5vHSotJ3PzEqSAZ1oPMa/E=
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=
3238
github.com/urfave/cli/v3 v3.3.8/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZtpYpo=
3339
github.com/willabides/actionslog v0.5.1 h1:dJ/Cxg8vO1pEohgC2O4CW1tCWFKJrYJXTZDWYJQK0+E=
3440
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=
3543
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
3644
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
3745
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=

0 commit comments

Comments
 (0)