Repository navigation
fix(cli): NSC_SCHEMA is the env-var form of --schema (#192) - #193
Merged
Merged
Conversation
NSC_SCHEMA only fed profile.schema_url, so a local path was ignored and an unreachable URL silently fell back to the cached/bundled schema. Resolve it alongside --schema (flag wins) and pass it as the schema override, so it loads the path or URL directly and a failure exits 3. Claude-Session: https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb
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.
Fixes #192.
Before this change,
NSC_SCHEMAwas used only to setprofile.schema_url, and only when the value was a URL. As a result:The new
resolve_schema_override(overrides, env)innsc/cli/runtime.pyreturns--schemaif set, otherwiseNSC_SCHEMA. An empty value counts as unset.build_runtime_contextpasses the result toresolve_command_modelas the schema override.NSC_SCHEMAnow behaves exactly like--schema: it loads the path or URL directly, skips the TTL, cache and bundled fallbacks, and a load failure exits 3 withError: cannot load schema from <source>: <reason>(#189).Tests: the new
tests/cli/test_schema_env_override.pycovers:dcim widgetsresource;--schemawinning overNSC_SCHEMA;NSC_SCHEMAcounting as unset.Docs:
docs/architecture/schema-loading.md,docs/architecture/overview.md, CHANGELOG.https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb