dvc icon indicating copy to clipboard operation
dvc copied to clipboard

stage: Rename some commands as stage subcommands.

Open iesahin opened this issue 4 years ago • 11 comments

I'm sure this idea has mentioned in several different places but I couldn't find an issue that collects all stage related commands under dvc stage

The following commands may be renamed:

  • Ë‹dvc freezeË‹ to dvc stage freeze
  • dvc unfreeze to dvc stage unfreeze
  • dvc remove can be split into dvc stage remove and dvc data remove
  • dvc dag to dvc stage dag or dvc stage graph
  • dvc repro to dvc stage repro or dvc stage run

The current ones can be deprecated for the next major release (3.0), and removed in the following major release (4.0).

Might be related to #7093

iesahin avatar Dec 13 '21 14:12 iesahin

To be honest, I haven't been a fan of subcommands, as it takes too much effort to type. Reading through https://clig.dev/#subcommands, it does seem to encourage subcommands for complex software (which is not very clear here):

If you’ve got a tool that’s sufficiently complex, you can reduce its complexity by making a set of subcommands. If you have several tools that are very closely related, you can make them easier to use and discover by combining them into a single command (for example, RCS vs. Git).

They’re useful for sharing stuff—global flags, help text, configuration, storage mechanisms.

skshetry avatar Dec 13 '21 15:12 skshetry

I think it makes sense to split commands that can be currently used for different things (dvc remove can be split into dvc stage remove and dvc data remove).

For others where there is a single purpose (i.e. dvc freeze / dvc unfreeze) I have no strong opinion about moving to subcommand or not.

dvc dag to dvc stage dag or dvc stage graph

This one doesn't make much sense to me.

daavoo avatar Dec 13 '21 15:12 daavoo

To be honest, I haven't been a fan of subcommands, as it takes too much effort to type. Reading through https://clig.dev/#subcommands, it does seem to encourage subcommands for complex software (which is not very clear here):

To reduce typing, there is an alias facility in every shell. One can define a dsa alias for dvc stage add.

These commands are infrequent commands. In these cases, remembering / looking up the command becomes more important than to type.

Actually I'm also not a big fan of subcommands but we have an irregular interface: We have stage add and stage list, two most frequently used stage commands as subcommands, but the other half of the stage related commands are not stage commands. If this irregularity could be solved the other way, by dropping stage from stage add and stage list, that's better but I think it's not possible at this point.

iesahin avatar Dec 14 '21 15:12 iesahin

dvc dag to dvc stage dag or dvc stage graph

This one doesn't make much sense to me.

dvc dag command is similar to dvc stage list, showing the DAG of stages. It could even be called dvc stage list --dag

iesahin avatar Dec 14 '21 15:12 iesahin

dvc dag command is similar to dvc stage list, showing the DAG of stages. It could even be called dvc stage list --dag

I understand now.

Could dvc stage list --dag be something likedvc stage show?

daavoo avatar Dec 14 '21 16:12 daavoo

Could dvc stage list --dag be something likedvc stage show?

Yes, it could be dvc stage show, but I think emphasizing "graph" or "dag" in the name is more clear.

iesahin avatar Dec 15 '21 13:12 iesahin

@dberenbaum

ping about this 🔔 😄

Regardless[^1] of 3.0 release - where does this stand? Is it under discussion / disagreement? this proposal sounds very correct to me. Avoiding subcommands doesn't make things better or easier if you have too many top level commands or if you can't find stage operations under dvc stage where it makes sense to look for them

[^1]: or not? depends on state of disagreement I guess

omesser avatar Jun 10 '23 23:06 omesser

While I like the idea and feel the same pain that the CLI feels disorganized, and the proposal makes sense from a logical perspective, I see it as primarily an internal pain. Other than the dvc repro vs dvc exp run discussion, I have yet to see users confused or pained by these top-level commands (please add them here if you come across them). This also goes against our efforts to try to avoid breaking changes for users -- many will have to change their scripts to use the reorganized commands. I also think this is not something we have capacity to decide this late for 3.0 -- it's likely to generate lots of different opinions.

Let's not tie it to 3.0, but why don't we start introducing aliases in the subcommands if this is the direction we want to go, and we can worry about dropping the top-level commands later?

dberenbaum avatar Jun 12 '23 21:06 dberenbaum

Thanks @dberenbaum

Let's not tie it to 3.0, but why don't we start introducing aliases in the subcommands if this is the direction we want to go, and we can worry about dropping the top-level commands later?

Yes, no specific need to tie to 3.0 or urgency, but I hope we won't actually wait for user to yell about such things. if we agree that some experiences are better, or some structure makes sense... we need to make it easier to learn, not just easier to retain your knowledge if you're already a user.

This also goes against our efforts to try to avoid breaking changes for users

soft deprecation + aliases 😄

omesser avatar Jun 13 '23 14:06 omesser

@omesser Maybe a first step should even to be do a very rough docs draft (not bothering with updating all old links etc.) to see how it simplifies things and whether it feels impactful enough to prioritize.

dberenbaum avatar Jun 15 '23 19:06 dberenbaum

Very minor suggestion would be to add a stages alias since a lot of these subcommands are not about a single stage.

dberenbaum avatar Jun 16 '23 11:06 dberenbaum