Skip to content

Include run in list of common commands#1752

Open
CrimsonVoid wants to merge 3 commits into
containers:mainfrom
CrimsonVoid:doc-run-commonCmd
Open

Include run in list of common commands#1752
CrimsonVoid wants to merge 3 commits into
containers:mainfrom
CrimsonVoid:doc-run-commonCmd

Conversation

@CrimsonVoid
Copy link
Copy Markdown

The idea was to make toolbox run a little more discoverable when running just toolbox; for a while I was under the assumption that toolbox only supported create, enter, and list (knowing about run earlier would have solved the major reason I reached for distrobox)

I know the help document covers all available commands, but it was busy enough that I glazed over the commands section at the end.

Tradeoffs & Concerns

I am a little hesitant to include too many things in commonCommands at the risk of users glazing over the output (like myself). A short list of three commands covering most people's workflow might be a sweet spot and moving discoverability of toolbox run et al. somewhere else might be more prudent; perhaps just mentioning a full list of commands can be found elsewhere would be enough.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @CrimsonVoid, 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 enhances the user experience by making the toolbox run command more prominent in the application's help output. By integrating run into the list of commonly displayed commands, users can more easily discover and utilize this functionality, addressing a common feedback point regarding command discoverability and improving the overall usability of the toolbox utility.

Highlights

  • Command Discoverability: The toolbox run command has been added to the list of common commands displayed when toolbox is invoked without arguments or with help flags, significantly improving its discoverability for users.
  • Core Logic Update: The src/cmd/utils.go file was modified to include the run command and its description within the getUsageForCommonCommands function, which generates the common commands list.
  • Test Suite Adjustment: The system tests in test/system/002-help.bats were updated to reflect the new expected output order and content for the common commands list, ensuring that the help message displays correctly after the change.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

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

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 adds the run command to the list of common commands to improve its discoverability. The change in src/cmd/utils.go is correct. However, the system tests in test/system/002-help.bats were not fully updated to account for the new line in the help output, which will cause them to fail. I've left comments with suggestions to fix the test assertions.

Comment thread test/system/002-help.bats Outdated
Comment thread test/system/002-help.bats Outdated
Comment thread test/system/002-help.bats Outdated
@softwarefactory-project-zuul
Copy link
Copy Markdown

Signed-off-by: CrimsonVoid <CrimsonVoid@users.noreply.github.com>
Signed-off-by: CrimsonVoid <CrimsonVoid@users.noreply.github.com>
Signed-off-by: CrimsonVoid <CrimsonVoid@users.noreply.github.com>
@softwarefactory-project-zuul
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, @CrimsonVoid , and my apologies for the delay!

For a while, I was absolutely sure that someone else had requested or submitted something like this in the past, but I failed to find an issue or a pull request. So let's chalk it up to my failing memory. :)

Could you please correct your Git authorship information with your full name and a real email address, unless you are worried about privacy? We need a real full name and email address for tracking copyright holders in case a licensing issue crops up.

The Signed-off-by trailer has no meaning without a real full name and email address. For what it's worth, projects as diverse as GCC, GnuPG, Linux, Moby and Podman don't allow anonymous or pseudonymous contributions.

@debarshiray
Copy link
Copy Markdown
Member

The idea was to make toolbox run a little more discoverable when running just toolbox; for a while I was under the assumption that toolbox only supported create, enter, and list (knowing about run earlier would have solved the major reason I reached for distrobox)

I am curious what you use the run command for. :)

Comment thread src/cmd/utils.go
var builder strings.Builder
builder.WriteString("create Create a new Toolbx container\n")
builder.WriteString("enter Enter an existing Toolbx container\n")
builder.WriteString("run Run a command in an existing Toolbx container\n")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am a little hesitant to include too many things in commonCommands at the risk of users glazing over the output (like myself). A short list of three commands covering most people's workflow might be a sweet spot and moving discoverability of toolbox run et al. somewhere else might be more prudent; perhaps just mentioning a full list of commands can be found elsewhere would be enough.

It turns out that when we rewrote Toolbx from POSIX shell to Go, we introduced a subtle regression in this area by losing a hint that there are other commands than just these three. :)

The output from the POSIX shell implementation used to be:

$ toolbox
toolbox: missing command

These are some common commands:
create    Create a new toolbox container
enter     Enter an existing toolbox container
list      List all existing toolbox containers and images

Try 'toolbox --help' for more information.

The output from the Go implementation is:

$ toolbox 
Error: missing command

create    Create a new Toolbx container
enter     Enter an existing Toolbx container
list      List all existing Toolbx containers and images

Run 'toolbox --help' for usage.

Notice how the "These are some common commands:" line disappeared. As far as I can make out, it happened in commit aaf81a56ea607da0.

Then in commit 40fc1689a3d90f7, we made the help command and --help option work without man(1), and as part of that re-introduced something similar. See the "Common commands are:" line below, assuming man(1) is absent:

$ toolbox help
toolbox - Tool for interactive command line environments on Linux

Common commands are:
create    Create a new toolbox container
enter     Enter an existing toolbox container
list      List all existing toolbox containers and images

Go to https://containertoolbx.org/ for further information.

Looking around at some common command line tools, I see that Git has something similar:

$ git

...

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

...

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.

I am leaning towards restoring the hint that we lost as a way to imply to readers that there's more than these three. I don't know if it should be the "These are some common commands" string that we used to have or the "Common commands are" string that we use now. I will leave that to you to decide.

What do you think?

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.

2 participants