Skip to content

kafka-topic-added#800

Merged
nevil-mathew merged 2 commits into
developfrom
KafkaFix
Aug 19, 2025
Merged

kafka-topic-added#800
nevil-mathew merged 2 commits into
developfrom
KafkaFix

Conversation

@MallanagoudaB
Copy link
Copy Markdown
Collaborator

@MallanagoudaB MallanagoudaB commented Aug 19, 2025

Summary by CodeRabbit

  • New Features

    • Improved service health monitoring by adding a configurable health-check topic to expand status checks.
  • Chores

    • Added a new environment variable for the health-check topic with a sensible default and updated the sample env file.
    • Upgraded the health-check dependency to a newer version for compatibility and stability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 19, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary of Changes
Env sample & validation
src/.env.sample, src/envVariables.js
Added KAFKA_HEALTH_CHECK_TOPIC entry with default user-health-check-topic-check; comment added to .env.sample; envVariables includes { message: 'Required KAFKA_HEALTH_CHECK_TOPIC', optional: true, default: 'user-health-check-topic-check' }.
Health-check config
src/health-checks/health.config.js
Added topic property to exported redis config set from process.env.KAFKA_HEALTH_CHECK_TOPIC.
Dependency bump
src/package.json
Updated elevate-services-health-check from ^0.0.3 to ^0.0.5.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I twitch my whiskers at a topic new,
A tiny string that tells me what to do.
Configs hop in, dependencies leap,
My heartbeat pitter-pats steady and deep.
A carrot nod to the changes — quick and true. 🥕🐇

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 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 2d75858 and b29be0a.

📒 Files selected for processing (1)
  • src/envVariables.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/envVariables.js
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch KafkaFix

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between e0a5fab and 2d75858.

⛔ Files ignored due to path filters (1)
  • src/health-checks/README.md is 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 required

Since 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 /health endpoint 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.js

The Kafka topic is currently nested under redis, which will likely be ignored or cause validation errors in elevate-services-health-check. Update the configuration in src/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-check expects the topic field under checks.kafka.

Comment thread src/envVariables.js
Comment thread src/envVariables.js Outdated
@nevil-mathew nevil-mathew merged commit 94f9aea into develop Aug 19, 2025
1 of 2 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 19, 2025
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.

2 participants