-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve LockError
message
#2765
Improve LockError
message
#2765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better language suggestion:
dvc/lock.py
Outdated
@@ -15,6 +16,12 @@ | |||
|
|||
DEFAULT_TIMEOUT = 5 | |||
|
|||
ERROR_MESSAGE = ( | |||
"cannot perform the cmd since DVC is busy and locked. You can delete " | |||
".dvc/lock to fix it, but first please make sure there's no other dvc " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use upper case name (DVC vs dvc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. He uses "DVC" first, but the 2nd time I think he's referring to the dvc
process. Should wrap it in back ticks ` though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rephrase it. The but-clause makes it harder to read than needed. Also "busy and locked" is too abstract, what does it mean? And cmd -> command.
So, it's like:
Cannot perform the command since other dvc process is running for this repo. If you are sure this is not the case, you might remove .dvc/lock
to fix this ...
Then command line hints go. However, ps xaf | grep dvc
doesn't make sense for Windows, unless again they don't use bash or somehting there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π , I agreed wtih @Suor regarding rephrasing. Also, including command line hints to check running processes I think is way too much. Let's just remove this part completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One little change, and one thing to consider.
Also, do you, by any chance, have a way to trigger this message? Maybe some script that could be shown through ascinema?
EDIT: sorry, didn't notice the print screen
dvc/lock.py
Outdated
@@ -15,6 +16,12 @@ | |||
|
|||
DEFAULT_TIMEOUT = 5 | |||
|
|||
ERROR_MESSAGE = ( | |||
"cannot perform the cmd since DVC is busy and locked. You can delete " | |||
".dvc/lock to fix it, but first please make sure there's no other dvc " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rephrase it. The but-clause makes it harder to read than needed. Also "busy and locked" is too abstract, what does it mean? And cmd -> command.
So, it's like:
Cannot perform the command since other dvc process is running for this repo. If you are sure this is not the case, you might remove .dvc/lock
to fix this ...
Then command line hints go. However, ps xaf | grep dvc
doesn't make sense for Windows, unless again they don't use bash or somehting there.
@@ -48,9 +47,6 @@ def main(argv=None): | |||
|
|||
cmd = args.func(args) | |||
ret = cmd.run() | |||
except LockError: | |||
logger.exception("failed to lock before running a command") | |||
ret = 250 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is about an error message only then why do we change the return code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@efiop might be able to answer this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Suor What will be the command on cmd
on Windows? tasklist | findstr dvc
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LockError is based on DvcException and doesn't make it up here, as all CLI commands have try except DvcException
in them. So we can remove this bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@algomaster99 looks good to me!
I have though some concerns (probably it's better to address them to @jorgeorpinel, @efiop ) about back-ticks . I think it's not a common practice to use markdown markup in UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just update dvc -> DVC per #2765 (comment). Thanks
@jorgeorpinel Capitalized dvc (DVC) shouldn't be enclosed in back-ticks, right? |
No back ticks, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM π
β Have you followed the guidelines in the Contributing to DVC list?
π Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.
β Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addresses. Please review them carefully and fix those that actually improve code or fix bugs.
Thank you for the contribution - we'll try to review it as soon as possible. π
Fixes #2520
Changed error message