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

Fix cloud command not listed in k6 command's help text #3901

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Aug 19, 2024

When implementing the new cloud command structure, we marked the
k6 cloud command as deprecated by setting the cobra.Cmd, Deprecated,
option.

By doing so, Cobra took over itself to hide the command all in all from
the help text's output, and users couldn't see the cloud command as
part of the "Available Commands".

This PR removes the Cobra.Cmd Deprecated option usage, and ports
the message to the Long version of the help text.

This PR also rephrases the message to be more accurate. Considering
the cloud command itself is not deprecated, but rather its existing
behavior, we have mentioned the original behavior consisting in taking
a test resource as input is deprecated, specifically.## What?

Why?

We discovered that while shipping the new cloud command structure, we had missed the cloud command disappearing from the k6 help text.

CleanShot 2024-08-19 at 16 20 54

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

When implementing the new cloud command structure, we marked the
k6 cloud command as deprecated by setting the cobra.Cmd Deprecated
option.

By doing so, Cobra took over itself to hide the command all in all from
the help text's output, and users couldn't see the cloud command as
part of the "Available Commands".

This commit removes the Cobra.Cmd Deprecated option usage, and ports
the message to the Long version of the help text.

This commit also rephrases the message to be more accurate. Considering
the cloud command itself is not deprecated, but rather its existing
behavior, we have mentioned the original behavior consisting in taking
a test resource as input is deprecated, specifically.
This commit adds a test asserting the root command help text lists the
expected commands as available.
@oleiade oleiade added the bug label Aug 19, 2024
@oleiade oleiade self-assigned this Aug 19, 2024
@oleiade oleiade requested a review from a team as a code owner August 19, 2024 14:24
@oleiade oleiade requested review from mstoykov and olegbespalov and removed request for a team August 19, 2024 14:24
@joanlopez joanlopez added this to the v0.54.0 milestone Aug 21, 2024
@oleiade oleiade merged commit 632c0c8 into master Aug 21, 2024
22 checks passed
@oleiade oleiade deleted the fix_cloud_command_help branch August 21, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants