Skip to content

Conversation

xocasdashdash
Copy link
Contributor

Motivation

To close #11622

Changes

Adds a new check on the validation of events sent to an event bus.

TODO

What's left to do:

  • I think i'm missing some bits about the tests, would love to land this PR

Copy link
Contributor

@localstack-bot localstack-bot left a comment

Choose a reason for hiding this comment

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

Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.

@localstack-bot
Copy link
Contributor

localstack-bot commented Oct 2, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@xocasdashdash
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@xocasdashdash
Copy link
Contributor Author

recheck

localstack-bot added a commit that referenced this pull request Oct 2, 2024
@maxhoheiser
Copy link
Member

maxhoheiser commented Oct 2, 2024

Hey @xocasdashdash great addition thanks.
Two remarks:

  • why would you put the test into archive and replay - it is a general feature - it would make more sense to put it into test_events
  • you need to install ruff and run make format to resolve formatting issues

About testing: we record snapshots when running the test against the AWS cloud and then compare the snapshot against the result from Localstacak - but I can create the initial snapshot for you once the other things are resolved :)

@xocasdashdash
Copy link
Contributor Author

👋

  • I've fixed the format issues
  • I think the test is in the right place now (test_events.py)

@maxhoheiser
Copy link
Member

@xocasdashdash - hey I fixed the test created the snapshot and fixed the validation - since AWS throws a validation error - this is not always so easy to guess how AWS deals with validation - this is why the snapshots help a lot.
Feel free to merge once the pipeline is green.

@xocasdashdash
Copy link
Contributor Author

@xocasdashdash - hey I fixed the test created the snapshot and fixed the validation - since AWS throws a validation error - this is not always so easy to guess how AWS deals with validation - this is why the snapshots help a lot. Feel free to merge once the pipeline is green.

Ahh fantastic, yeah i thought about this and had some local code working in the same way.

It seems that some specific labels need to be added. Could you add them?

@joe4dev joe4dev added the semver: patch Non-breaking changes which can be included in patch releases label Nov 5, 2024
@@ -199,6 +199,8 @@ def validate_event(event: PutEventsRequestEntry) -> None | PutEventsResultEntry:
"ErrorCode": "InvalidArgument",
"ErrorMessage": "Parameter Detail is not valid. Reason: Detail is a required argument.",
}
elif event.get("Detail") and len(event["Detail"]) >= 262144:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can assume that the detail exists here of it would have gone through line 197

Suggested change
elif event.get("Detail") and len(event["Detail"]) >= 262144:
elif len(event["Detail"]) >= 262144:

@xocasdashdash
Copy link
Contributor Author

@joe4dev Hi!

Sorry for the tag, i've just merged master into the branch and I believe this is ready to be merged. Can you take a look? not sure if there's any next steps i should be following

Copy link
Member

@maxhoheiser maxhoheiser left a comment

Choose a reason for hiding this comment

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

@xocasdashdash Great addition - all the tests are green now - feel free to merge :)

@xocasdashdash
Copy link
Contributor Author

@xocasdashdash Great addition - all the tests are green now - feel free to merge :)

hey! i'm not able to! but i'd love to see this change merged! :D

@maxhoheiser maxhoheiser merged commit 22fd338 into localstack:master Dec 4, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Eventbus accepts detail longer than AWS supports
4 participants