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

Tech 15245 use sha1 digest #12

Merged
merged 3 commits into from
Oct 15, 2024
Merged

Tech 15245 use sha1 digest #12

merged 3 commits into from
Oct 15, 2024

Conversation

hislopzach
Copy link
Contributor

@hislopzach hislopzach commented Oct 14, 2024

Using SHA1 instead of SHA256 for script's hexdigest to match the expectations of the graphql-pro gem.

That gem is a private/pro gem doesn't have a visible repo of source code, but I'll copy relevant code here. When it is registering its redis scripts, it uses a SHA1 hexdigest.

module GraphQL
  module Pro
    class RedisScriptClient
      class << self
        def register(name, operation)
          operations[name] = {
            source: operation,
            sha: Digest::SHA1.hexdigest(operation),
          }
        end
#...

Our mock_redis_lua_extension2 gem had been using SHA256, which results in this error in tests

RuntimeError:         RuntimeError: Invariant: Calculated SHA doesn't match Redis SHA ("e755f0271a42601cdab85ad6826cbacb17cd0474", "2a7e9e472a262d83c5c177aaad198d502767644939cf2e2d590620cda9ab6358")

Using a matching SHA/hexdigest will eliminate this error from tests (see clean build here)

@hislopzach hislopzach merged commit 8cc1e73 into master Oct 15, 2024
4 checks passed
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.

2 participants