Repository navigation
Conversation
Generate the JSON Schema from the driver's constructor config fields instead of generating it for the whole dataclass and filtering afterwards. Runtime-only fields (`init=False`, or non-pydantic handles such as Qemu's `TemporaryDirectory`) are not user config, but pydantic still tried to model them, so Qemu, Renode, DutNetwork, HttpServer, the gpiod drivers and others fell back to a name-only schema with `error` set. Failures are now contained per field: a constructor field pydantic cannot model is degraded on its own, while the remaining fields keep their types and `$defs`. This also drops the unreferenced base `Driver` definition that used to be emitted for 45 of 68 drivers. While here: - show the recovered config keys in table output when an entry has an error, instead of printing the full pydantic traceback in the CONFIG KEYS column - report entry points that do not resolve to a dataclass driver (currently ssh_mitm loads a module) instead of emitting an empty schema - keep the `$ref` root dereference inside the per-entry error boundary Tests: - extend the hermetic fixtures with a non-pydantic `init=False` runtime field and an unmodelable `init=True` field - add a jumpstarter-all integration test that runs `jmp driver schema` against every installed driver and asserts: all drivers are reported, keys match constructor fields, runtime fields never turn an otherwise modelable driver into an error, no unreferenced `Driver` definition, Qemu keeps its types/$defs, and gpiod drivers exclude runtime fields Assisted-by: OpenCode Co-Authored-By: DeepSeek V4.1 Flash <noreply@deepseek.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
setup-uv v9 removed the `python-version-file` input, but the workflows still passed it. The action silently ignores unknown inputs, so uv resolved the newest interpreter (3.14) instead of the version in `.py-version`: ##[warning]Unexpected input(s) 'python-version-file', valid inputs are ['version', 'version-file', 'python-version', ...] On this branch the lockfile still pins `pydantic-core==2.33.2`, which has no cp314 wheel, so the docs and type-check jobs failed while building it from source: error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13) Main currently hides this because its newer lock has 3.14 wheels. Read `.py-version` in the existing `id: uv` step and pass it through the supported `python-version` input instead. Also disable the uv cache in `build-python-wheels`: the build is skipped on a wheels cache hit, so uv never runs and v9 fails post-job because the cache directory it tries to save does not exist. Assisted-by: OpenCode Co-Authored-By: DeepSeek V4.1 Flash <noreply@deepseek.com>
ty flags `pytest.skip()` as not callable; follow the existing convention in the repo and annotate it. Assisted-by: OpenCode Co-Authored-By: DeepSeek V4.1 Flash <noreply@deepseek.com>
mangelajo
force-pushed
the
fix/driver-schema-runtime-fields
branch
from
November 10, 2026 16:50
fc7851e to
5692def
Compare
Member
Author
|
@kirkbrauer this is a stack on top of your #1071 to see if we could merge it. |
Member
Author
|
I'll close this for now, but we can keep it around for reference. |
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.
Stacked on #1071.
Fixes the schema-generation failure this PR attributes to Qemu being "expected to fail". It is not driver-specific: the schema was generated for the whole dataclass and filtered afterwards, so any runtime-only field pydantic cannot model (Qemu's
_tmp_dir, Renode's, DutNetwork'sPopen, HttpServer'saiohttpapp, gpiod'sChip/LineRequest, ...) sank the whole entry.On this branch, against the full installed driver set:
errordefs.Driver$defs.HostfwdThe remaining 9 are genuine: ISCSI (libudev missing on macOS), UStreamer/IsoTp/QemuFlasher/QemuPower/Renode* (an actual constructor field pydantic cannot model), ssh_mitm (entry point loads a module, now reported explicitly).
What changed:
init=True, non-Driverfields via a filtered pydantic model$defsfor the rest$refroot handling stays inside the per-entry error boundaryTests:
init=Falseruntime field (would have caught Qemu) and an unmodelableinit=Truefieldjumpstarter-allintegration test runs the CLI over every installed driver and checks keys vs constructor fields, no runtime-field-induced errors, no baseDriverdefs, Qemu types, and gpiod fieldsValidation:
pkg-test-jumpstarter-cli-driver: 24 passedpkg-test-jumpstarter-all: 9 passedAssisted-by: OpenCode
Co-Authored-By: DeepSeek V4.1 Flash noreply@deepseek.com