Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@samcorky
Copy link
Contributor

@samcorky samcorky commented Oct 15, 2025

  • Introduced SpaceStateEventHistory DB model to log detailed event data (source, requested state, duration, etc.).
    • New mongo collection is space_state_event_history
  • Updated open_space and close_space functions 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.

- 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.
@samcorky samcorky requested a review from sjefferson99 October 15, 2025 20:54
@samcorky samcorky linked an issue Oct 15, 2025 that may be closed by this pull request
@sjefferson99 sjefferson99 requested a review from Copilot October 16, 2025 12:25
Copy link
Contributor

Copilot AI left a 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 SpaceStateEventHistory model logs event source, requested state, duration, and state transitions
  • SpaceStateSource enum differentiates between HTTP and Slack-triggered events
  • Both open_space and close_space functions now accept a source parameter 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.

Copy link
Member

@sjefferson99 sjefferson99 left a comment

Choose a reason for hiding this comment

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

Works as expected,

@samcorky samcorky merged commit b9c9fb8 into master Oct 19, 2025
@samcorky samcorky deleted the 410-space-state-history-table-enhancement branch October 19, 2025 19:16
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.

Space state history table enhancement

3 participants