-
Notifications
You must be signed in to change notification settings - Fork 58
Fix instantiation in _to_rekor()
for optional inclusion promise
#1382
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
Fix instantiation in _to_rekor()
for optional inclusion promise
#1382
Conversation
… to TransparencyLogEntry.inclusion_promise ``` File "/usr/local/google/home/rpetgrave/src/ssp/sigstore-python/sigstore/models.py", line 262, in _to_rekor tlog_entry = rekor_v1.TransparencyLogEntry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/google/home/rpetgrave/src/ssp/.venv/lib/python3.12/site-packages/pydantic/_internal/_dataclasses.py", line 120, in __init__ s.__pydantic_validator__.validate_python(ArgsKwargs(args, kwargs), self_instance=s) pydantic_core._pydantic_core.ValidationError: 1 validation error for TransparencyLogEntry inclusion_promise Input should be a dictionary or an instance of InclusionPromise [type=dataclass_type, input_value=None, input_type=NoneType] ``` Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
…Promise] to TransparencyLogEntry.inclusion_promise" This reverts commit 46b0087. Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
…nPromise] to TransparencyLogEntry.inclusion_promise" This reverts commit 43dc468. Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
_to_rekor()
for optional inclusion proofs_to_rekor()
for optional inclusion promise
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.
Making Bundle work without an inclusion promise makes sense, however
- if we can, let's test the whole bundle round trip (since Bundle does a lot of the real parsing)
- I don't think this is a pydantic issue, just us not being prepared for no inclusion promise
I'm not 100% sure I'm actually "requesting changes", let me know if you disagree with the ideas
CHANGELOG.md
Outdated
* Avoid pydantic's instantiation issues with `TransparencyLogEntry` when `InclusionPromise` is not present. | ||
|
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.
I don't think this is really related to pydantic (although I appreciate the neater handling in _to_rekor()
). Isn't the issue that our code just won't work without an inclusion promise currently?
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.
removed mention of pydantic.
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
_to_rekor()
for optional inclusion promise_to_rekor()
for optional inclusion promise
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 seems correct. The test is a little lacking but is handled in #1381
/gcbrun |
Sigh, the merge rules here are really annoying...
I'll test that and update the branch anyway. |
/gcbrun |
oh, merging main does not invalidate the review -- I did not know that. So I can merge this even though I'm the last committer 🤷 |
Client support for Rekor V2: sigstore-python #289
Resolves #1383
Summary
pydantic and betterproto: avoid assigning a var of type Optional[InclusionPromise] to TransparencyLogEntry.inclusion_promise
Release Note
Avoid pydantic's instantiation issues with
TransparencyLogEntry
whenInclusionPromise
is not present.Documentation
None