Fix index scripts#2203
Merged
Hayden-IO merged 4 commits intosigstore:mainfrom Aug 8, 2024
Merged
Conversation
Some index keys, especially workload identifiers, have uppercase characters. MySQL is case insensitive, but Redis is not. The index storage backends account for this by converting lookup keys to lowercase for Redis queries, but the cleanup script did not account for this and was leaving some entries present in MySQL undeleted in Redis because they appeared to be different strings. This change ensures that these keys will be deleted from Redis when they are fully migrated to MySQL, even if the case is different. Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Remove the copy-pasted make_entries function which is already provided by the index-test-utils.sh source script. Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2203 +/- ##
===========================================
- Coverage 66.46% 43.02% -23.44%
===========================================
Files 92 189 +97
Lines 9258 19462 +10204
===========================================
+ Hits 6153 8374 +2221
- Misses 2359 10332 +7973
- Partials 746 756 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
13badc4 to
ca3c7cb
Compare
Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
ca3c7cb to
aa86173
Compare
Hayden-IO
previously approved these changes
Aug 8, 2024
Contributor
Hayden-IO
left a comment
There was a problem hiding this comment.
Looks great! Just one suggested test case to add
| set -e | ||
| for v in 0.0.1 0.0.2 ; do | ||
| rekor-cli --rekor_server $REKOR_ADDRESS upload \ | ||
| --type intoto:${v} \ |
Contributor
There was a problem hiding this comment.
Can we also add a test for the dsse type?
Add a new script alongside the backfill script to copy indices directly from Redis to MySQL. This is created as a separate script from the backfill script because they are necessary for different purposes: backfill is appropriate for when there is no data in any search index backend and the only source of data is the Rekor API, where copy is apprpriate when there is index data in the Redis database to pull directly from. This enables the script to copy data that the backfill script would not be able to recreate because the data needed to generate the indexes is not always persisted to the Rekor API. Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
aa86173 to
b486afa
Compare
Hayden-IO
approved these changes
Aug 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the cleanup-index script for indexes with capitalized keys
(e.g., workload identities for GitHub repositories with capital letters in the name).
Add a new script alongside the backfill script to copy indices directly
from Redis to MySQL. This is created as a separate script from the
backfill script because they are necessary for different purposes:
backfill is appropriate for when there is no data in any search index
backend and the only source of data is the Rekor API, where copy is
apprpriate when there is index data in the Redis database to pull
directly from. This enables the script to copy data that the backfill
script would not be able to recreate because the data needed to generate
the indexes is not always persisted to the Rekor API.
Summary
Release Note
Documentation