-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat!: new event bus config format #272
Conversation
f752ddc
to
d62ca05
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.
I did not do a full review (yet?), but just noting that the ADR looks good. Thanks.
@navinkarkera: [question] Can we get away with the backward incompatible change? That would be simplest, but I didn't know if we needed temporary code that transforms, or the use of a new name for the setting etc. for your transition? Or is that all for named releases and will it be simple to transition with instructions?
This all makes sense to me. Since the original PR never landed on edx-platform I don't think there's any reason for any special shims or error handling for the transition. |
@robrap The original PR(s) using this config have not been merged yet, the one in edx-platform as well as openedx/xblock-skill-tagging#14. So we can go ahead with the backward incompatible change and update the PR's based on the decision and changes here. |
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.
@rgraber The ADR looks good to me. 👍
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.
A left a bunch of mostly non-blocking suggestions. Also, any could be added as another iteration if we wish to improve and you want to land this more quickly.
raise ProducerConfigurationError( | ||
event_type=event_type, | ||
message="One of the configuration object is not a dictionary" | ||
message="One of the configuration objects is not a dictionary" |
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.
Imagine everything is working fine, and someone adds a new bad config detail. Do we want that to break all working publishing? Seems scary. Something to consider.
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.
Good point. I'm going to punt on this since it requires a little more thought than I want to put it while trying to land this but it will be a fast follow.
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.
[punt]
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.
Isn't it better to fail early rather than allowing a back config detail? This error will stop the application from starting.
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.
Thanks for the changes.
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.
I think it is close.
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.
Thank you.
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.
@rgraber This looks great. Feel free to ignore my suggestions if it doesn't make sense.
for topic in event_type_producer_configs.keys(): | ||
if event_type_producer_configs[topic]["enabled"] is True: |
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.
for topic in event_type_producer_configs.keys(): | |
if event_type_producer_configs[topic]["enabled"] is True: | |
for topic, config in event_type_producer_configs.items(): | |
if config["enabled"] is True: |
topic=configuration["topic"], | ||
event_key_field=configuration["event_key_field"], | ||
topic=topic, | ||
event_key_field=event_type_producer_configs[topic]["event_key_field"], |
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.
event_key_field=event_type_producer_configs[topic]["event_key_field"], | |
event_key_field=config["event_key_field"], |
raise ProducerConfigurationError( | ||
event_type=event_type, | ||
message="One of the configuration object is not a dictionary" | ||
message="One of the configuration objects is not a dictionary" |
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.
Isn't it better to fail early rather than allowing a back config detail? This error will stop the application from starting.
@@ -183,3 +184,28 @@ def make_single_consumer(*, topic: str, group_id: str, | |||
def _reset_state(sender, **kwargs): # pylint: disable=unused-argument | |||
"""Reset caches when settings change during unit tests.""" | |||
get_producer.cache_clear() | |||
|
|||
|
|||
def merge_producer_configs(producer_config_original, producer_config_overrides): |
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.
NIT: renaming these variables to original
and overrides
would make it easier to understand as producer_config
prefix should not be needed.
Description:
Change the event bus producing config from
to
ISSUE: #210
Dependencies: Would block openedx/edx-platform#33269
Reviewers:
Merge checklist:
Post merge:
finished.
Author concerns: List any concerns about this PR - inelegant
solutions, hacks, quick-and-dirty implementations, concerns about
migrations, etc.