-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Bugfix/eventbridge/event bus desciption not asigned on create #12100
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
Bugfix/eventbridge/event bus desciption not asigned on create #12100
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 1h 8m 34s ⏱️ - 46m 58s Results for commit f74b6e1. ± Comparison against base commit 0191993. This pull request removes 1562 and adds 4 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
b0e6e74
to
2658814
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.
Neat fix! This is great, and good thinking with the parametrization of the test!
I have a comment about accessing the model attribute like that, as we can restore persisted state that might not have the field yet. Using getattr
can avoid weird errors popping up and not break existing users' setup.
Once this is addressed, I think we merge the PR. Nice fix! 🚀
edit: looking at the test failures, there might be rebasing issues with the snapshot
@@ -45,6 +46,7 @@ def create_event_bus_service( | |||
region, | |||
account_id, | |||
event_source_name, | |||
description, |
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.
as a note, I think it would be good to use keyword arguments here, it's much cleaner and readable (named parameters), as the order could be quite fragile
if description := event_bus_service.event_bus.description: | ||
response["Description"] = description |
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.
in the case of the data being restored from persisted state, I'm not sure it's fully possible but the description
field could be non-existent. Until the next minor release, it could be good to use getattr(event_bus_service.event_bus, "description", None)
to be on the safe side.
one example of a PR who removed such things: #11809 (and the PR implementing one: #11358, see this comment: https://github.com/localstack/localstack/pull/11358/files#r1717458334)
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.
fixed
if event_bus.description: | ||
event_bus_api_type["Description"] = event_bus.description |
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.
There's still the access here, sorry I didn't put a comment 😅
05b268d
to
f74b6e1
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! A small comment for the getattr
usage could be good, with a TODO, to know to revisit and remove once we switch for example major versions, but a quick search will do too! Thanks for addressing the comments!
I will track it as a todo in the servicepage. |
Motivation
Event Bridge Buses can have a description, this description is returned on create and on describe event buses.
This PR fixes the issue raised in this github bug report: #12065
Changes
Correctly store and handle the description of an event bridge bus on create.
Testing
Add test for creating and describing event bridge bus with description