Skip to content

Fix: Update VAD package installation to support multiple paths - #34

Open
anshuman9468 wants to merge 1 commit into
dbpedia:masterfrom
anshuman9468:fix/vad-path-issue
Open

Fix: Update VAD package installation to support multiple paths#34
anshuman9468 wants to merge 1 commit into
dbpedia:masterfrom
anshuman9468:fix/vad-path-issue

Conversation

@anshuman9468

@anshuman9468 anshuman9468 commented Feb 14, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Bug Fixes
    • Improved robustness of VAD package installation by adding fallback support for multiple installation paths and enhanced error detection, ensuring installation succeeds even when packages are located in different directories.

@coderabbitai

coderabbitai Bot commented Feb 14, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added an install_vad function that attempts to locate and install VAD packages across multiple candidate paths, replacing a single direct installation call with a more robust, iterative approach that handles installation failures gracefully.

Changes

Cohort / File(s) Summary
VAD Installation Robustness
quickstart/quickstart.sh
Introduced install_vad function that iterates through multiple known paths to locate and install VAD packages, short-circuiting on success and reporting failure if all paths fail. Replaced direct vad_install call for dbpedia_dav.vad with this new robust installation pattern.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 accurately describes the main change: introducing multi-path support for VAD package installation to handle various potential package locations.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@quickstart/quickstart.sh`:
- Around line 32-43: run_virtuoso_cmd's non-zero exit is currently ignored so
failures with "[ERROR]" get treated as success; capture its exit code (e.g.,
rc=$?) immediately after calling run_virtuoso_cmd and treat any rc != 0 as a
failure: log a warning/error including "$OUTPUT" and the rc, avoid falling into
the success branch, and return a non-zero status instead of returning 0. Update
the logic around OUTPUT/run_virtuoso_cmd (and the success echo that references
VAD_NAME) to include this rc check so connection/command failures are handled
properly.
- Around line 105-106: The call to install_vad in quickstart.sh currently
ignores its return value so the script continues on failure; update the script
to check the exit status of install_vad "dbpedia_dav.vad" (e.g., if !
install_vad "dbpedia_dav.vad"; then echo an error to stderr and exit 1) so that
a failed VAD installation aborts before proceeding to the data-loading steps.

Comment thread quickstart/quickstart.sh
Comment on lines +32 to +43
local OUTPUT
OUTPUT=$(run_virtuoso_cmd "vad_install('${path}', 0);")
echo "$OUTPUT"

if [[ "$OUTPUT" == *"Errors detected"* ]] || [[ "$OUTPUT" == *"result set is empty"* ]]; then
echo "[WARN] Installation from '${path}' failed."
else
# If no errors detected, assume success.
# We could double check registry but that might be overkill if error detection is reliable.
echo "[INFO] Successfully installed '${VAD_NAME}'"
return 0
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Bug: run_virtuoso_cmd failure (non-zero exit) is treated as success.

When run_virtuoso_cmd returns non-zero (e.g., connection failure), its output contains [ERROR] but neither "Errors detected" nor "result set is empty". The condition on line 36 won't match, so execution falls through to the else branch and incorrectly reports success.

You should also check the return code of run_virtuoso_cmd:

🐛 Proposed fix
     local OUTPUT
-    OUTPUT=$(run_virtuoso_cmd "vad_install('${path}', 0);")
+    OUTPUT=$(run_virtuoso_cmd "vad_install('${path}', 0);")
+    local RC=$?
     echo "$OUTPUT"
 
-    if [[ "$OUTPUT" == *"Errors detected"* ]] || [[ "$OUTPUT" == *"result set is empty"* ]]; then
+    if [[ $RC -ne 0 ]] || [[ "$OUTPUT" == *"Errors detected"* ]] || [[ "$OUTPUT" == *"result set is empty"* ]]; then
       echo "[WARN] Installation from '${path}' failed."
     else
🤖 Prompt for AI Agents
In `@quickstart/quickstart.sh` around lines 32 - 43, run_virtuoso_cmd's non-zero
exit is currently ignored so failures with "[ERROR]" get treated as success;
capture its exit code (e.g., rc=$?) immediately after calling run_virtuoso_cmd
and treat any rc != 0 as a failure: log a warning/error including "$OUTPUT" and
the rc, avoid falling into the success branch, and return a non-zero status
instead of returning 0. Update the logic around OUTPUT/run_virtuoso_cmd (and the
success echo that references VAD_NAME) to include this rc check so
connection/command failures are handled properly.

Comment thread quickstart/quickstart.sh
Comment on lines 105 to +106
echo "[INFO] Installing VAD package 'dbpedia_dav.vad'"
run_virtuoso_cmd "vad_install('/opt/virtuoso-opensource/vad/dbpedia_dav.vad', 0);"
install_vad "dbpedia_dav.vad"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Return value of install_vad is ignored — script continues silently on failure.

If the VAD package cannot be installed from any known path, install_vad returns 1 but the script proceeds with data loading regardless. This could lead to a broken setup without any clear indication to the operator.

🛡️ Proposed fix
 echo "[INFO] Installing VAD package 'dbpedia_dav.vad'"
-install_vad "dbpedia_dav.vad"
+install_vad "dbpedia_dav.vad"
+if [ $? -ne 0 ]; then
+  echo "[ERROR] VAD package installation failed; aborting."
+  exit 1
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "[INFO] Installing VAD package 'dbpedia_dav.vad'"
run_virtuoso_cmd "vad_install('/opt/virtuoso-opensource/vad/dbpedia_dav.vad', 0);"
install_vad "dbpedia_dav.vad"
echo "[INFO] Installing VAD package 'dbpedia_dav.vad'"
install_vad "dbpedia_dav.vad"
if [ $? -ne 0 ]; then
echo "[ERROR] VAD package installation failed; aborting."
exit 1
fi
🤖 Prompt for AI Agents
In `@quickstart/quickstart.sh` around lines 105 - 106, The call to install_vad in
quickstart.sh currently ignores its return value so the script continues on
failure; update the script to check the exit status of install_vad
"dbpedia_dav.vad" (e.g., if ! install_vad "dbpedia_dav.vad"; then echo an error
to stderr and exit 1) so that a failed VAD installation aborts before proceeding
to the data-loading steps.

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