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

ui: fix missing progress & tidy #3335

Merged
merged 3 commits into from Feb 19, 2020
Merged

Conversation

casperdcl
Copy link
Contributor

@casperdcl casperdcl commented Feb 14, 2020

make no_progress_bar=False rather than True

  • remote.gdrive.RemoteGDrive.gdrive_upload_file()
  • remote.base.RemoteBASE._get_dir_info_checksum():self.cache.upload()
  • remote.gs.RemoteGDrive.RemoteGS._upload() and _download()

@casperdcl casperdcl self-assigned this Feb 14, 2020
@casperdcl casperdcl added enhancement Enhances DVC refactoring Factoring and re-factoring research ui user interface / interaction discussion requires active participation to reach a conclusion labels Feb 14, 2020
Comment on lines 259 to 237
self.cache.upload(from_info, to_info, no_progress_bar=True)
self.cache.upload(from_info, to_info, no_progress_bar=False)
Copy link
Contributor Author

@casperdcl casperdcl Feb 14, 2020

Choose a reason for hiding this comment

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

@efiop wanted to ask if this change is OK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to add to this - if this change is OK then there's a lot of nice tidying/refactoring possible since upload() would never require a no_progress_bar argument

Copy link
Member

@efiop efiop Feb 15, 2020

Choose a reason for hiding this comment

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

@casperdcl Btw, how does the pbar look for this operation? I'm worried about it having some random looking paths in it.

Copy link
Contributor Author

@casperdcl casperdcl Feb 16, 2020

Choose a reason for hiding this comment

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

this would occur on dvc add <dir>. It gets short cache names but is cleared away upon completion. Padding it with some persistent logging messages (and padding fs.copyfile with some logging & sleep(5)) gives this:

asciicast

Copy link
Member

Choose a reason for hiding this comment

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

@casperdcl Yeah, not sure about that. That random name is not very helpful. How about we put some desc instead? There is a name param for that upload method, so should be pretty simple. Though, not sure how to describe this in a user-friendly way. Btw, did this particular part of code cause any issues in your research? It works with tiny files and usually uploading them is very quick.

As to the name here, maybe something like "Computing effective hash for directory '{}'" would be good enough.

Copy link
Member

Choose a reason for hiding this comment

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

@casperdcl Got it. So the plan is to only refactor the defaults in those remotes, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we allow no_progress_bar=False then we can refactor away. But perhaps for now we should keep no_progress_bar=True and not refactor.

Copy link
Member

Choose a reason for hiding this comment

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

@casperdcl Sorry, looks like I'm not following. So gdrive/gs had no_progress_bar=True, which contradicts the other remotes. So we will fix those, right? Or are we going to do something else as well? 🙂 Just trying to understand the plan for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was (and have always been) only talking about this specific cache.upload() line. The PR is now fine to merge.

gdrive/gs things elsewhere in this PR are no-brainers I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to clarify further - if we change the cache.upload() line to say no_progress_bar=False, then it would mean every single instance of upload() in the code base would only ever have no_progress_bar=False and thus we can drop that argument from all upload() functions.

@casperdcl casperdcl changed the title Missing progress [draft] ui: fix missing progress & tidy Feb 14, 2020
@codecov
Copy link

codecov bot commented Feb 14, 2020

Codecov Report

Merging #3335 into master will increase coverage by 0.49%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3335      +/-   ##
==========================================
+ Coverage    92.4%   92.89%   +0.49%     
==========================================
  Files         140      141       +1     
  Lines        8474     8647     +173     
==========================================
+ Hits         7830     8033     +203     
+ Misses        644      614      -30
Impacted Files Coverage Δ
dvc/repo/add.py 100% <ø> (ø) ⬆️
dvc/remote/gdrive.py 87.6% <ø> (+0.15%) ⬆️
dvc/remote/gs.py 97.34% <100%> (+0.02%) ⬆️
dvc/remote/base.py 95.11% <100%> (-0.07%) ⬇️
dvc/progress.py 98.14% <100%> (ø) ⬆️
dvc/version.py 83.33% <0%> (-2.78%) ⬇️
dvc/dependency/repo.py 98.18% <0%> (-1.82%) ⬇️
dvc/scm/git/__init__.py 86.22% <0%> (-1.34%) ⬇️
dvc/logger.py 87.67% <0%> (-0.65%) ⬇️
dvc/repo/__init__.py 97.13% <0%> (-0.32%) ⬇️
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4087b02...780f33d. Read the comment docs.

@casperdcl casperdcl changed the base branch from master to ignore-nuances February 14, 2020 23:26
@casperdcl casperdcl changed the base branch from ignore-nuances to master February 14, 2020 23:27
@casperdcl casperdcl marked this pull request as ready for review February 16, 2020 16:10
@casperdcl casperdcl changed the title [draft] ui: fix missing progress & tidy ui: fix missing progress & tidy Feb 16, 2020
@casperdcl casperdcl requested a review from efiop February 18, 2020 14:34
@efiop efiop merged commit 37de65f into iterative:master Feb 19, 2020
@casperdcl casperdcl deleted the missing-progress branch February 19, 2020 21:27
@casperdcl casperdcl restored the missing-progress branch February 21, 2020 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion requires active participation to reach a conclusion enhancement Enhances DVC refactoring Factoring and re-factoring research ui user interface / interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing progress
2 participants