-
Notifications
You must be signed in to change notification settings - Fork 0
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: added new events for hivemind & discord adapter services! #56
Conversation
WalkthroughThe changes involve an update to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
tc_messageBroker/rabbit_mq/event/event.py (1)
16-16
: LGTM: New class attribute added correctlyThe addition of
DISCORD_HIVEMIND_ADAPTER
to theEvent
class is consistent with the existing code style and aligns with the PR objectives.Consider reordering the class attributes alphabetically for improved readability:
class Event: SERVER_API = ServerEvent DISCORD_ANALYZER = DiscordAnalyzerEvent DISCORD_BOT = DiscordBotEvent + DISCORD_HIVEMIND_ADAPTER = DiscordHivemindAdapterEvent HIVEMIND = HivemindEvent - DISCORD_HIVEMIND_ADAPTER = DiscordHivemindAdapterEvent TWITTER_ANALYZER = TwitterAnalyzerEvent TWITTER_BOT = TwitterBotEventtc_messageBroker/rabbit_mq/event/events_microservice.py (1)
55-65
: Summary of changes and potential impactThe changes introduce a new
DiscordHivemindAdapterEvent
class and modify the existingHivemindEvent
class. These changes appear to be part of a larger refactoring to support Discord-Hivemind integration. Here's a summary of the key points:
- The new
DiscordHivemindAdapterEvent
class adds support for question-related events in the Discord-Hivemind adapter.- The
HivemindEvent
class has been simplified to focus on question-related events, aligning with the new adapter class.- Typos in constant names have been identified in both classes and should be corrected.
- The removal of constants from
HivemindEvent
may impact existing code and should be verified.To ensure a smooth integration of these changes:
- Fix all identified typos.
- Verify that the removed constants from
HivemindEvent
don't break existing functionality.- Update any code that may have been relying on the removed constants.
- Consider adding docstrings to both classes to explain their purpose and usage.
These changes suggest a shift towards a more modular event structure for different services. To maintain this direction:
- Consider creating a base class for question-related events that both
DiscordHivemindAdapterEvent
andHivemindEvent
could inherit from.- Ensure consistent naming conventions across all event classes (e.g., using "RECEIVED" instead of "RECIVED").
- If more adapters are planned in the future, consider creating a naming convention or structure that makes it easy to add new adapter-specific event classes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- setup.py (1 hunks)
- tc_messageBroker/rabbit_mq/event/event.py (2 hunks)
- tc_messageBroker/rabbit_mq/event/events_microservice.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- setup.py
🧰 Additional context used
🔇 Additional comments (2)
tc_messageBroker/rabbit_mq/event/event.py (1)
4-4
: LGTM: New import added correctlyThe addition of
DiscordHivemindAdapterEvent
to the import statement is consistent with the existing code style and aligns with the PR objectives.tc_messageBroker/rabbit_mq/event/events_microservice.py (1)
65-65
:⚠️ Potential issueFix typo in constant name and verify impact of removed constants.
- There's a typo in the constant name:
QUESTION_RECIVED
should beQUESTION_RECEIVED
.- Two constants (
INTERACTION_CREATED
andGUILD_MESSAGES_UPDATED
) have been removed from this class. Please ensure that this doesn't break any existing code that might be using these constants.Here's the suggested fix for the typo:
class HivemindEvent: - QUESTION_RECIVED = "QUESTION_RECIVED" + QUESTION_RECEIVED = "QUESTION_RECEIVED"To verify the impact of the removed constants, run the following script:
If the script returns any results, those occurrences need to be updated or removed to reflect the changes in the
HivemindEvent
class.
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
tests/unit/test_event.py (1)
26-26
: Remove commented-out codeThe commented-out assertion at the end of the file appears to be unrelated to the current changes and may be leftover code. To maintain code cleanliness, it's generally best to remove unused commented-out code.
Consider removing this line:
- # assert Event.DISCORD_ANALYZER.SAVE == "SAVE"
If this assertion is needed for future use, it would be better to track it in a separate issue or TODO comment with context, rather than leaving it as commented-out code in the test file.
Summary by CodeRabbit
New Features
DiscordHivemindAdapterEvent
, enhancing event handling capabilities.QUESTION_COMMAND_RECIVED
andQUESTION_RESPONSE_RECIVED
.Improvements