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

feat: make signal parameter optional in preparation for removal #219

Merged
merged 5 commits into from
May 15, 2023

Conversation

rgraber
Copy link
Contributor

@rgraber rgraber commented May 12, 2023

Description:
Makes the signal parameter of the consume_events command optional in preparation for complete removal. The signal will now be determined from the message headers.

ISSUE:
#218

Dependencies:
If we're being nice, should probably not be merged before openedx/event-bus-redis#22, although the event bus redis is not production-ready yet anyway.
Reviewers:

  • tag reviewer
  • tag reviewer

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

Post merge:

  • Create a tag
  • Check new version is pushed to PyPI after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

Author concerns: List any concerns about this PR - inelegant
solutions, hacks, quick-and-dirty implementations, concerns about
migrations, etc.

@rgraber rgraber requested a review from a team as a code owner May 12, 2023 19:11
Copy link
Contributor

@robrap robrap left a comment

Choose a reason for hiding this comment

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

Thoughts around comments, but non-blocking.

def make_single_consumer(*, topic: str, group_id: str, signal: OpenEdxPublicSignal, **kwargs) -> EventBusConsumer:
def make_single_consumer(*, topic: str, group_id: str,
signal: OpenEdxPublicSignal = None, # pylint: disable=unused-argument
**kwargs) -> EventBusConsumer:
"""
Construct a consumer for a given topic, group, and signal.
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Do you want to drop signal from here now?
  2. Should we add a sentence stating that the signals will be determined by the message header, or do we not even need to mention signals in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Going to keep signal here for now since this is part of the public API. I don't know of anyone who uses it but I've broken things before by unexpectedly changing a public API method
  2. I think we should just not mention it

@@ -166,12 +168,11 @@ def make_single_consumer(*, topic: str, group_id: str, signal: OpenEdxPublicSign
Arguments:
topic: The event bus topic to consume from (without any environmental prefix)
group_id: The consumer group to participate in
signal: Send consumed, decoded events to the receivers of this signal
signal: DEPRECATED signals determined by message headers
Copy link
Contributor

Choose a reason for hiding this comment

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

If you add the notion of signals determined by message headers to a more permanent comment, then maybe the following would be more clear?

Suggested change
signal: DEPRECATED signals determined by message headers
signal: (DEPRECATED) this argument will be ignored.

required=True,
help='Type of signal to emit from consumed messages.'
required=False,
help='DEPRECATED signal will be determined by message headers'
Copy link
Contributor

Choose a reason for hiding this comment

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

See related comment and do what you think is best.

@rgraber rgraber merged commit 955c1f2 into main May 15, 2023
@rgraber rgraber deleted the rsgraber/20230512-optional-signal branch May 15, 2023 15:23
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.

2 participants