Fix Array<Hash> support for steps#74
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb650d11b6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| when Transloadit::Step then steps.to_hash | ||
| else | ||
| if steps.uniq(&:name) != steps | ||
| if steps.uniq != steps |
There was a problem hiding this comment.
Restore duplicate-name validation for array steps
steps.uniq != steps only detects fully equal elements, so it misses the duplicate-name case this guard is meant to catch (e.g., two hashes keyed by :thumbs with different robot options, or two Step objects with the same name). In those cases no ArgumentError is raised and steps.inject({}) { |h, s| h.update s } silently overwrites the earlier step, changing assembly instructions compared to previous behavior.
Useful? React with 👍 / 👎.
|
Hi @kvz, I am not sure what you expect me to do by assigning this to me :) If this is about the codex comment, that is not correct. Thanks |
|
Hey @emrekutlu, sorry about the assign. I was experimenting with a tool to ensure all work has an owner. That model works internally, where everybody has the context and can reassign when it guesses wrong, but it should not extend to external contributors like yourself without a note or clarification. I'll adjust the script that did this. As for the PR itself: you're right about the steps: [
{ thumbs: { robot: "/video/thumbs", count: 4 } },
{ thumbs: { robot: "/image/resize", width: 320 } }
]Those are two different Ruby hashes, so Could we validate duplicates by mapping each array item to its step name/key first, then checking those names for duplicates? |
|
Hi @kvz, I see, that's one of cases I added to the tests but I had some issues running them locally so I was hoping to see them here, I will check again, thanks. |
|
Okay allowing a run 👌 |
|
I made some changes, hopefully it is in better shape now. |
Hello,
#50 this pull request breaks the support for
Array<Hash>support for steps which we came across while trying to upgrade from v2 -> v3.