feat(api): POSTGRES_DB_PREFIX for database-name resolution#4684
feat(api): POSTGRES_DB_PREFIX for database-name resolution#4684jp-agenta wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesPostgreSQL Database Prefix and URI Refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
api/entrypoints/worker_events.py (1)
26-27: ⚡ Quick winConsolidate the duplicated
MAXLEN_QUEUES_WEBHOOKSconstant. Both files configure the same Redis streamqueues:webhooksand define the same constant with identical values. Extract to a shared location to maintain a single source of truth.
api/entrypoints/worker_events.py#L26-L27: Move this constant to a shared constants module (e.g.,api/oss/src/tasks/taskiq/webhooks/constants.py) or import from the other worker.api/entrypoints/worker_webhooks.py#L29-L30: Import the constant instead of redefining it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a7ca027d-fafc-42b7-988e-4d5d4120457f
⛔ Files ignored due to path filters (4)
api/uv.lockis excluded by!**/*.lockclients/python/uv.lockis excluded by!**/*.locksdks/python/uv.lockis excluded by!**/*.lockservices/uv.lockis excluded by!**/*.lock
📒 Files selected for processing (20)
api/entrypoints/worker_evaluations.pyapi/entrypoints/worker_events.pyapi/entrypoints/worker_webhooks.pyapi/oss/src/core/events/streaming.pyapi/oss/src/core/tracing/streaming.pyapi/oss/src/utils/env.pyapi/oss/tests/legacy/conftest.pyapi/oss/tests/legacy/workflows/core/tests.pyapi/pyproject.tomlclients/python/pyproject.tomldocs/openapi-cleanup/research.mdhosting/kubernetes/helm/Chart.yamlsdks/python/oss/tests/legacy/new_tests/conftest.pysdks/python/oss/tests/legacy/new_tests/workflows/core/tests.pysdks/python/pyproject.tomlservices/pyproject.tomlweb/ee/package.jsonweb/oss/package.jsonweb/package.jsonweb/packages/agenta-api-client/package.json
✅ Files skipped from review due to trivial changes (10)
- web/package.json
- web/packages/agenta-api-client/package.json
- services/pyproject.toml
- clients/python/pyproject.toml
- sdks/python/pyproject.toml
- api/pyproject.toml
- hosting/kubernetes/helm/Chart.yaml
- web/oss/package.json
- web/ee/package.json
- docs/openapi-cleanup/research.md
🚧 Files skipped from review as they are similar to previous changes (1)
- api/oss/src/utils/env.py
bad3bc9 to
766d9d7
Compare
Explicit POSTGRES_URI_* wins; else URIs compose from POSTGRES_DB_PREFIX plus
the existing user/password/port vars; else today's default agenta_{license}.
One knob for edition switches (EE stack pointing at agenta_oss_* databases)
without retyping credentials.
766d9d7 to
ae72462
Compare
Context
Switching a deployment between editions today means retyping full
POSTGRES_URI_*values, credentials included, because the default database names embed the license (agenta_oss_corevsagenta_ee_core).Changes
One knob: explicit
POSTGRES_URI_*wins; else URIs compose fromPOSTGRES_DB_PREFIXplus the existingPOSTGRES_USER/PASSWORD/PORTvars; else today's defaultagenta_{license}. An EE stack adopting an OSS database setsPOSTGRES_DB_PREFIX=agenta_ossand nothing else.What to QA
Unset prefix: URIs identical to before. Set
POSTGRES_DB_PREFIX=agenta_osson an EE stack: all three URIs point at theagenta_oss_*databases.🤖 Generated with Claude Code