feat: add user feedback and leaderboard messages#769
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for user feedback and game leaderboard functionality by introducing three new message types (FeedbackMessage, GameScoreMessage, GameLeaderboardMessage) and their corresponding endpoints. The feedback message is designed to bypass the normal messaging service infrastructure and uses a different message operation (SEND instead of SET_PUBLISH).
Changes:
- Added FeedbackMessage for collecting user feedback with rating validation (1-5)
- Added GameScoreMessage and GameLeaderboardMessage for tracking game scores and leaderboards
- Added three new public endpoints: user_feedback, game_score, and game_leaderboard
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| bec_lib/bec_lib/messages.py | Added three new BECMessage subclasses for feedback and game functionality |
| bec_lib/bec_lib/endpoints.py | Added three new public endpoints for feedback and game leaderboard features |
Comments suppressed due to low confidence (1)
bec_lib/bec_lib/messages.py:1930
- The order of parameters in the docstring Args section does not match the order of field definitions in the class. The docstring lists parameters starting with player_name, but the class defines game_name first. Reorder the docstring to match the field definition order: game_name, player_name, score, level, beamline_id, experiment_id, timestamp.
"""
Message for game scores
Args:
player_name (str): Name of the player (self-reported)
level (str | int | None): Game level, if applicable
score (float | int): Player's score
beamline_id (str | None): Beamline name. Filled in automatically on the server side
experiment_id (str | None): Experiment ID. Filled in automatically on the server side
timestamp (float): Timestamp of when the score was submitted. Filled in automatically
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
764802f to
c612710
Compare
d-perl
left a comment
There was a problem hiding this comment.
Haha, is the idea to hook up minesweeper to this leaderboard?
|
Exactly! 😂 |
Adding feedback and leaderboard message types.
The feedback message bypasses the normal messaging service infrastructure and is therefore typed differently.