Conversation
Extracts Redis client into its own module with configurable TLS options. Adds env vars for TLS, and documents them in a new Infrastructure section. Fixes #1006 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds Redis TLS support: a new backend Redis module builds TLS options from environment variables, shared env schema exposes REDIS_TLS_* keys, backend imports the shared Redis client, and docs/manifest updated with infrastructure and Redis TLS documentation. Changes
Sequence Diagram(s)sequenceDiagram
participant Env as "Environment (REDIS_URL + REDIS_TLS_*)"
participant RedisModule as "packages/backend/src/redis.ts"
participant Backend as "packages/backend/src/index.ts"
participant RedisServer as "Redis (remote)"
Env->>RedisModule: provide `REDIS_URL` and `REDIS_TLS_*` vars
RedisModule->>RedisModule: buildTlsOptions() (read flags, load files)
RedisModule->>RedisModule: instantiate shared `redis` with TLS options
Backend->>RedisModule: import shared `redis`
Backend->>RedisServer: connect via `redis` (TLS if enabled)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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)
docs/docs/deployment/infrastructure/redis.mdx (1)
6-6: Use second-person voice in the opening sentence.Please rephrase Line 6 to second person (for example, “You use Redis…”), to match docs style consistency.
As per coding guidelines,
docs/**/*.mdx: "Write in second person ('you') and present tense."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/docs/deployment/infrastructure/redis.mdx` at line 6, Replace the sentence "Sourcebot uses Redis as a job queue for background indexing work." with a second-person, present-tense variant (e.g., "You use Redis as a job queue for background indexing work.") to match docs style; update the text in the redis.mdx content where that exact sentence appears so the opening sentence uses "you" and present tense.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/backend/src/redis.ts`:
- Around line 5-8: buildTlsOptions currently only enables TLS when
REDIS_TLS_ENABLED="true", ignoring when REDIS_URL uses rediss://; change it so
TLS options are built when either env.REDIS_TLS_ENABLED==="true" OR
env.REDIS_URL startsWith("rediss://"). Populate and return a proper tls options
object using env-driven values (e.g. REDIS_TLS_SERVERNAME -> servername,
REDIS_TLS_CA/REDIS_TLS_CERT/REDIS_TLS_KEY -> ca/cert/key,
REDIS_TLS_REJECT_UNAUTHORIZED -> rejectUnauthorized, REDIS_TLS_CIPHERS ->
ciphers, etc.) so ioredis receives detailed TLS config; otherwise return {}.
Ensure this logic lives in buildTlsOptions so callers of that function get the
correct tls config.
---
Nitpick comments:
In `@docs/docs/deployment/infrastructure/redis.mdx`:
- Line 6: Replace the sentence "Sourcebot uses Redis as a job queue for
background indexing work." with a second-person, present-tense variant (e.g.,
"You use Redis as a job queue for background indexing work.") to match docs
style; update the text in the redis.mdx content where that exact sentence
appears so the opening sentence uses "you" and present tense.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2e10554d-339f-4016-bd50-ff8f6d5f1978
📒 Files selected for processing (7)
docs/docs.jsondocs/docs/configuration/environment-variables.mdxdocs/docs/deployment/infrastructure/architecture.mdxdocs/docs/deployment/infrastructure/redis.mdxpackages/backend/src/index.tspackages/backend/src/redis.tspackages/shared/src/env.server.ts
Summary
packages/backend/src/redis.tswith TLS supportREDIS_TLS_ENABLED, certs, SNI, cipher options, etc.)Fixes #1006
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation