Skip to content

feat : Database integration

Bikkumalla Sai Krishna requested to merge csv_upgrade into dev

Merge Request Description

🎯 Objective

Implement persistent storage for the GitLab Compliance Checker using a relational SQL database. This introduces SQLAlchemy to integrate with Neon Postgres, fully replacing the transient status and file-based state management structure.

📝 Description of Changes

This MR introduces a robust, database-backed infrastructure to manage the project roster and application states. We have refactored the architecture to ensure cleaner boundaries between the Infrastructure, Service layers, and the UI, alongside robust updates to unit and integration testing.

🏗️ Architecture & Infrastructure

  • SQLAlchemy Engine: Added database.py for connection pooling, session management, and robust initialization.
  • ORM Models: Added models.py which defines the declarative base mappings (e.g., Roster data structure).
  • Dependencies: Updated pyproject.toml and regenerated uv.lock with SQLAlchemy bindings. Included a local temp_roster.db database stub for local testing flows.

️ Services & Business Logic

  • Roster Service Layer: Created services/roster_service.py to abstract all underlying database CRUD operations and decouple the application’s business logic from the view logic.

🖥️ User Interface Refactoring

  • New Admin Interface: Introduced admin.py to allow direct DB-backed roster management directly from the Streamlit UI.
  • Service Integration: Broadly updated app.py, main.py, batch.py, leaderboard.py, and weekly_performance.py so that UI widgets directly interact with the new RosterService, ensuring high consistency compared to reading from disconnected static sources.

🧪 Testing & Reliability

  • Comprehensive Test Suites Built: Scaled testing significantly with new specifications for the database service layer (test_roster_service.py), administration interface (test_admin_ui.py), and decoupled compliance logic components (test_compliance_service_logic.py, test_profile_service_extended.py).
  • Test Suite Refactoring: Cleaned up excessive duplicate mocks and streamlined the test environment in test_modes_team_leaderboard.py, test_modes_batch_analytics.py, and test_app.py to work correctly against mocked sessions and database state variables.

Checklist

  • Database configurations set for Neon integration
  • UI correctly retrieves values managed through RosterService
  • Core business-layer functionalities verify successfully
  • Automated tests for new components added and passing
Edited by Bikkumalla Sai Krishna

Merge request reports

Loading