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

cmd ref: command options impros and consistency #1029

Merged
merged 7 commits into from
Mar 12, 2020

Conversation

jorgeorpinel
Copy link
Contributor

@jorgeorpinel jorgeorpinel commented Feb 28, 2020

Kind of continues #1027

@jorgeorpinel jorgeorpinel added type: enhancement Something is not clear, small updates, improvement suggestions A: docs Area: user documentation (gatsby-theme-iterative) labels Feb 28, 2020
@shcheklein shcheklein temporarily deployed to dvc-landing-cmd-ref-opt-simrmt February 28, 2020 06:18 Inactive
@jorgeorpinel jorgeorpinel marked this pull request as ready for review February 28, 2020 06:40
@jorgeorpinel jorgeorpinel temporarily deployed to dvc-landing-cmd-ref-opt-simrmt February 28, 2020 06:40 Inactive
Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

looks good! the only improvement can be made probably is to name these params to match some "user space terminology". Especially, --outs-no-cache OUTS_NO_CAHCE looks strange and not very meanigful ... it should be --outs-no-cache [path,] (list of locations), etc.

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Mar 3, 2020

name these params to match some "user space terminology". Especially, --outs-no-cache OUTS_NO_CAHCE looks strange and not very meanigful

Wile I agree with you @shcheklein, these are the argument value names from command help outputs:

$ dvc run -h
usage: dvc run [-h] [-q | -v] [-d DEPS] [-o OUTS] [-O OUTS_NO_CACHE]
               [-m METRICS] [-M METRICS_NO_CACHE] [-f FILE] [-c CWD] [-w WDIR]
               ...

Should I change all these both here and in a corresponding PR to the core repo?

@shcheklein

This comment has been minimized.

@jorgeorpinel

This comment has been minimized.

@shcheklein
Copy link
Member

Why would merge something that we want to change even in the core repo? It's better to just open the issue in the core repo first, decide on how (if we need any at all?) do we show the accepted values.

Alternatively, we can analyze the best practices (e.g. Git itself, Heroku CLI, etc) - how do they name, show accepted values and start driving the change from the docs side.

@jorgeorpinel
Copy link
Contributor Author

Why would merge something that we want to change even in the core repo?

Because merging it is an improvement from the current published version, that matches the DVC version in prod.

I checked the Git cmd ref and they do the same as this PR, except the value placeholders have nicer names (descriptive and not in ALL_CAPS) i.e. git checkout -b <new_branch>. The same full text used when explaining the option:
image

https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt-emgitcheckoutem-b-Bltnewbranchgtltstartpointgt

Heroku's case is quite different. They use the exact same value name as the option name, but assign with =. They don't have a nice cmd ref, it's just a dump of all of their help outputs (which are pretty good):
image

https://devcenter.heroku.com/articles/heroku-cli-commands

I think we should decide one Ill send it as a suggestion PR to core, so the engineering team can give feedback, I vote for Git's way e.g. dvc run ... [-o <outputs>] + keep the same naming in the Options section bullets, as this PR does now.

WDYT @shcheklein ?

@shcheklein
Copy link
Member

Because merging it is an improvement from the current published version, that matches the DVC version in prod.

so, this is my concern. Matching DVC != docs/readability improvement.

The idea itself to show values is very valuable, it's just really really painful to see things like:

-M METRICS_NO_CACHE, --metrics-no-cache METRICS_NO_CACHE

it's a lot of duplication, upper case makes it hard to read, etc

If want to do this, I would really come up with a better (Heroku or Git - both are fine to me) approach, implement it and show this to the core team.

@jorgeorpinel
Copy link
Contributor Author

OK I can fix it here and send a simultaneous PR to the core repo. I'm a bit concerned about conflicts with regular updates and this PR so it would be ideal to merge ASAP but let me fix this first... ⏳

The idea itself to show values is very valuable...
If want to do this

We agree we want to do this right?

@shcheklein
Copy link
Member

We agree we want to do this right?

yes. in this I would really come up with a better (Heroku or Git - both are fine to me) approach sense. Just having -M METRICS_NO_CACHE, --metrics-no-cache METRICS_NO_CACHE is not a good approach.

also, would not consider this p1.

@jorgeorpinel jorgeorpinel requested a review from shcheklein March 11, 2020 21:24
dependencies can be specified like this: `-d data.csv -d process.py`. Usually,
each dependency is a file or a directory with data, or a code file, or a
configuration file. DVC also supports certain
- `-d <path>`, `--deps <path>` - specify a file or a directory the stage depends
Copy link
Member

Choose a reason for hiding this comment

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

just to check - can it be a comma-separated list?

Copy link
Contributor Author

@jorgeorpinel jorgeorpinel Mar 12, 2020

Choose a reason for hiding this comment

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

Not for run --deps, but it can be in other options. I think the only one is gc -p. It would be shown in the Synopsis though, not here in the Options section.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, that's right ... it's more about options that could be specified once vs those that could be specified multiple time ... not sure if we need a special syntax to highlight that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good question. I didn't even think about that but it seems like a relevant thing to note somewhere. Opened #1041

Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

looks good to me!

check one comment/question I had

@shcheklein
Copy link
Member

I approved this already, so feel free to merge! It's a good improvement.

@jorgeorpinel jorgeorpinel changed the title cmd ref: more improvements and consistency for command options cmd ref: command options impros and consistency Mar 12, 2020
@jorgeorpinel jorgeorpinel merged commit d0abeeb into master Mar 12, 2020
@jorgeorpinel jorgeorpinel deleted the cmd-ref/option-defaults branch March 21, 2020 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: docs Area: user documentation (gatsby-theme-iterative) type: enhancement Something is not clear, small updates, improvement suggestions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants