Skip to content

fix(server): make observability migration retry-safe#226

Open
abhinav-galileo wants to merge 1 commit into
mainfrom
fix/idempotent-observability-migration
Open

fix(server): make observability migration retry-safe#226
abhinav-galileo wants to merge 1 commit into
mainfrom
fix/idempotent-observability-migration

Conversation

@abhinav-galileo
Copy link
Copy Markdown
Collaborator

Summary

  • Make the observability namespace Alembic migration tolerate partially-applied schema state.
  • Skip adding namespace_key when it already exists.
  • Rewrite the event primary key only when it is not already namespace-scoped.
  • Add regression tests for partial migration retries before Alembic stamps the revision.

Testing

  • env -u AGENT_CONTROL_DB_URL -u DATABASE_URL -u DB_URL AGENT_CONTROL_DB_HOST=localhost AGENT_CONTROL_DB_PORT=5432 AGENT_CONTROL_DB_USER=agent_control AGENT_CONTROL_DB_PASSWORD=agent_control AGENT_CONTROL_DB_DATABASE=agent_control_test AGENT_CONTROL_DB_DRIVER=psycopg uv run --package agent-control-server pytest server/tests/test_data_model_v1_alembic_migration.py -q
  • uv run ruff check tests/test_data_model_v1_alembic_migration.py alembic/versions/b6f4c2d8e9a1_namespace_observability_events.py from server/
  • git diff --check

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant