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

openconfig / ygot / 40146802462
89%

Build:
DEFAULT BRANCH: master
Ran 25 Oct 2026 12:31AM 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

23 Oct 2026 11:22AM UTC coverage: 88.756% (-0.002%) from 88.758%
40146802462

push

github

web-flow
ytypes: refactor retrieveNodeList and optimise concrete list lookups to O(1) (#1112)

* ytypes: refactor retrieveNodeList and optimize concrete list lookups to O(1)

Proposed alternative implementation to #1111 addressing review comments in https://github.com/openconfig/ygot/pull/1111#pullrequestreview-5582738295:

* **`ytypes/node.go`**:
  - Split `retrieveNodeList` into upfront validity checks and a `switch` via `isWildcardListQuery` dispatching to `retrieveNodeListWildcard` vs. `retrieveNodeListConcrete`.
  - Handle `rv.Len() == 0` upfront in both `retrieveNodeListConcrete` (inserting directly via `insertAndRetrieveNodeList` when `args.modifyRoot` is set, and returning `nil, nil` otherwise) and `retrieveNodeListWildcard`.
  - Replace the chained `else if rv.Len() > 0` with an explicit `switch` on `listKeyT` (`util.IsTypeStruct`, `util.IsTypeInterface`, `default`).
  - Handle `StringToType` errors immediately at the call site by returning `codes.InvalidArgument`, rather than ignoring `err != nil` and falling through to full-map iteration.
  - Extend $O(1)$ `rv.MapIndex` lookup to concrete multi-keyed lists (`retrieveNodeListConcreteStructKey`) in addition to single-keyed lists.
  - Deduplicate list-element delete/prune and insert-and-recurse logic into `retrieveNodeListElem`, `insertAndRetrieveNodeList`, and `structKeyFields`.
* **`ytypes/util_types.go`**:
  - Extend `StringToType` to handle `reflect.Float64` (`decimal64` keys, rejecting non-finite `NaN`/`Inf`) and `.Convert(t)` on `reflect.String` and `reflect.Bool` (for defined types such as `YANGEmpty`).
* **`ytypes/node_test.go`, `ytypes/util_test.go`**:
  - Add unit tests covering `StringToType`, concrete/wildcard single-key and multi-key lookups, `decimal64` and wrapper-union keys, immediate `InvalidArgument` errors on malformed keys, `GetOrCreateNode` on union-keyed lists, and batch-delete transitory states.
  - Add `SetNode` and `GetNode` benchmarks for single-keyed and multi-keyed lists (`n... (continued)

213 of 235 new or added lines in 2 files covered. (90.64%)

9 existing lines in 3 files now uncovered.

14137 of 15928 relevant lines covered (88.76%)

1524.63 hits per line

Uncovered Changes

Lines Coverage ∆ File
22
86.75
0.27% ytypes/node.go

Coverage Regressions

Lines Coverage ∆ File
5
86.75
0.27% ytypes/node.go
2
97.99
0.0% util/gnmi.go
2
90.29
-0.49% ytypes/list.go
Jobs
ID Job ID Ran Files Coverage
1 40146802462.1 25 Oct 2026 12:31AM UTC 85
88.76
GitHub Action Run
Source Files on build 40146802462
  • Tree
  • List 85
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2e0c6790 on github
  • Prev Build on master (#35802038727)
  • Next Build on master (#40249427686)
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