Enable support for Hashes in States.Hash#260
Merged
Merged
Conversation
While the actual hash value is different from the stepfunctions simulator it is still internally consistent, so it's usable. This would only create problems if someone ran this States.Hash in floe and tried to compare it to the exact same run in AWS, which seems unlikely. Even so, I added a pending test so we can try to figure it out later.
a2c5141 to
4ca3ae6
Compare
Member
|
Checked commit Fryguy@4ca3ae6 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
kbrock
reviewed
Aug 9, 2024
| rule(:states_hash => {:args => subtree(:args)}) do | ||
| args = Transformer.process_args(args(), "States.Hash", [Object, String]) | ||
| data, algorithm = *args | ||
| raise NotImplementedError if data.kind_of?(Hash) |
kbrock
reviewed
Aug 9, 2024
Comment on lines
-192
to
-193
| data = data.to_json unless data.kind_of?(String) | ||
| OpenSSL::Digest.hexdigest(algorithm, data) |
Member
There was a problem hiding this comment.
Really don't like these ....json... if String kind of statements
kbrock
reviewed
Aug 9, 2024
Comment on lines
+504
to
+505
| result = described_class.value("States.Hash($.data, 'SHA-1')", {}, {"data" => {"foo" => "bar"}}) | ||
| expect(result).to eq("a5e744d0164540d33b1d7ea616c28f2fa97e754a") |
Member
There was a problem hiding this comment.
very cool you figured this one out
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.
While the actual hash value is different from the stepfunctions simulator it is still internally consistent, so it's usable. This would only create problems if someone ran this States.Hash in floe and tried to compare it to the exact same run in AWS, which seems unlikely. Even so, I added a pending test so we can try to figure it out later.
@kbrock or @agrare Please review. Follow up to #64