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: correct example in documentation #935

Merged
merged 2 commits into from
Apr 20, 2023
Merged

fix: correct example in documentation #935

merged 2 commits into from
Apr 20, 2023

Conversation

btrd
Copy link
Contributor

@btrd btrd commented Apr 13, 2023

  • Add a changelog entry in the section "To Be Released" of CHANGELOG.md

⬆️ Do I need to update the changelog for a change this small?

Also I'm wondering if this command shouldn't use the --addon params like other command?

@btrd btrd requested a review from yohann-bacha April 13, 2023 12:39
Copy link
Member

@EtienneM EtienneM left a comment

Choose a reason for hiding this comment

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

arrow_up Do I need to update the changelog for a change this small?

i would say it's OK not to have a changelog for this

@@ -133,7 +133,7 @@ var (
ArgsUsage: "addon-id",
Description: CommandDescription{
Description: "Display information about an add-on attached to your app",
Examples: []string{"scalingo --app my-app addons-info mongodb"},
Examples: []string{"scalingo --app my-app addons-info addon_uuid"},
Copy link
Member

Choose a reason for hiding this comment

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

I would actually prefer if we could make the previous example work. We developed a fix for this use case for the logs command, we could do the same for the addons-info

Copy link
Contributor

Choose a reason for hiding this comment

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

In addition, we always give example names, like my-app instead of app-name.

This is already specified in the ArgsUsage that it is the addon-id that is expected.

If we want to change what we put for the addon id in the examples, we have to change it as well for every example in addon-ids.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We developed a fix for this use case for the logs command, we could do the same for the addons-info

logs is taking a --addon params, it's not the case here (it's what I'm proposing also).

I tried a to duplicate the logs behavior for the addons-info but didn't succesed, and I don't have the time currently to do it.

I would be in favor of accepting this PR, and wrote an issue to improve this command, in order to accept a params or a flag and a addon name or uuid.

Copy link
Member

Choose a reason for hiding this comment

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

OK I think you are right. I opened #937.

@yohann-bacha currently both addon_uuid and addon-uuid are in use, there is unfortunately no convention. Hence it looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yohann-bacha waiting for your review in order to merge this PR :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@EtienneM My point was not about using a _ or a -, this is more a problem of consistency.

Currently for every example in addons.go, we are giving real names for addons. As mongodb, and not addon-id, neither addon_uuid.

If we use now addon_uuid this is fine, but we shall do this everywhere at least in the addons.go file.

The following point is not blocking, but I think examples should be real world commands that you can copy paste and use them. What we need as args must be in the ArgsUsage (they are already there), the examples should not be another ArgsUsage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mongodb, and not addon-id, neither addon_uuid.

I think you miss-understood something, mongodb is not an id or uuid it's a addon name. Here the user need to use a value that looks like this 23w2e3rjwefsdjl;fgnlsdnfgnsdgn23 (yes I put my head on the keyboard), so I don't think we should give a "real" example.

Could you Add a suggestion to this PR if I didn't understood what's you're proposing?

Copy link
Contributor

Choose a reason for hiding this comment

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

You are absolutely right, then in that case, in examples where an addon-id is required, there should always be addon_uuid then. Line 107, 77...

And for the addon-add command, the argusage is wrong : it is not the addon-id we are waiting for, but the addon name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are absolutely right, then in that case, in examples where an addon-id is required, there should always be addon_uuid then. Line 107, 77...
And for the addon-add command, the argusage is wrong : it is not the addon-id we are waiting for, but the addon name

Indeed it seems there are other errors in this file :/

Copy link
Contributor Author

@btrd btrd Apr 19, 2023

Choose a reason for hiding this comment

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

@yohann-bacha Thanks for the update!

@EtienneM can you review the new commit?

@@ -133,7 +133,7 @@ var (
ArgsUsage: "addon-id",
Description: CommandDescription{
Description: "Display information about an add-on attached to your app",
Examples: []string{"scalingo --app my-app addons-info mongodb"},
Examples: []string{"scalingo --app my-app addons-info addon_uuid"},
Copy link
Contributor

Choose a reason for hiding this comment

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

In addition, we always give example names, like my-app instead of app-name.

This is already specified in the ArgsUsage that it is the addon-id that is expected.

If we want to change what we put for the addon id in the examples, we have to change it as well for every example in addon-ids.

@@ -133,7 +133,7 @@ var (
ArgsUsage: "addon-id",
Description: CommandDescription{
Description: "Display information about an add-on attached to your app",
Examples: []string{"scalingo --app my-app addons-info mongodb"},
Examples: []string{"scalingo --app my-app addons-info addon_uuid"},
Copy link
Member

Choose a reason for hiding this comment

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

OK I think you are right. I opened #937.

@yohann-bacha currently both addon_uuid and addon-uuid are in use, there is unfortunately no convention. Hence it looks good to me.

@btrd btrd dismissed yohann-bacha’s stale review April 20, 2023 11:18

He made the changes himself

@EtienneM EtienneM merged commit b36ff69 into master Apr 20, 2023
@EtienneM EtienneM deleted the fix_doc branch April 20, 2023 11:18
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.

3 participants