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

Unique rule names for multiple CloudWatch expressions (#1727) #2102

Conversation

edudobay
Copy link

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

#1727

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.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 72.998% when pulling 1057dca on edudobay:unique-rule-names-for-multiple-cloudwatch-expressions into 93804a1 on Miserlou:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 72.998% when pulling 1057dca on edudobay:unique-rule-names-for-multiple-cloudwatch-expressions into 93804a1 on Miserlou:master.

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