Skip to content

Conversation

@stefanorosanelli
Copy link
Contributor

@stefanorosanelli stefanorosanelli commented Jul 8, 2025

This PR makes all timestamp/datetime columns timezone-aware (UTC) across the codebase and adds a new db_revision CLI command with associated tests.

  • Convert existing model columns (created, modified, expires, locked_until, etc.) to use timezone=True and add descriptive comments
  • Generate an Alembic migration to alter column types and add a unique constraint on config_key; update Alembic environment to include all models
  • Introduce db_revision_cmd, register it in pyproject.toml, and add tests to verify its behavior

@stefanorosanelli stefanorosanelli requested a review from Copilot July 8, 2025 08: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 makes all timestamp/datetime columns timezone-aware (UTC) across the codebase and adds a new db_revision CLI command with associated tests.

  • Convert existing model columns (created, modified, expires, locked_until, etc.) to use timezone=True and add descriptive comments
  • Generate an Alembic migration to alter column types and add a unique constraint on config_key; update Alembic environment to include all models
  • Introduce db_revision_cmd, register it in pyproject.toml, and add tests to verify its behavior

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_commands.py Add tests for the new db_revision_cmd
pyproject.toml Register db_revision entry point
brevia/settings.py Use TIMESTAMP(timezone=True) and add UniqueConstraint in ConfigStore
brevia/commands.py Implement db_revision_cmd using Click
brevia/chat_history.py Change DateTime to timezone-aware and add comments
brevia/async_jobs.py Update timestamp handling to UTC and add comments
brevia/alembic/versions/eb659f4dd1c9_utc_timestamp.py Auto-generated migration for timezone changes and unique constraint
brevia/alembic/env.py Include all models in target_metadata for autogenerate
brevia/alembic/init.py Expose a revision() helper for creating revisions
Comments suppressed due to low confidence (1)

brevia/commands.py:54

  • [nitpick] For consistency with Click's output capture, use click.echo(f"New revision created: {message}") instead of print.
    print(f"New revision created: {message}")

@stefanorosanelli stefanorosanelli marked this pull request as ready for review July 8, 2025 09:14
@BuonDavide BuonDavide merged commit 5b89917 into brevia-ai:main Jul 8, 2025
@BuonDavide BuonDavide deleted the feat/timestamp-utc-revision branch July 8, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants