Uh oh!
There was an error while loading. Please reload this page.
Review and document ngclient exceptions - #1787
Conversation
We no longer need to catch LengthOrHashMismatchError and reraise a RepositoryError as LengthOrHashMismatchError is changed to inherit RepositoryError. Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
MVrachev
commented
Jan 20, 2022
@lukpueh can you investigate why still there are required CI builds for |
Pull Request Test Coverage Report for Build 1756223018Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
kairoaraujo
left a comment
There was a problem hiding this comment.
IMHO the raise message is more straightforward than the docstring for RuntimeError in the functions.
But I'm still unable to get better suggestions (Sorry), maybe more detailed information as the raising messages?
MVrachev
commented
Jan 21, 2022
Do you mean that the rest of the documentation regarding exceptions in |
kairoaraujo
commented
Jan 21, 2022
What I mean is that messages raises are more straightforward than the one in the docstrings. raiseRuntimeError("Cannot update timestamp after snapshot")
raiseRuntimeError("Cannot update snapshot before timestamp")
raiseRuntimeError("Cannot update snapshot after targets")
raiseRuntimeError("Cannot load targets before snapshot")
raiseRuntimeError("Cannot load targets before delegator")Maybe it is my interpretation, but reading the raised messages (not the code logic) gives me more details than the documentation. |
lukpueh
commented
Jan 21, 2022
Oh sure. I had to kick out the 3.6 checks in the branch protection rules. |
There was a problem hiding this comment.
I agree with the core choices here: figuring out if we really cover everything with the exceptions docstrings is really hard but I couldn't find anything where I disagreed with you.
lefty some very nitpicky comments (which are really up to you), and then the one about writing the file: raising OSError manually feels wrong... I'd rather we skip the securesystemslib function call altogether.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4ba8751 to
6403d13Compare6403d13 to
473a869CompareI made a review on all files inside tuf/ngclient to see which of them needs additions or changes in their function docstrings regarding exceptions. I didn't find any changes required inside the request_fetcher.py and of course inside the config module. Other than that multiple additions had to be made. For trusted_metadata_set we had a discussion with Jussi that there is no need to list each of the specific RepositoryErrors one by one as this is an internal module and this will only create a bigger maintenance burden. For updater.py we had discussions with Jussi and Lukas that we want to document only those exceptions that could be potentially handled. This means there is no point in documenting each of the RepositoryErrors or DownloadErrors separately. Finally, I added a little documentation for download_bytes() inside fetcher.py, as it's naming, suggests it's not an internal function. Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
473a869 to
9f7866dCompare
Fixes#1312
Description of the changes being introduced by the pull request:
I made a review on all files inside
tuf/ngclientto see which of themneeds additions or changes in their function docstrings regarding
exceptions.
I didn't find any changes required inside the
request_fetcher.pyand of course inside the config module.
Other than that multiple additions had to be made.
For
trusted_metadata_set.pywe had a discussion with Jussi that there isno need to list each of the specific
RepositoryErrors one by one asthis is an internal module and this will only create a bigger
maintenance burden.
For
updater.pywe had discussions with Jussi and Lukas that we want todocument only those exceptions that could be potentially handled.
This means there is no point in documenting each of the
RepositoryErrorsor
DownloadErrors separately.Finally, I added a little documentation for
download_bytes()insidefetcher.py, as it's naming, suggests it's not an internal function.Signed-off-by: Martin Vrachev mvrachev@vmware.com
Please verify and check that the pull request fulfills the following
requirements: