feat!: new event bus config format - #272
Conversation
f752ddc to
d62ca05
Compare
robrap
left a comment
There was a problem hiding this comment.
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. |
navinkarkera
left a comment
There was a problem hiding this comment.
@rgraber The ADR looks good to me. 👍
robrap
left a comment
There was a problem hiding this comment.
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.
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.
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.
Isn't it better to fail early rather than allowing a back config detail? This error will stop the application from starting.
navinkarkera
left a comment
There was a problem hiding this comment.
@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.
| 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.
| 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.
Isn't it better to fail early rather than allowing a back config detail? This error will stop the application from starting.
| get_producer.cache_clear() | ||
|
|
||
|
|
||
| def merge_producer_configs(producer_config_original, producer_config_overrides): |
There was a problem hiding this comment.
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/openedx-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.