buildkite / buildkite/agent

Update cli/urfave to v2

Open
#1,610 3 comments 0 reactions 0 assignees View on GitHub
breaking v4
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

The library that we use to have a nice cli, [urfave/cli](https://github.com/urfave/cli) has had a new major version, v2, for a little while now. For the sake of staying as current as possible with our dependencies, we should update this to the newest version.

Unfortunately, v2 of urfave/cli includes [a breaking change](https://github.com/urfave/cli/blob/master/docs/migrate-v1-to-v2.md#flags-before-args=) where now, arguments to functions must come before flags - ie, where
```
buildkite-agent pipeline upload /path/to/pipeline --replace
```
is valid in v1, in v2 only
```
buildkite-agent pipeline upload --replace /path/to/pipeline
```
is allowed.

This issue is here to track that process, and note that we might want to (but won't necessarily) upgrade to the latest version of cli in agent v4.

Contributor guide

Open the contributing guide

Research direction

Start with the urfave/cli v1-to-v2 migration guide linked in the issue, then inspect the pipeline upload command and the other agent CLI entry points. Verify that the dependency is upgraded and that arguments before flags, such as `pipeline upload --replace /path/to/pipeline`, work as required by v2; consider whether the change belongs in agent v4.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.