-
Notifications
You must be signed in to change notification settings - Fork 365
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
Unique rule names for multiple CloudWatch expressions #2
Unique rule names for multiple CloudWatch expressions #2
Conversation
Any chance you can open this on https://github.com/MerreM/Zappa? |
Hi @MerreM, sorry it took me so long: https://github.com/MerreM/Zappa/pull/1 |
1057dca
to
51e6a46
Compare
…e-0.4.2 Bump sqlparse from 0.4.1 to 0.4.2
51e6a46
to
65775ea
Compare
A mixture of two cases that were handled individually uncovers an incorrect behavior: when a function has multiple event expressions AND the resulting rule name would be >= 64 characters long, all expressions get the same hash, so only the last expression is scheduled. In this commit, the index of the expression is used to build the hash, but only if the index is not zero — this is possibly not needed, but ensures current hashes are preserved.
65775ea
to
e8bfa29
Compare
Hey, now that the project is un-deprecated, would it be possible for some to take a look at this? |
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 okay to me.
Closing as already solved by #1080 |
Description
A mixture of two cases that were handled individually uncovers an incorrect behavior: when a function has multiple event expressions AND the resulting rule name would be >= 64 characters long, all expressions get the same hash, so only the last expression is scheduled.
In my fix, the index of the expression is used to build the hash, but only if the index is not zero. My rationale for this was preserving hashes for current rules. This seems unneeded (it doesn't seem like it would break anything without caring about this) but may prevent surprises. I'd like some feedback on whether this is an appropriate choice.
GitHub Issues
Miserlou/Zappa#1727
Original PR
Miserlou/Zappa#2102