Conversation
|
The following will be added to the changelog [0.6.1] - 2026-03-18Bug Fixes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughReplaced a streamed jq pipeline in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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)
nomad/scripts/count_eligible_nodes.sh (1)
72-74: Please mirror this fallback in the module docs too.The inline note is helpful, but this Nomad quirk now affects the script’s contract and should also be called out in the file header/module docs.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nomad/scripts/count_eligible_nodes.sh` around lines 72 - 74, Add a short module-docs/header note explaining the Nomad quirk: when there are no running jobs the API returns the literal string "No running jobs" rather than JSON, and this script maps that to an empty JSON array by setting busy_json='[]' (see the conditional that checks jobs_json and assigns busy_json). Update the top-of-file comment block (module docs) to describe this contract, include the exact string "No running jobs" and the resulting behavior (busy_json becomes '[]'), and mirror that note in any accompanying README or module documentation to make the fallback explicit to callers and maintainers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nomad/scripts/count_eligible_nodes.sh`:
- Around line 67-79: The script currently mixes stdout and stderr into jobs_json
(via 2>&1) which breaks the "No running jobs" check and jq validation; change to
capture stdout and stderr separately (e.g., capture stdout into jobs_stdout and
stderr into jobs_stderr), perform the "No running jobs" string comparison and jq
-e validation only against jobs_stdout, and only log jobs_stderr when non-empty;
also avoid buffering the entire payload into a single variable by streaming
jobs_stdout directly into jq to produce busy_json (reference the
jobs_json/busy_json variables and the nomad job status invocation via $NOMAD).
---
Nitpick comments:
In `@nomad/scripts/count_eligible_nodes.sh`:
- Around line 72-74: Add a short module-docs/header note explaining the Nomad
quirk: when there are no running jobs the API returns the literal string "No
running jobs" rather than JSON, and this script maps that to an empty JSON array
by setting busy_json='[]' (see the conditional that checks jobs_json and assigns
busy_json). Update the top-of-file comment block (module docs) to describe this
contract, include the exact string "No running jobs" and the resulting behavior
(busy_json becomes '[]'), and mirror that note in any accompanying README or
module documentation to make the fallback explicit to callers and maintainers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: da8cd680-b948-4ffd-b70f-b50cc61f8819
📒 Files selected for processing (1)
nomad/scripts/count_eligible_nodes.sh
ThetaSinner
left a comment
There was a problem hiding this comment.
Looks good, coderabbit suggestion may be worth a look
Nomad ignores the -json flag when there are no jobs and returns plain text instead of an empty JSON array, which caused jq parse failures in count_eligible_nodes.sh. Treat this case as zero busy nodes.
2e0f0d9 to
d6aaf2a
Compare
|
✔️ d6aaf2a - Conventional commits check succeeded. |
Nomad ignores the -json flag when there are no jobs and returns plain
text instead of an empty JSON array, which caused jq parse failures in
count_eligible_nodes.sh. Treat this case as zero busy nodes.
Summary
TODO:
Note that all commits in a PR must follow Conventional Commits before it can be merged, as these are used to generate the changelog
Summary by CodeRabbit
Bug Fixes
Chores