Skip to content

chore: implement checkhealth status messages#1

Merged
smnatale merged 3 commits into
mainfrom
chore/implement-checkhealth
Apr 13, 2026
Merged

chore: implement checkhealth status messages#1
smnatale merged 3 commits into
mainfrom
chore/implement-checkhealth

Conversation

@smnatale
Copy link
Copy Markdown
Owner

@smnatale smnatale commented Apr 13, 2026

Description

Implement :checkhealth to ensure installation is correct for the plugin to function correctly.

Screenshots/Images

Screenshot 2026-04-13 at 11 26 24

Summary by CodeRabbit

  • New Features
    • Added a health diagnostics check that validates Neovim version (requires nvim-0.10+), verifies plugin setup, confirms the configured CLI binary is installed and reports its version, and checks authentication status (showing username and current organisation when available) with guidance for resolving issues.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 13, 2026

Warning

Rate limit exceeded

@smnatale has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 23 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 500f861b-9cd9-4155-baaf-806c79faa5e9

📥 Commits

Reviewing files that changed from the base of the PR and between 7eb7215 and affc792.

📒 Files selected for processing (1)
  • lua/coderabbit/health.lua
📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Health Check Module
lua/coderabbit/health.lua
New module exporting M.check() which: checks nvim-0.10 availability, verifies coderabbit.config._current (setup), resolves configured CLI via config.get(), checks executable presence, obtains CLI --version, and queries auth status --agent to report auth information or actionable warnings.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: implement checkhealth status messages' directly relates to the main change: adding a new health check module that implements checkhealth functionality for the coderabbit.nvim plugin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@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)
lua/coderabbit/health.lua (1)

39-43: Use the configured binary in auth remediation hints

Line 39 and Line 42 hardcode cr auth login; this can be misleading when cfg.cli.binary is 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

📥 Commits

Reviewing files that changed from the base of the PR and between f0ff9be and 93261ce.

📒 Files selected for processing (1)
  • lua/coderabbit/health.lua

Comment thread lua/coderabbit/health.lua
@smnatale smnatale merged commit 4c5d4f7 into main Apr 13, 2026
4 checks passed
@smnatale smnatale deleted the chore/implement-checkhealth branch April 13, 2026 10:38
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.

1 participant