Repository navigation
[fix] reject malformed schema JSON before caching (LET-34) - #193
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (b8e0c8f) 8437 8024 95.10% Head commit (3bb73c5) 8441 (+4) 8028 (+4) 95.11% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#193) 6 6 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #193 +/- ##
=======================================
Coverage 93.98% 93.98%
=======================================
Files 53 53
Lines 6752 6755 +3
=======================================
+ Hits 6346 6349 +3
Misses 258 258
Partials 148 148 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
03cc912 to
f0ca33c
Compare
Reject ignored trailing schema tokens before compilation and caching while preserving resource-parser errors. Reuse the owned schema bytes for the standard JSON check and retain the existing data-document boundary guard. Cover malformed tails, including a second null value, native/byte inputs, cache isolation, legal whitespace and existing validation outcomes.
3174257 to
3bb73c5
Compare
Malformed schema text, including
{} nulland trailing closing delimiters, could pass the pinned parser and become a cached schema. Preserve the original parser error order, then use the standard library to check the complete caller-owned JSON bytes before compilation or caching. No new parser, cache, dependency, public API, interpreter pin or Go-floor change.Fresh current-master baseline/candidate build, race tests twice, vet and coverage pass on Go 1.27.3 and Go 1.19.13: all three new statements are covered, with no old covered blocks lost. The full 80-configuration consumer comparison passes (76 active, four archived diagnostics), with 40 exact profiles and classified skips/no-test packages. Four fresh CLI binaries pass eight public examples and the expected old-error/new-success schema boundary checks. Independent source and artifact reviews pass; final-head required/reported checks, both Codecov contexts and checks-watch pass.
On cache misses, complete JSON validation adds a scan proportional to schema text; cache hits skip this scan. Original representative timings remain dispersed, including floor ColdLarge paired median +32.02% (about 23.6 microseconds); other paths also varied. This necessary safety cost is accepted under the current safety-first direction, without a zero-overhead or equivalence claim. The implementation and benchmark bodies match the measured version; no new timing samples were added. Tracks LET-34. No tags, releases or auto-merge.