Skip to content

Conversation

@rubenthoms
Copy link
Collaborator

@rubenthoms rubenthoms commented Oct 17, 2025

Adding:

  • CosmosDB emulator as docker container and inital setup
  • CosmosDatabase and CosmosContainer classes
  • Stores for sessions, snapshots, and snapshot access logs
  • Routers for persistence (sessions, snapshots, snapshot access logs)

Changing:

  • Docker compose config: adding CosmosDB emulator container and adding startup dependency to primary container

@rubenthoms rubenthoms self-assigned this Oct 17, 2025
@rubenthoms rubenthoms added enhancement New feature or request Easy collaboration E.g. sharing dashboards (2024 goal) 2025 EOY release labels Oct 17, 2025
@rubenthoms rubenthoms requested a review from sigurdp October 17, 2025 16:20
@rubenthoms rubenthoms marked this pull request as draft October 17, 2025 17:06
@rubenthoms rubenthoms changed the base branch from main to persistence/main October 20, 2025 09:00
@rubenthoms rubenthoms force-pushed the persistence/backend-database-access branch from 701a415 to bcb6c6c Compare October 20, 2025 09:05
@rubenthoms rubenthoms marked this pull request as ready for review October 20, 2025 10:26
Copy link
Collaborator

@Anders2303 Anders2303 left a comment

Choose a reason for hiding this comment

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

The endpoints needed for the management modal are there, but they appear to be outdated, so you might have been looking at the wrong branch

Correct branch here

@rubenthoms rubenthoms requested a review from Copilot October 27, 2025 16:01
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 implements the backend persistence layer for sessions, snapshots, and snapshot access logs using Azure Cosmos DB. It establishes database infrastructure, data stores with CRUD operations, and REST API endpoints supporting pagination, sorting, and filtering. The implementation includes CosmosDB emulator configuration for local development and proper error handling throughout the persistence layer.

Key changes:

  • Added Cosmos DB emulator as a Docker container with health checks and automatic database setup
  • Implemented data stores for sessions, snapshots, and snapshot access logs with comprehensive query capabilities
  • Created REST API routers exposing persistence operations with proper authentication and background task support

Reviewed Changes

Copilot reviewed 29 out of 35 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docker-compose.yml Added CosmosDB emulator service with health checks and startup dependencies
backend_py/primary/pyproject.toml Added azure-cosmos, aiohttp, and nanoid dependencies
backend_py/primary/primary/config.py Added Cosmos DB connection configuration
backend_py/primary/primary/main.py Integrated persistence router and database setup
backend_py/primary/primary/services/service_exceptions.py Added DATABASE service type
backend_py/primary/primary/persistence/setup_local_database.py Implemented local database initialization
backend_py/primary/primary/persistence/cosmosdb/*.py Core database abstraction layer
backend_py/primary/primary/persistence/_store/.py Store implementations for sessions, snapshots, and access logs
backend_py/primary/primary/routers/persistence/*.py REST API endpoints for persistence operations
frontend/src/api/autogen/*.ts Auto-generated API client code
frontend/src/modules/ModuleSerializedStateMap.ts File deleted (auto-generated)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot reviewed 29 out of 35 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@sigurdp sigurdp left a comment

Choose a reason for hiding this comment

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

More or less good to go.
Approved with a few questions/suggestions

Copy link
Collaborator

@Anders2303 Anders2303 left a comment

Choose a reason for hiding this comment

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

Looks good! Noted one very tiny thing, but I'll approve regardles

@rubenthoms rubenthoms merged commit 6492cb9 into equinor:persistence/main Oct 28, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2025 EOY release Easy collaboration E.g. sharing dashboards (2024 goal) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants