Repository navigation
chore(deps): bump jsonschema from 0.18.3 to 0.58.6 - #866
Conversation
Port the wright-cli schema tests to validator_for and iter_errors. Supersedes #469, which missed agent_contract_vocabulary.rs.
Teakowa
left a comment
There was a problem hiding this comment.
Verdict: changes requested (round 1). The port is correct. One dependency-footprint issue should be fixed before merge.
Blocking: crates/wright-cli/Cargo.toml:39 takes the default features of jsonschema 0.58.
They enable HTTP/file $ref resolution and pull in reqwest, rustls-platform-verifier, aws-lc-rs/aws-lc-sys (C build, needs cmake), jni and more. That is about 262 of the 442 added Cargo.lock lines, and it is all for a dev-dependency used on local, self-contained schemas. Failure scenario: every test build on every runner now compiles aws-lc-sys and needs cmake, and a schema $ref to a remote URL would make a test fetch from the network. Fix: jsonschema = { version = "0.58", default-features = false }. I checked this on the branch: agent_contract (13), agent_contract_vocabulary (2) and diagnostics_schema (1) all pass and the lock shrinks by 262 lines. I did not commit the change.
Checked and fine
jsonschemaappears only inwright-cli[dev-dependencies]and three test files (agent_contract.rs,agent_contract_vocabulary.rs,diagnostics_schema.rs). No user was missed, includingagent_contract_vocabulary.rs.- Strictness: the root of
wright-agent-v1.schema.jsonholds only$schema,$id,title,$defsand$ref. The tests overwrite the root$ref, so Draft 7 versus 2020-12 sibling handling cannot change results. This agrees with the PR body. Format assertions are not used. - Mutation: I added a required
zzztoEditRangein the agent schema and to the check schema.agent_contractanddiagnostics_schemaboth failed. The existing invalid-instance loop inagent_contract_vocabularystill passes. - The diff is a mechanical API rename (
compiletovalidator_for,validatetoiter_errors). No assertion was dropped or weakened. - Local
cargo fmt --check,clippy -p wright-cli --all-targets -D warningsand the three test targets pass. Fullcargo test -p wright-cliwas not run by me.
Unconfirmed: at review time CI still had Rust (stable) / Quality, Product integration and some dist-validation jobs pending.
The tests validate local schemas only. Drop the HTTP resolver and TLS stack from the lockfile.
Teakowa
left a comment
There was a problem hiding this comment.
Approve (round 2). The blocker is fixed.
- Diff:
e897d6bfchanges onlycrates/wright-cli/Cargo.toml(default-features = false) andCargo.lock(+3/−263). - Dependency footprint:
aws-lc-sysandcmakeare gone fromCargo.lock.reqwestremains once, as onmain, andcargo tree -ishows it does not come fromjsonschema. The lock has nocmakeentry, so the build needs no C toolchain for TLS. - Tests: locally,
agent_contract(13),agent_contract_vocabulary(2) anddiagnostics_schema(1) pass.cargo fmt --checkandclippy -p wright-cli --all-targets -D warningsare clean. - Mutation: with a required
zzzadded toEditRangein the agent schema and to the check schema,agent_contractanddiagnostics_schemaboth fail. Invalid instances are still rejected.
Not confirmed: PR CI (including Quality, Build dist and Product integration) was still pending at review time. I ran the three jsonschema test targets, not the full cargo test -p wright-cli.
Add four classes: unconditional async writes (#829/#863, escalated as wright#868), Connection: close dropping pipelined requests (#827→#864), E2E asserting before awaited state (#829→#863/#865), and dependency-bump footprint growth (#866). Co-authored-by: Teakowa <27560638+Teakowa@users.noreply.github.com>
Supersedes #469 (not closed here). That branch was conflicted and did not port
agent_contract_vocabulary.rs.Change
jsonschema0.18 → 0.58 (resolves to 0.58.6); used only inwright-clitests.JSONSchema::compile→validator_for;validate→iter_errors. No assertions removed.Strictness comparison
draft202012feature by default, so the$schema: .../2020-12/schemain both schemas was unrecognised and the validator fell back to Draft 7. 0.58 honours 2020-12.prefixItems,unevaluated*,dependent*,$dynamicRef, arrayitems). Their$refsiblings are onlydescription, so Draft 7 vs 2020-12 sibling handling does not change results.formatkeyword is used as an assertion, so format-assertion defaults do not apply.Verification
cargo fmt --check,cargo clippy -p wright-cli --all-targets -- -D warnings,cargo test -p wright-cli: all pass.