-
Notifications
You must be signed in to change notification settings - Fork 164
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
Change TreeID to be of type string
instead of int64
#712
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.
Great catch, @priyawadhwa , thank you!!
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.
one minor comment but LGTM
When printing the TreeID with rekor-cli loginfo, if the output is parsed through jq then the TreeID gets rounded down as an int because it is bigger than JSON allows Numbers to be. This is how jq works and is mentioned in the FAQ: https://github.com/stedolan/jq/wiki/FAQ#numbers Switching this to a string will preserve the actual Tree ID. Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
0d867c1
to
0ced324
Compare
@@ -43,7 +43,7 @@ type logInfoCmdOutput struct { | |||
TreeSize int64 | |||
RootHash string | |||
TimestampNanos uint64 | |||
TreeID int64 | |||
TreeID string |
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.
Maybe use json.Number
? https://pkg.go.dev/encoding/json#Number
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.
Weirdly I'm still seeing the same issue with this even though it should be a string...
When printing the TreeID with rekor-cli loginfo, if the output is parsed through jq
then the TreeID gets rounded down as an int because it is bigger than JSON allows Numbers to be.
This is how jq works and is mentioned in the FAQ: https://github.com/stedolan/jq/wiki/FAQ#numbers
Switching this to a string will preserve the actual Tree ID.
How this used to work:
Signed-off-by: Priya Wadhwa priya@chainguard.dev
cc @lkatalin
Summary
Ticket Link
Fixes
Release Note