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

add option to refresh individual archives #878

Merged
merged 4 commits into from
Feb 23, 2021

Conversation

rblenis
Copy link
Contributor

@rblenis rblenis commented Feb 21, 2021

allow individual archives to do a more complete refresh, pulling in/updating size and duration. (see discussion #828)

@codecov-io
Copy link

codecov-io commented Feb 21, 2021

Codecov Report

Merging #878 (ff2e76a) into master (563b0a0) will decrease coverage by 0.77%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #878      +/-   ##
==========================================
- Coverage   73.36%   72.58%   -0.78%     
==========================================
  Files          55       56       +1     
  Lines        3720     3775      +55     
==========================================
+ Hits         2729     2740      +11     
- Misses        991     1035      +44     
Impacted Files Coverage Δ
src/vorta/views/archive_tab.py 77.38% <16.66%> (-2.53%) ⬇️
src/vorta/borg/refresh_archive.py 21.62% <21.62%> (ø)

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 563b0a0...ff2e76a. Read the comment docs.

@rblenis rblenis marked this pull request as ready for review February 21, 2021 02:10
@m3nu
Copy link
Contributor

m3nu commented Feb 21, 2021

Minor comment on renaming the file and class. Rest looks great. Thanks for the useful addition!

@rblenis
Copy link
Contributor Author

rblenis commented Feb 21, 2021

Added parsing of repo stats that comes back with the archive results - this provides a solution to issue #338 as well, though doing a 'borg info' after prune and delete should also be added to fully address #338.

@rblenis
Copy link
Contributor Author

rblenis commented Feb 21, 2021

@m3nu, what are you suggesting I rename the file and class to?

@rblenis
Copy link
Contributor Author

rblenis commented Feb 21, 2021

not sure why checks timed-out. I reran the action in my fork and it completed, but can't figure out how to get it to re-run in the PR unless I push a dummy change.

Copy link
Contributor

@m3nu m3nu left a comment

Choose a reason for hiding this comment

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

not sure why checks timed-out. I reran the action in my fork and it completed, but can't figure out how to get it to re-run in the PR unless I push a dummy change.

Some macOS checks can hang after the tests were successful. I'm not sure about the reason, but addressed a few possible reasons in #877. Could be the combo of pytest + coverage when using threads.

from vorta.models import ArchiveModel


class BorgRefreshArchiveThread(BorgThread):
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a borg.info.py, which runs the same command, but on a whole repo.

So how about calling this one borg.info_archive.py to follow the convention of borg.list_repo/archive.py

archive = ArchiveModel.get_or_none(
snapshot_id=remote_archive['id'],
repo=repo_id)
archive.name = remote_archive['name'] # incase name changed
Copy link
Contributor

Choose a reason for hiding this comment

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

This fails, if we get none above. Probably not likely, since the command takes the archive name just seconds earlier.

@m3nu
Copy link
Contributor

m3nu commented Feb 22, 2021

@m3nu, what are you suggesting I rename the file and class to?

Usually we name our commands after the Borg subcommand used. In vorta.borg we already have:

  • list_archive.py: list files in an archive
  • list_repo.py: list archives in a repo
  • info: list info on a repo

So the consistent choice would be to rename info.py to info_repo.py and your new module to info_archive.py?

@m3nu
Copy link
Contributor

m3nu commented Feb 22, 2021

The renaming is mostly logistics. I really like this PR because it only changes what's necessary and is easy to understand. If you prefer, I can do the renaming before merging.

@m3nu
Copy link
Contributor

m3nu commented Feb 22, 2021

Is it OK if I finish the renaming and then just merge?

@rblenis
Copy link
Contributor Author

rblenis commented Feb 22, 2021

sure

@m3nu m3nu merged commit 3c0dd72 into borgbase:master Feb 23, 2021
@m3nu
Copy link
Contributor

m3nu commented Feb 23, 2021

Thanks for the contribution. Merged.

@rblenis rblenis deleted the refresh_archive branch February 23, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants