• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openconfig / ygot / 40422617514
89%
master: 89%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/shogo82148/actions-goveralls-1.11.5
DEFAULT BRANCH: master
Ran 26 Oct 2026 11:54PM UTC
Jobs 1
Files 85
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Oct 2026 11:51PM UTC coverage: 88.302% (-0.5%) from 88.775%
40422617514

Pull #1115

github

robshakir
ygot, ytypes: remove repeated JSON normalisation and debug allocations

`ygot` previously ran repeated JSON round-trips during RFC7951 rendering and
formatted debug strings when debug logging was off. This change removes those
redundant operations whilst preserving identical JSON output and Go types.

JSON rendering (`ygot/render.go`, `ygot/struct_validation_map.go`):
- Remove `normalizeJSONValue` calls from `structJSON` and `jsonValue`.
- Add `normalizeScalars` to `jsonOutputConfig` and `makeJSON`.
- Convert scalar values directly in `writeIETFScalarJSON` when
  `normalizeScalars` is `true` (`ConstructIETFJSON` and `MergeStructJSON`).
- Leave `normalizeScalars` set to `false` when callers serialise directly to
  JSON bytes (`Marshal7951`, `EncodeTypedValue`, and `EmitJSON`).
- Skip `nil` map, slice, pointer, and interface fields at the start of
  `structJSON` before parsing struct tags.
- Pre-size output slices in `leaflistToSlice`, `mapValuePairsToJSON`,
  `mapJSON`, `jsonSlice`, and `jsonAnnotationSlice`.

Debug logging (`util/debug.go`, `util/reflect.go`, `ytypes/*.go`):
- Add `IsDebugLibraryEnabled` and `IsDebugSchemaEnabled` helpers in
  `util/debug.go`.
- Check `debugLibrary` in `util.DbgErr` before concatenating error strings.
- Guard `DbgPrint` and `DbgSchema` calls that allocate arguments -- such as
  `pretty.Sprint` and `Schema.Path` -- when debug logging is disabled.

Tests (`util/debug_test.go`, `ytypes/unmarshal_test.go`, `ygot/render_test.go`):
- Add `ConstructIETFJSON` type-parity tests in `ygot/render_test.go`.
- Add `5%` allocation regression tests and benchmarks in `util`, `ytypes`, and
  `ygot`.
Pull Request #1115: ygot, ytypes: remove repeated JSON normalisation and debug allocations

138 of 220 new or added lines in 10 files covered. (62.73%)

12 existing lines in 2 files now uncovered.

14199 of 16080 relevant lines covered (88.3%)

1678.3 hits per line

Uncovered Changes

Lines Coverage ∆ File
35
87.75
-2.12% ygot/render.go
13
82.49
-2.81% util/reflect.go
7
85.23
-1.23% ytypes/leaf.go
7
85.75
-1.96% ytypes/leafref.go
6
86.59
-3.18% ytypes/container.go
6
88.97
-1.32% ytypes/list.go
4
91.41
-3.04% ytypes/int_type.go
4
90.67
-1.68% ytypes/util_schema.go

Coverage Regressions

Lines Coverage ∆ File
6
82.49
-2.81% util/reflect.go
6
87.75
-2.12% ygot/render.go
Jobs
ID Job ID Ran Files Coverage
1 40422617514.1 26 Oct 2026 11:54PM UTC 85
88.3
GitHub Action Run
Source Files on build 40422617514
  • Tree
  • List 85
  • Changed 10
  • Source Changed 0
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1115
  • PR Base - master (#40419440996)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc