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

Eventbridge Event Processor #704

Merged
merged 6 commits into from
Oct 19, 2023

Conversation

nichmorgan
Copy link
Contributor

@nichmorgan nichmorgan commented Oct 12, 2023

Issue #, if available:

Description of changes:
New event created to support Eventbridge.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

Copy link
Contributor

@BMorinDrifter BMorinDrifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor polish feedback, otherwise looks good to me.

lambda-events/Cargo.toml Outdated Show resolved Hide resolved

#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "kebab-case")]
pub struct EventBridgeEvent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be an alias for EventBridgeEventObj<Option<String>> to avoid code duplication?

Copy link
Contributor Author

@nichmorgan nichmorgan Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are having some problems creating this Alias due to the use of this setting in the "detail" field:

#[serde_as(as = "serde_with::json::JsonString")]
#[serde(bound(deserialize = "T: DeserializeOwned"))]
pub detail: T,

As the input of this field will always be a String, we expect it to be a JsonString as an EventBridgeEventObj, but if you create an alias EventBridgeEventObj<Option> and its contents are a simple String, not a JsonString, the test will fail.

We're still working on solutions to avoid duplication, but so far we've had no success. Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this duplication. We can change it later if we find a way.

@nichmorgan nichmorgan mentioned this pull request Oct 18, 2023
@calavera
Copy link
Contributor

Thanks a lot for opening this PR! I just merged some fixes for tests that were failing and were unrelated to your changes. Can you rebase from the main branch and resolve the conflicts?

Copy link
Contributor

@calavera calavera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thing. Can you add this new feature here? https://github.com/awslabs/aws-lambda-rust-runtime/blob/main/Makefile#L66

Those tests are used to ensure that features still work in isolation. We used to have problems where some features had dependencies that were only enabled when you ran with all features enabled.

@calavera calavera merged commit bcd3f97 into awslabs:main Oct 19, 2023
5 checks passed
@nichmorgan nichmorgan deleted the feature/eventbridge-support branch October 19, 2023 14:00
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.

5 participants