kafka-topic-added#800
Conversation
WalkthroughAdds a new optional environment variable KAFKA_HEALTH_CHECK_TOPIC with a default value, exposes it in env validation and .env sample, injects it into the health-check redis configuration as a topic, and bumps the elevate-services-health-check dependency version. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as Application
participant Env as Env Loader
participant HC as Health-Check Module
participant Kafka as Kafka Broker
App->>Env: Load env vars (incl. KAFKA_HEALTH_CHECK_TOPIC)
Env-->>App: Return validated config (with default if unset)
App->>HC: Initialize health-check config { enabled, url, topic }
HC->>Kafka: Publish/Probe using topic
Kafka-->>HC: Respond
HC-->>App: Report health status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/.env.sample (1)
181-183: Fix .env formatting: remove quotes/trailing whitespace, add trailing newline (lint clean-up)Cleans up QuoteCharacter, TrailingWhitespace, and EndingBlankLine warnings for the newly added/modified lines.
Apply:
-DEFAULT_PHONE_CODE="+91" +DEFAULT_PHONE_CODE=+91 # kafka topic for health check -KAFKA_HEALTH_CHECK_TOPIC='user-health-check-topic-check' +KAFKA_HEALTH_CHECK_TOPIC=user-health-check-topic-check +Optional: If you want to satisfy the UnorderedKey rule from dotenv-linter, consider regrouping keys alphabetically in a separate PR to avoid noisy diffs.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
src/health-checks/README.mdis excluded by!**/*.md
📒 Files selected for processing (4)
src/.env.sample(1 hunks)src/envVariables.js(1 hunks)src/health-checks/health.config.js(1 hunks)src/package.json(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/health-checks/health.config.js (1)
src/database/models/index.js (1)
process(6-6)
🪛 dotenv-linter (3.3.0)
src/.env.sample
[warning] 181-181: [QuoteCharacter] The value has quote characters (', ")
(QuoteCharacter)
[warning] 181-181: [UnorderedKey] The DEFAULT_PHONE_CODE key should go before the DEFAULT_TENANT_CODE key
(UnorderedKey)
[warning] 183-183: [EndingBlankLine] No blank line at the end of the file
(EndingBlankLine)
[warning] 183-183: [TrailingWhitespace] Trailing whitespace detected
(TrailingWhitespace)
[warning] 183-183: [UnorderedKey] The KAFKA_HEALTH_CHECK_TOPIC key should go before the NOTIFICATION_API_URL key
(UnorderedKey)
🔇 Additional comments (2)
src/package.json (1)
47-47: Bump elevate-services-health-check to ^0.0.5: manual review requiredSince the package on npm doesn’t expose a repository or changelog, we can’t auto-verify any contract changes. Even though this is a patch bump (0.0.4 → 0.0.5), please:
- Update your lockfile (yarn.lock or package-lock.json)
- Install and exercise the
/healthendpoint against 0.0.5 locally- Review your config (new Kafka topics, Redis flags, defaults, etc.) for any changes
Low risk overall, but a quick manual sanity check will ensure nothing unexpected slipped in.
src/health-checks/health.config.js (1)
12-20: Move Kafka topic to the correct check in health.config.jsThe Kafka topic is currently nested under
redis, which will likely be ignored or cause validation errors inelevate-services-health-check. Update the configuration insrc/health-checks/health.config.js(lines 12–20) as follows:kafka: { enabled: true, url: process.env.KAFKA_URL, + topic: process.env.KAFKA_HEALTH_CHECK_TOPIC, }, redis: { enabled: true, - url: process.env.REDIS_HOST, - topic: process.env.KAFKA_HEALTH_CHECK_TOPIC, + url: process.env.REDIS_HOST, },Please verify that version ^0.0.5 of
elevate-services-health-checkexpects thetopicfield underchecks.kafka.
Summary by CodeRabbit
New Features
Chores