-
-
Notifications
You must be signed in to change notification settings - Fork 10
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 if metadata files at revision match those downloaded by TUF updater #389
Conversation
…F updater + + TUF updater does not always check the validity of all metadata files + if timestamp is not updated, the updater will determine that a new version + of the snapshot file does not need to be downloaded and it will not be validated + during the update process, the metadata files that TUF updater downloads is stored + in a separate folder within the temp directory + For each commit, check if the metadata files inside that directory are the same + as the ones in the auth repository's metadata folder at that revision
taf/updater/updater_pipeline.py
Outdated
|
||
# TUF updater does not always check the validity of all metadata files | ||
# if timestamp is not updated, the updater will determine that a new version | ||
# of the snapshot file does not need to be downloaded and it will not be validated | ||
# during the update process, the metadata files that TUF updater downloads is stored | ||
# in a separate folder within the temp directory | ||
# For each commit, check if the metadata files inside that directory are the same | ||
# as the ones in the auth repository's metadata folder at that revision |
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 explanation looks like a good candidate to be a docstring. Could we move the code to a function?
taf/updater/updater_pipeline.py
Outdated
# in a separate folder within the temp directory | ||
# For each commit, check if the metadata files inside that directory are the same | ||
# as the ones in the auth repository's metadata folder at that revision | ||
pattern = r"\d+\.[^\.\s]+\.\w+" |
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.
Might want to add explanation as to what this pattern is searching for
taf/updater/updater_pipeline.py
Outdated
# this validation causes an issue with one of the first | ||
# commits of our production repositories and it should | ||
# not be enabled until we specify a later commit of those | ||
# repositories as the initial valid ones | ||
# this error happens when a metadata file is added, but | ||
# snapshot is not updated | ||
# raise UpdateFailedError( | ||
# f"Invalid metadata file {metadata_file_name}" | ||
# ) |
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.
Could we turn this into an issue?
taf/updater/updater_pipeline.py
Outdated
# For each commit, check if the metadata files inside that directory are the same | ||
# as the ones in the auth repository's metadata folder at that revision | ||
pattern = r"\d+\.[^\.\s]+\.\w+" | ||
for metadata_file_name in git_updater.get_current_metadata(): |
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.
Since we're reading all metadata files from disk for each commit, it's worth timing the updater to see how long this new validation takes, compared to the implementation we have on master.
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.
Ran SMC clone a couoek of times. The first was was slightly slower than on master, the second faster than on master, so I don't think that this impacts the performance. Other operations are much slower
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.
Awesome
Description (e.g. "Related to ...", etc.)
TUF updater does not always check the validity of all metadata files
if timestamp is not updated, the updater will determine that a new version
of the snapshot file does not need to be downloaded and it will not be validated
during the update process, the metadata files that TUF updater downloads is stored
in a separate folder within the temp directory
For each commit, check if the metadata files inside that directory are the same
as the ones in the auth repository's metadata folder at that revision
Closes #385
Code review checklist (for code reviewer to complete)