fix: improve missing package error messages#149
fix: improve missing package error messages#149mergify[bot] merged 1 commit intoopendatahub-io:mainfrom
Conversation
WalkthroughReplaced Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
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: 0
🧹 Nitpick comments (1)
distribution/build.py (1)
51-59: Docstring lacks parameter documentation.The function parameters
commandandpackage_nameshould be documented in the docstring to clarify their purpose and usage:def check_command_installed(command, package_name=None): - """Check if a command is installed and accessible. - """ + """Check if a command is installed and accessible. + + Args: + command: The command name to check for availability. + package_name: Optional package name to display in error message for installation guidance. + """
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
distribution/build.py(2 hunks)
🧰 Additional context used
🪛 GitHub Actions: Pre-commit
distribution/build.py
[error] 1-1: pre-commit hook 'ruff-format' failed. 1 file reformatted; exit code 1 during 'pre-commit run --show-diff-on-failure --color=always --all-files'.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-test-push (linux/amd64)
- GitHub Check: Summary
🔇 Additional comments (2)
distribution/build.py (2)
272-272: LGTM!The error message for the missing
llamacommand now provides specific installation instructions pointing to the correct package (llama-stack-client). This aligns well with the PR's objective.
269-269: Provide specific installation instructions foruv.The call to
check_command_installed("uv")doesn't provide a package name, resulting in a generic error message. This doesn't align with the PR's goal of providing specific installation instructions.Consider providing the package name:
- check_command_installed("uv") + check_command_installed("uv", "uv")However, note that installing
uvviauv pipmay be circular. You may want to either:
- Keep the generic message for
uvsince it's a bootstrapping tool- Provide a different installation method in the error message (e.g., "Please install uv from https://...")
nathan-weinberg
left a comment
There was a problem hiding this comment.
pre-commit needs fixing but LGTM!
f18c18c to
0fc9be8
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
distribution/build.py (1)
51-59: Newcheck_command_installedhelper matches requirements; consider minor ergonomics.The helper cleanly generalizes the old check and supports the
package_namehint; this will give a niceuv pip install llama-stack-clientmessage for missingllama, which aligns with the PR goal. The control flow and use ofshutil.which/sys.exit(1)are fine for this script-style module.If you want to polish further (optional):
- Send error messages to stderr (
print(..., file=sys.stderr)) so tooling can separate errors from normal output.- Slightly expand the generic message to hint how to install
uv(e.g., link to docs orpipx), but that’s more of a product decision than a code issue.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
distribution/build.py(2 hunks)
🧰 Additional context used
🪛 GitHub Actions: Pre-commit
distribution/build.py
[error] 1-1: ruff-format failed during pre-commit hook: 1 file reformatted; changes committed by hook. This caused the CI step to fail (pre-commit run --show-diff-on-failure --color=always --all-files).
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-test-push (linux/amd64)
- GitHub Check: Summary
🔇 Additional comments (2)
distribution/build.py (2)
268-273: Call-site updates correctly gate later operations on required commands.The new
main()checks:
check_command_installed("uv")before anyuv pip installusage.check_command_installed("llama", "llama-stack-client")before invokingllama stack ....This ensures clearer, actionable failures when prerequisites are missing and satisfies the PR objective without changing behavior when the commands are present.
1-291: Run pre-commit hooks locally to fix ruff-format issues.The CI pipeline indicates
ruff-formathas identified formatting issues in this file. Run the following locally and commit any changes:pre-commit run --all-files git statusPush the updated commit to resolve the pipeline failure.
6fcdf0b to
35f74f7
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
distribution/build.py (1)
51-60: Command-check helper correctly encapsulates PATH check and error messaging; only minor polish possibleThe function cleanly wraps
shutil.whichand exits with a clear message, and the optionalpackage_namehook satisfies the PR goal of giving auv pip install ...hint for specific tools. Behavior matches the old helper’s semantics while improving clarity.If you expect future callers that might not use
uv, you could later generalizepackage_nameinto a more genericinstall_hintor similar, but that’s purely optional and not required for this PR.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
distribution/build.py(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-test-push (linux/amd64)
- GitHub Check: Summary
🔇 Additional comments (1)
distribution/build.py (1)
269-274: Updated call sites align with new helper and PR intentUsing
check_command_installed("uv")before invoking anyuvcommands andcheck_command_installed("llama", "llama-stack-client")before runningllama stack ...ensures failures surface early with actionable guidance (uv pip install llama-stack-client). This directly achieves the stated objective of clearer missing-command errors without changing control flow.
35f74f7 to
dfff56d
Compare
dfff56d to
8c954cb
Compare
|
@Artemon-line PTAL at the CI failure - it is related to the Vertex AI auth |
I know pls see the error message: "By default, secrets are not passed to workflows triggered from forks, including Dependabot." -- shortly you cannot access those secrets from your fork, for obvious reasons. |
Provide clear installation instructions when commands are missing rather than just stating they are not found.
8c954cb to
6638a7d
Compare
Summary
Improve error messages when required commands are not found by providing specific installation instructions.
Changes
check_package_installed()to accept optional package name parameteruv pip installcommand whenllamais missingTest plan
Summary by CodeRabbit
Bug Fixes
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.