-
Notifications
You must be signed in to change notification settings - Fork 1
feat(space): add event history logging for space state changes #411
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
Conversation
- Introduced `SpaceStateEventHistory` model to log detailed event data (source, requested state, duration, etc.). - Updated `open_space` and `close_space` to log events with new model. - Added `SpaceStateSource` enumeration to track event sources (HTTP, Slack). - Refactored HTTP and Slack listeners to pass event source to state change functions.
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.
Pull Request Overview
This PR adds comprehensive event history logging for space state changes by introducing a new database model to track detailed event metadata beyond the simple boolean state history.
Key changes:
- New
SpaceStateEventHistorymodel logs event source, requested state, duration, and state transitions SpaceStateSourceenum differentiates between HTTP and Slack-triggered events- Both
open_spaceandclose_spacefunctions now accept asourceparameter and log events to the new collection
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/plugins/space/spacestate/models.py | Adds SpaceStateSource enum and SpaceStateEventHistory document model for event logging |
| src/plugins/space/spacestate/listeners/slack.py | Updates Slack handlers to pass SpaceStateSource.SLACK to state change functions |
| src/plugins/space/spacestate/listeners/http.py | Updates HTTP endpoints to pass SpaceStateSource.HTTP to state change functions |
| src/plugins/space/spacestate/common.py | Implements event history logging function and updates open_space/close_space signatures to accept source parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
refactor: change open_space and close_space signatures from / to * for keyword-only source
sjefferson99
left a comment
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.
Works as expected,
SpaceStateEventHistoryDB model to log detailed event data (source, requested state, duration, etc.).space_state_event_historyopen_spaceandclose_spacefunctions to log events with new model.SpaceStateSourceenumeration to track event sources (HTTP, Slack).