-
Notifications
You must be signed in to change notification settings - Fork 1
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
Check registry file hash before downloading #93
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.
This looks good to me. I'm glad that you've got unit tests in place, but I'm not fully confident all the logic is exercised (I could be wrong). As mentioned in the comment, it might be worth expanding the unit tests, or possibly just noting which code paths aren't covered in some comments for later implementation.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
- Coverage 23.26% 22.94% -0.32%
==========================================
Files 14 47 +33
Lines 662 5883 +5221
Branches 0 934 +934
==========================================
+ Hits 154 1350 +1196
- Misses 508 4533 +4025 ☔ View full report in Codecov by Sentry. |
…c-frameworks/lephare-dev into issue/54/registry-hash-file
…mprove readability
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.
Nice, I like the way you've documented the logic and the tests that cover it.
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.
This looks great, very clean code. Nice
else: | ||
print(f"Local registry file is not up to date: {local_registry_file}") | ||
return False | ||
return remote_hash_response.text.strip() == local_registry_hash |
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.
Nice
For #54; checks the hash of the local registry file against the hash of the remote registry file to avoid unnecessary re-downloading of the registry file.
Note - the docs are failing because I've renamed the remote
data-registry.txt
todata_registry.txt
to match our usage in lephare (default behavior is to save this file asdata_registry.txt
). Until we merge lephare-photoz/lephare-data#12, we won't be able to find this new file.