-
Notifications
You must be signed in to change notification settings - Fork 140
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
in_toto_verifylib: fix require/disallow queue #280
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.
Thanks for the fix, @SantiagoTorres! I referenced the PR in the list of artifact rule related PRs (in-toto/specification#4).
What do you think about defining the empty set only once above the if/else cascade? Similar to how we do it in our in-toto-golang (where the compiler forced us to do this right in the first place).
I was hesitant to do that just to avoid it to allocate a new |
Okay, fair enough. Not sure I understand your alternative proposition. We can't declare I think my preferred solution would be one of,
|
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.
Let's merge this soon. Let me know what you think of my suggestions (above). If none if it seems preferable we can merge as is.
Let's do what you suggested above despite the allocations. |
This reverts commit 21129a6 and replaces the consumed = artifacts_queue with consumed = set(), the reason as to why is that a require rule passing overwrites all the queue with a set() call... Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
"Disallow" and "require" rules don't consume artifacts in the queue, but still need to initialize a consume set. This commit summarizes the initialization in the "disallow" and "require" elif blocks (readability over performance). Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Update docstring to mention newly added require rule. Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
67c5b2d
to
5056a13
Compare
@SantiagoTorres, I took over your branch. And made the small modification we talked about. I hope that's okay? I also fixed the outdated docstring. Can you take a quick look at it and greenlight? |
LGTM. Thanks! |
Fixes issue #: None
Description of the changes being introduced by the pull request:
This reverts commit 21129a6 and
replaces the consumed = artifacts_queue with consumed = set(), the
reason as to why is that a require rule passing overwrites all the queue
with a set() call...
Please verify and check that the pull request fulfills the following
requirements: