Skip to content

upgrade urfave cli v2 to v3#106

Merged
BakerNet merged 1 commit into
renovate/github.com-urfave-cli-v2-3.xfrom
update-urfave-cli-v3
Mar 17, 2026
Merged

upgrade urfave cli v2 to v3#106
BakerNet merged 1 commit into
renovate/github.com-urfave-cli-v2-3.xfrom
update-urfave-cli-v3

Conversation

@BakerNet

Copy link
Copy Markdown
Collaborator

Related PR(s)

Related Issue(s)

Summary / Background

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant dependency upgrade, moving the project's command-line interface library, urfave/cli, from its second major version to its third. This update involved not only adjusting the project's dependency manifest but also refactoring the CLI's main application logic to align with the new API of the upgraded library. The change ensures the project leverages the latest features and improvements of urfave/cli while maintaining full functionality.

Highlights

  • Dependency Upgrade: The urfave/cli library has been upgraded from version 2 to version 3, reflecting a major version change.
  • API Adaptation: The tools/cli/main.go file was updated to adapt to the breaking API changes introduced in urfave/cli v3, including changes to context handling and command action signatures.
  • Dependency Cleanup: Several indirect dependencies that were previously required by urfave/cli/v2 have been removed from go.mod and go.sum as they are no longer needed by v3.
Changelog
  • go.mod
    • Updated github.com/urfave/cli from v2.27.7 to v3.7.0.
    • Removed indirect dependencies github.com/cpuguy83/go-md2man/v2, github.com/russross/blackfriday/v2, and github.com/xrash/smetrics.
  • go.sum
    • Removed checksum entries for github.com/cpuguy83/go-md2man/v2, github.com/russross/blackfriday/v2, and github.com/xrash/smetrics.
    • Added new checksum entries for github.com/davecgh/go-spew, github.com/pmezard/go-difflib, github.com/stretchr/testify, and gopkg.in/yaml.v3.
    • Updated checksum entry for github.com/urfave/cli/v3.
  • tools/cli/main.go
    • Imported the context package.
    • Updated the urfave/cli import path from v2 to v3.
    • Modified getTargets function signature to accept *cli.Command instead of *cli.Context.
    • Updated cli.VersionPrinter function signature to accept *cli.Command and adjusted version access to cmd.Root().Version.
    • Changed cli.App to cli.Command for the main application definition.
    • Updated Action function signatures within commands to accept context.Context and *cli.Command.
    • Adjusted access to command flags from cCtx.String() to cmd.String() and cCtx.Int() to int(cmd.Int()).
    • Modified the app.Run call to include context.Background() as the first argument.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@BakerNet BakerNet merged commit 9e561c2 into renovate/github.com-urfave-cli-v2-3.x Mar 17, 2026
@BakerNet BakerNet deleted the update-urfave-cli-v3 branch March 17, 2026 18:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades urfave/cli from v2 to v3. The changes correctly adapt the code to the new API of urfave/cli/v3, including updating type definitions, function signatures, and method calls. The migration appears to be complete and correct, and I have not found any issues with the implementation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant