refactor(server): extract preflight checks into dedicated module#1527
Open
yeyitech wants to merge 1 commit intovolcengine:mainfrom
Open
refactor(server): extract preflight checks into dedicated module#1527yeyitech wants to merge 1 commit intovolcengine:mainfrom
yeyitech wants to merge 1 commit intovolcengine:mainfrom
Conversation
Move the inline Ollama availability check out of bootstrap into a new openviking/server/preflight.py module. Bootstrap now calls run_preflight_checks() which owns env detection, user-facing warnings, and error swallowing. This unblocks adding future preflight checks (vector DB reachability, model provider keys) without further growing bootstrap. Closes volcengine#1436
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move the inline Ollama availability check out of
openviking/server/bootstrap.pyinto a newopenviking/server/preflight.pymodule. Bootstrap now calls a singlerun_preflight_checks(ov_config)entry point which owns env detection, user-facing warnings, and exception swallowing.This decouples bootstrap from the specifics of any one provider check and makes it trivial to add future preflight checks (vector DB reachability, model provider keys, etc.) without growing
bootstrap.pyfurther.Changes
openviking/server/preflight.pywithrun_preflight_checks()and the extracted_check_ollama()helper.openviking/server/bootstrap.py— the 23-line inline block becomes a single call.tests/server/test_preflight.pycovering: no-op when Ollama is not configured, success path, failure path (warning emitted), and exception-swallow safety.Test plan
pytest-asyncioenvironmental issue; module-level behavior was verified manually).bootstrap.pybehavior unchanged for configured/unconfigured Ollama.Closes #1436