cleanup(backend/data): drop pre-cluster REDIS_HOST/RABBITMQ_HOST env fallbacks - #12949
cleanup(backend/data): drop pre-cluster REDIS_HOST/RABBITMQ_HOST env fallbacks#12949majdyz wants to merge 2 commits into
Conversation
…fallbacks The Redis Cluster migration (#12900) shipped dual-read fallbacks so old-image pods could keep reading the unsuffixed REDIS_HOST/RABBITMQ_HOST during the rolling deploy. The rollout window has long closed: shared-config no longer exposes those vars and every pod is on the cluster image. This removes the now-dead surface: - backend/data/redis_client.py: drop the REDIS_HOST/PORT `or` fallback. - backend/util/settings.py: drop the AliasChoices(_HOST, _CLUSTER_HOST) multi-alias on rabbitmq_host/port and redis_host/port. - backend/.env.default: rename REDIS_HOST/PORT -> REDIS_CLUSTER_HOST/PORT so local dev uses the canonical names. - docker-compose.platform.yml: same rename for the in-network backend env. - .github/workflows/platform-backend-ci.yml: same rename for the test job env. - backend/data/e2e_redis_restart_test.py: stop monkeypatching the legacy REDIS_HOST/PORT alongside REDIS_CLUSTER_HOST/PORT. - backend/copilot/bot/README.md: update the env-var doc to the cluster names. No runtime behaviour change for anything currently in production — every caller already routes through *_CLUSTER_HOST.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
🧰 Additional context used📓 Path-based instructions (2)autogpt_platform/backend/**/*.py📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
autogpt_platform/{backend,autogpt_libs}/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (8)📓 Common learnings📚 Learning: 2026-02-26T17:02:22.448ZApplied to files:
📚 Learning: 2026-03-05T15:42:08.207ZApplied to files:
📚 Learning: 2026-03-16T16:35:40.236ZApplied to files:
📚 Learning: 2026-03-31T15:37:38.626ZApplied to files:
📚 Learning: 2026-04-15T02:43:36.890ZApplied to files:
📚 Learning: 2026-04-22T11:46:04.431ZApplied to files:
📚 Learning: 2026-04-22T11:46:12.892ZApplied to files:
🔇 Additional comments (2)
WalkthroughThe PR renames environment variables used for Redis and RabbitMQ across the backend from legacy names (e.g., Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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. Review rate limit: 6/8 reviews remaining, refill in 11 minutes and 32 seconds.Comment |
🔍 PR Overlap DetectionThis check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early. 🔴 Merge Conflicts DetectedThe following PRs have been tested and will have merge conflicts if merged after this PR. Consider coordinating with the authors.
🟢 Low Risk — File Overlap OnlyThese PRs touch the same files but different sections (click to expand)
Summary: 1 conflict(s), 0 medium risk, 5 low risk (out of 6 PRs with file overlap) Auto-generated on push. Ignores: |
…e line isort/black wants the 5-item pydantic import on one line; CI lint failed on the multi-line form left over from removing AliasChoices.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #12949 +/- ##
==========================================
- Coverage 69.55% 69.54% -0.01%
==========================================
Files 2114 2114
Lines 157457 157456 -1
Branches 16230 16229 -1
==========================================
- Hits 109515 109507 -8
- Misses 44718 44723 +5
- Partials 3224 3226 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Background
The Redis Cluster migration (#12900) shipped dual-read fallbacks so old-image pods could keep reading the unsuffixed
REDIS_HOST/RABBITMQ_HOSTwhile we rolled out the cluster-image. That rolling-deploy window has long closed:REDIS_HOST/RABBITMQ_HOST(see related infra PR Add dir with interesting "ai_settings"/prompts #316),*_CLUSTER_HOSTexclusively.The fallback path is dead surface — kept around it would just rot and confuse future readers (and trip the next
address_remapchange, since it can silently grab a staleREDIS_HOSTif something puts one back).Changes
backend/data/redis_client.py— drop theos.getenv("REDIS_CLUSTER_HOST") or os.getenv("REDIS_HOST", ...)chain; cluster envs only.backend/util/settings.py— replaceAliasChoices("RABBITMQ_CLUSTER_HOST", "RABBITMQ_HOST")(and the redis equivalent) with single-string aliases onrabbitmq_host/portandredis_host/port.AliasChoicesimport removed (no other call sites).backend/.env.default—REDIS_HOST/REDIS_PORT->REDIS_CLUSTER_HOST/REDIS_CLUSTER_PORTso contributors set the canonical name.docker-compose.platform.yml— same rename in the sharedx-backend-envblock (REDIS_HOST: redis-0->REDIS_CLUSTER_HOST: redis-0,RABBITMQ_HOST: rabbitmq->RABBITMQ_CLUSTER_HOST: rabbitmq)..github/workflows/platform-backend-ci.yml— same rename in the unit-test job env block.backend/data/e2e_redis_restart_test.py—monkeypatch.setenvonly sets the cluster envs now.backend/copilot/bot/README.md— env-var docs updated toREDIS_CLUSTER_HOST/REDIS_CLUSTER_PORT.Behaviour
No production behaviour change. Every caller already reads
*_CLUSTER_HOSTfirst; this PR just deletes the never-hit fallback.Test plan
poetry run ruff check+ruff format --checkclean on all touched.pyfiles.platform-backend-ciruns the focused redis/rabbit unit tests +e2e_redis_restart_testagainst the new env names. (Localpytestcollection currently blocked by sibling agents holding the shared.venv; relying on CI here.)*_CLUSTER_HOSTonly.