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

Remove unapproved verbs from module #318

Closed
KirkMunro opened this issue Sep 14, 2016 · 5 comments

Comments

Projects
None yet
5 participants
@KirkMunro
Copy link

commented Sep 14, 2016

Today you have the following commands that use unapproved verbs:

Failover-GcSqlInstance
Promote-GcSqlReplica

Use of unapproved verbs in exported module command names is strongly discouraged (to the point where many teams are simply told not to do it under any circumstances).

Instead of Failover-GcSqlInstance, consider:

Invoke-GcSqlInstanceFailover

Instead of Promote-GcSqlReplica, consider:

Convert-GcSqlReplicaToInstance

There are other possible verbs you can choose from of course and what I provided are just some that I feel work fine for what you need, but regardless of which you choose, the core command should have an approved verb. If you really, really feel the need for these names, define them as aliases for commands that use approved verbs. In the long run I don't feel it's worth it (it's a best practice to avoid using aliases in scripts), and aliases like these are usually only kept around to maintain backwards compatibility with names that had to change for some reason.

@ILMTitan

This comment has been minimized.

Copy link

commented Sep 14, 2016

Thank you. Those look like good alternative names.

@chrsmith

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2016

Notes on investigation so far:

Replacing Failover- with Invoke-GcSqlInstanceFailover sounds good. As for Promote-, since the conversion isn't bidirectional, we should use ConvertTo-GcSqlInstance (docs).

We'll need to make this change before exiting Beta, since at that point we won't be able to make breaking changes like this. However, even at this point we still need to go through and update documentation (e.g. on cloud.google.com) to mention the changes.

@sntxrr

This comment has been minimized.

Copy link

commented Oct 12, 2016

@chrsmith Convert-GcSqlInstance would be more in line with the naming convention (though admittedly, it may be non specific enough)

@KirkMunro

This comment has been minimized.

Copy link
Author

commented Oct 13, 2016

@rrxtns Actually if you just use the Convert verb, it sounds like you are converting a GcSqlInstance, as opposed to converting to a GcSqlInstance (which is what I believe is actually happening).

@chrsmith I like the ConvertTo-GcSqlInstance name for that command, and good catch on that being the guidance as per the docs.

@quoctruong

This comment has been minimized.

Copy link
Member

commented Oct 20, 2016

This is fixed with #359. We changed the cmdlets to ConvertTo-GcSqlInstance and Invoke-GcSqlInstanceFailover.

@quoctruong quoctruong closed this Oct 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.