Skip to content
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

Add script to backfill Redis from Rekor #1163

Merged
merged 6 commits into from Nov 3, 2022

Conversation

haydentherapper
Copy link
Contributor

Signed-off-by: Hayden Blauzvern hblauzvern@google.com

Summary

Release Note

Documentation

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
@haydentherapper
Copy link
Contributor Author

I haven't tested this yet! Just wanted to get this out there for review

Copy link
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small nits.

cmd/backfill-redis/main.go Outdated Show resolved Hide resolved
cmd/backfill-redis/main.go Outdated Show resolved Hide resolved
Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
@haydentherapper haydentherapper changed the title DNM: Add script to backfill Redis from Rekor Add script to backfill Redis from Rekor Nov 2, 2022
@haydentherapper
Copy link
Contributor Author

To test:

docker-compose build; docker-compose up

# Insert some entries

docker run -it --network host --rm redis redis-cli
> KEYS *
# See key values
> lrange "<key>" 0 -1
FLUSHDB # Delete all keys

Example output, after inserting two entries:

$ go run cmd/backfill-redis/main.go --rekor-address http://localhost:3000 --address localhost --port 6379 --start 0 --end 1
Uploaded Redis entry 62e8aaf898e2779de217cfcb1152ee243a1428f38fb4866b77f36b781a2793332d5c4ecd9b3a9856, index 0, key 013dc006537df9c906667dbc1cb17601e6dc2720e5fd3f4782570db299957783
Uploaded Redis entry 62e8aaf898e2779de217cfcb1152ee243a1428f38fb4866b77f36b781a2793332d5c4ecd9b3a9856, index 0, key <service-account>
Uploaded Redis entry 62e8aaf898e2779de217cfcb1152ee243a1428f38fb4866b77f36b781a2793332d5c4ecd9b3a9856, index 0, key sha256:b678e836ee3ab5633a44361be6ead2fe856d3f7846915bb06c917f49fc82dbde
Completed log index 0
Uploaded Redis entry 62e8aaf898e2779dfd8c21db39ab530120100e05810cc4656d1964a9e95f768e193d1e31b624b6e0, index 1, key ea8e97a7a1f9236f2b4568d9d4e03e7c8e415e9f76db33b52fb8d07ca5458808
Uploaded Redis entry 62e8aaf898e2779dfd8c21db39ab530120100e05810cc4656d1964a9e95f768e193d1e31b624b6e0, index 1, key <service-account>
Uploaded Redis entry 62e8aaf898e2779dfd8c21db39ab530120100e05810cc4656d1964a9e95f768e193d1e31b624b6e0, index 1, key sha256:2460fddc38e527491fed7a9a127d9f4d75172a957ff1071668920f7ebb167629
Completed log index 1

@codecov-commenter
Copy link

codecov-commenter commented Nov 2, 2022

Codecov Report

Merging #1163 (034ee0b) into main (05d92d3) will increase coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1163      +/-   ##
==========================================
+ Coverage   64.20%   64.26%   +0.06%     
==========================================
  Files          82       82              
  Lines        7621     7621              
==========================================
+ Hits         4893     4898       +5     
+ Misses       2100     2096       -4     
+ Partials      628      627       -1     
Flag Coverage Δ
e2etests 48.85% <ø> (ø)
unittests 42.00% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/types/rekord/v0.0.1/entry.go 68.42% <0.00%> (+0.65%) ⬆️
pkg/types/alpine/v0.0.1/entry.go 73.57% <0.00%> (+1.21%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

bobcallaway
bobcallaway previously approved these changes Nov 2, 2022
Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
@bobcallaway bobcallaway merged commit 849c302 into sigstore:main Nov 3, 2022
@github-actions github-actions bot added this to the v1.1.0 milestone Nov 3, 2022
haydentherapper added a commit to haydentherapper/rekor that referenced this pull request Nov 10, 2022
* Add script to backfill Redis from Rekor

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Address comments

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Fix bugs in script

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Clean up, change flag name

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Add value removal before upload, print all errors

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Remove intoto 0.0.2 from backfill

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
priyawadhwa pushed a commit that referenced this pull request Nov 10, 2022
* Add script to backfill Redis from Rekor (#1163)

* Add script to backfill Redis from Rekor

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Address comments

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Fix bugs in script

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Clean up, change flag name

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Add value removal before upload, print all errors

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* Remove intoto 0.0.2 from backfill

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>

* add backfill-redis to the release

Signed-off-by: cpanato <ctadeu@gmail.com>

* add version information for backfill-redis

Signed-off-by: cpanato <ctadeu@gmail.com>

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
Signed-off-by: cpanato <ctadeu@gmail.com>
Co-authored-by: cpanato <ctadeu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants