Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sg] Upgrade urfave/cli from v2 to v3 #61239

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jamesmcnamara
Copy link
Contributor

@jamesmcnamara jamesmcnamara commented Mar 18, 2024

This seems like it will fix the bash completion problem but we are blocked until urfave/cli#833 is released and its outstanding issues are fixed. Current known issues:

  • v3 hardcodes the bash-completion parameter --generate-shell-completion even though they have documented that it is customizable
  • Autocompletions do not have access to flags and don't currently autocomplete flags or offer flag sensitive values
  • background.loadFromContext throws some error when trying to cast one type to another:
goroutine 1 [running]:
github.com/sourcegraph/sourcegraph/dev/sg/internal/background.loadFromContext(...)
	dev/sg/internal/background/background.go:40
github.com/sourcegraph/sourcegraph/dev/sg/internal/background.Wait({0x1097245d8, 0x14002912a50}, 0x14002b012e0)
	dev/sg/internal/background/background.go:70 +0x5d4
main.init.func54({0x1097245d8, 0x14002912a50}, 0x1?)
	dev/sg/main.go:253 +0x40
github.com/urfave/cli/v3.(*Command).Run.func1()
	external/com_github_urfave_cli_v3/command.go:532 +0x48
github.com/urfave/cli/v3.(*Command).Run(0x10bd00e40, {0x1097244d8, 0x10ea8bee0}, {0x140001ca000, 0x5, 0x5})
	external/com_github_urfave_cli_v3/command.go:620 +0x12dc
main.main()
	dev/sg/main.go:36 +0xa0

Test plan

Ran some tests locally but this needs more thorough testing.

@bobheadxi
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants