chore: implement checkhealth status messages#1
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 24 minutes and 23 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new Neovim health check module that verifies Neovim version, whether the plugin was set up, the presence and version of the configured CLI binary, and the CLI authentication status, reporting results to Neovim’s health UI. Changes
Sequence Diagram(s)sequenceDiagram
participant NV as Neovim (health UI)
participant Health as coderabbit.health
participant Config as coderabbit.config
participant Shell as Shell / CLI
NV->>Health: invoke M.check()
Health->>Config: config.get() / check _current
Health-->>NV: report setup OK or warn
Health->>Shell: run "<bin> --version"
Shell-->>Health: stdout / exit status
Health-->>NV: report version OK or warn
Health->>Shell: run "<bin> auth status --agent"
Shell-->>Health: stdout / exit status
Health->>Health: pcall(json.decode stdout)
Health-->>NV: report auth OK with user/org or warn with login suggestion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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)
lua/coderabbit/health.lua (1)
39-43: Use the configured binary in auth remediation hintsLine 39 and Line 42 hardcode
cr auth login; this can be misleading whencfg.cli.binaryis customised.Suggested tweak
- vim.health.warn("Not authenticated", { "Run: cr auth login" }) + vim.health.warn("Not authenticated", { "Run: " .. binary .. " auth login" }) @@ - vim.health.warn("Could not check auth status", { "Run: cr auth login" }) + vim.health.warn("Could not check auth status", { "Run: " .. binary .. " auth login" })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lua/coderabbit/health.lua` around lines 39 - 43, The health check warns currently hardcode the CLI remediation hint "cr auth login"; update both vim.health.warn calls to use the configured CLI binary from cfg.cli.binary (e.g., build the hint string by concatenating cfg.cli.binary with " auth login") so the message reflects a customised binary; locate the warnings in health.lua (the vim.health.warn calls around auth checks) and replace the literal "cr auth login" with a constructed hint using cfg.cli.binary to produce "<binary> auth login".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lua/coderabbit/health.lua`:
- Around line 14-16: The health check currently calls config.get() (in
health.lua) which initializes config._current and makes the "Plugin configured"
status always true; change the check so it inspects config._current directly
instead of calling config.get() for the configured boolean. Concretely, remove
or avoid the eager call to config.get() when computing the configured flag, use
require("coderabbit.config") and test config._current for truthiness to report
configured, and keep using config.get() only when you actually need a
fully-initialized cfg (e.g., to read binary in the parts that need it), leaving
setup() as the initializer.
---
Nitpick comments:
In `@lua/coderabbit/health.lua`:
- Around line 39-43: The health check warns currently hardcode the CLI
remediation hint "cr auth login"; update both vim.health.warn calls to use the
configured CLI binary from cfg.cli.binary (e.g., build the hint string by
concatenating cfg.cli.binary with " auth login") so the message reflects a
customised binary; locate the warnings in health.lua (the vim.health.warn calls
around auth checks) and replace the literal "cr auth login" with a constructed
hint using cfg.cli.binary to produce "<binary> auth login".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4a93ddbc-4c86-46b0-9831-3b3354476e9e
📒 Files selected for processing (1)
lua/coderabbit/health.lua
Description
Implement
:checkhealthto ensure installation is correct for the plugin to function correctly.Screenshots/Images
Summary by CodeRabbit