Skip to content

Refactor(CLI): Centralize ov.conf JSON loading in ov doctor#913

Merged
MaojiaSheng merged 1 commit intovolcengine:mainfrom
everforge:chore/ruff-target-python-310
Mar 24, 2026
Merged

Refactor(CLI): Centralize ov.conf JSON loading in ov doctor#913
MaojiaSheng merged 1 commit intovolcengine:mainfrom
everforge:chore/ruff-target-python-310

Conversation

@everforge
Copy link
Contributor

Description

Improves ov doctor by loading ov.conf through a small shared helper that only catches OSError and json.JSONDecodeError, instead of a broad Exception. Aligns Ruff’s target-version with the package’s requires-python (3.10+). Adds unit tests for invalid JSON on embedding and VLM checks.

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Added _load_config_json() in openviking_cli/doctor.py and reused it in check_embedding, check_vlm, and check_disk workspace resolution.
  • Set tool.ruff target-version from py39 to py310 in pyproject.toml.
  • Added test_fail_invalid_json for check_embedding and check_vlm in tests/cli/test_doctor.py.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A — CLI / tooling only.

Additional Notes

check_config still uses explicit JSON error messaging for the primary config validation path; only the secondary reads were deduplicated.

@CLAassistant
Copy link

CLAassistant commented Mar 24, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Failed to generate code suggestions for PR

@MaojiaSheng MaojiaSheng merged commit 0b9df76 into volcengine:main Mar 24, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants