-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Added EVENT_RULE_ENGINE flag based opt-in #11816
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
Conversation
f88fe69
to
3bd6b1b
Compare
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.
Nice centralization and addition of unit tests (which we probably under-utilize) 👍
Feel free to add the change type label and self-assign the PR.
Can we trigger the CI run here by authenticating with CircleCI?
73184cd
to
56739d5
Compare
|
a665b98
to
209be7b
Compare
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.
Could you please rebase to resolve the conflicts with master? Thank you 🙏
@@ -1440,7 +1440,7 @@ def _process_rules( | |||
LOG.info( | |||
json.dumps( | |||
{ | |||
"InfoCode": "InternalInfoEvents at matches_rule", | |||
"InfoCode": "InternalInfoEvents at matches_event", |
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.
To avoid regressions in the EventStudio project, I think we should avoid this change.
Ultimately, there should be comments for every instrumentation and/or a list of instrumented places because it's currently impossible to keep track of them.
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.
it got updated because of find and replace. but yeah it is annoying
209be7b
to
87c59b8
Compare
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.
LGTM after moving the restored utils file and fixing the test skip conditional 👏
Let's wait for a full 🟢 test run of localstack-ext (see link in Notion ticket), then we're good to merge 🚀
@@ -362,6 +363,10 @@ def test_delete_archive_error_unknown_archive(self, aws_client, snapshot): | |||
class TestReplay: | |||
@markers.aws.validated | |||
@pytest.mark.skipif(is_old_provider(), reason="not supported by the old provider") | |||
@pytest.mark.skipif( | |||
condition=is_v2_provider(), |
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.
This condition should be on the EVENT_RULER
config because now the test gets always skipped
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.
ideally, this should be:
@pytest.mark.skipif(
condition=config.EVENT_RULE_ENGINE == "python",
reason="Not supported with Python-based rule engine",
)
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.
(the reason currently contradicts the condition ;)
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.
Can we move utils.py
to the event_source_mapping
directory? I think it's cleaner than re-introducing the legacy directory
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.
LGTM 🚀
Ideally, fixing the test skip could clarify the motivation why we had to do so. At least, doing so in a follow up would be nice :)
@@ -362,6 +363,10 @@ def test_delete_archive_error_unknown_archive(self, aws_client, snapshot): | |||
class TestReplay: | |||
@markers.aws.validated | |||
@pytest.mark.skipif(is_old_provider(), reason="not supported by the old provider") | |||
@pytest.mark.skipif( | |||
condition=is_v2_provider(), |
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.
ideally, this should be:
@pytest.mark.skipif(
condition=config.EVENT_RULE_ENGINE == "python",
reason="Not supported with Python-based rule engine",
)
|
||
def test_matches_event_with_java_engine_strings(event_rule_engine): | ||
"""Test Java engine with string inputs (EventBridge case)""" | ||
event_rule_engine("java") |
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.
@dominikschubert @dfangl Should we avoid any JPype-starting monkey-patched tests in the LS CI?
I'm somewhat worried this will blow up once we combine it with other usage (e.g., SFN tests)?
This shouldn't block the merge here. I'm happy to tackle this in a follow-up because we have several other usages.
@@ -362,6 +363,10 @@ def test_delete_archive_error_unknown_archive(self, aws_client, snapshot): | |||
class TestReplay: | |||
@markers.aws.validated | |||
@pytest.mark.skipif(is_old_provider(), reason="not supported by the old provider") | |||
@pytest.mark.skipif( | |||
condition=is_v2_provider(), |
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.
(the reason currently contradicts the condition ;)
87c59b8
to
fd34e22
Compare
Motivation
This PR adds support for a Python-based event rule engine as an alternative to the Java implementation.
This addresses installation issues some users face with the Java event ruler (GH-11299), particularly
in environments with proxy setups or SSL certificate issues.
Changes
event_matcher.py
to centralize event matching logicTesting