[Shopify Sync] Reduce Redis key size by 76%#86
Closed
dkeegan-figma wants to merge 1 commit intomasterfrom
Closed
Conversation
Cherry-picked from Shopify commit b534f89 with conflict resolution. Changes: - Add KeyShortener module to reduce Redis key sizes by ~76% - Update all key() methods to use KeyShortener - Preserve Figma's test suite (no merge of Shopify's new tests) - Keep Figma's moving average imports
bdc584b to
722c84a
Compare
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.
Summary
Cherry-picks Shopify's Redis key size reduction optimization (commit
b534f89). This introduces theKeyShortenermodule that reduces Redis key sizes by approximately 76%, significantly improving network traffic and memory usage.Changes
New File
ruby/lib/ci/queue/redis/key_shortener.rb- New module for key compressionModified Files
ruby/lib/ci/queue/redis.rb- Added require for KeyShortenerruby/lib/ci/queue/redis/base.rb- Uses KeyShortener for all key generationruby/lib/ci/queue/redis/build_record.rb- Updated to use shortened keysruby/lib/ci/queue/redis/grind_record.rb- Updated to use shortened keysruby/test/ci/queue/redis_test.rb- Tests updated for new key formatruby/test/integration/minitest_redis_test.rb- One key reference updatedTotal: 7 files changed (60 insertions, 6 deletions)
How It Works
The KeyShortener reduces key size through three strategies:
binstead ofbuildExample
Benefits
Conflict Resolution
✅ Successfully integrated with Figma's custom features:
test_duration_moving_averagesandupdate_test_duration_moving_averagerequiresKeyShortener.key()where neededTesting
Original Shopify PR
b534f89Risk Assessment
Risk Level: Low
Fixed: Removed unresolved merge conflict markers and Shopify-only test methods that were accidentally included in initial version.
cc: @Dkeegan