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 #2

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

Miserlou/Zappa#1727

Original PR

Miserlou/Zappa#2102

@MerreM
Copy link

MerreM commented Feb 8, 2021

Any chance you can open this on https://github.com/MerreM/Zappa?

@edudobay
Copy link
Author

edudobay commented May 1, 2021

Hi @MerreM, sorry it took me so long: https://github.com/MerreM/Zappa/pull/1

@edudobay edudobay force-pushed the unique-rule-names-for-multiple-cloudwatch-expressions branch from 1057dca to 51e6a46 Compare May 10, 2021 13:06
edudobay pushed a commit to edudobay/Zappa that referenced this pull request Sep 27, 2021
…e-0.4.2

Bump sqlparse from 0.4.1 to 0.4.2
@edudobay edudobay force-pushed the unique-rule-names-for-multiple-cloudwatch-expressions branch from 51e6a46 to 65775ea Compare September 27, 2021 21:23
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.
@edudobay edudobay force-pushed the unique-rule-names-for-multiple-cloudwatch-expressions branch from 65775ea to e8bfa29 Compare October 17, 2021 13:50
@edudobay
Copy link
Author

Hey, now that the project is un-deprecated, would it be possible for some to take a look at this?

Copy link

@MerreM MerreM left a 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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 73.365% when pulling e8bfa29 on edudobay:unique-rule-names-for-multiple-cloudwatch-expressions into 9fbec2b on zappa:master.

@edudobay
Copy link
Author

Closing as already solved by #1080

@edudobay edudobay closed this Nov 25, 2021
@edudobay edudobay deleted the unique-rule-names-for-multiple-cloudwatch-expressions branch November 25, 2021 14:42
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.

3 participants