-
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
Fix index scripts #2203
Fix index scripts #2203
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
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.
Looks great! Just one suggested test case to add
tests/copy-index-test.sh
Outdated
set -e | ||
for v in 0.0.1 0.0.2 ; do | ||
rekor-cli --rekor_server $REKOR_ADDRESS upload \ | ||
--type intoto:${v} \ |
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.
Can we also add a test for the dsse
type?
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.
done
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
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