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

openconfig / ygot / 40428056531
89%
master: 89%

Build:
Build:
LAST BUILD BRANCH: robjs-optimise-orderedmap-walk
DEFAULT BRANCH: master
Ran 27 Oct 2026 12:44AM 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

27 Oct 2026 12:41AM UTC coverage: 88.777% (+0.002%) from 88.775%
40428056531

Pull #1116

github

robshakir
ygot: handle GoOrderedMap fields in PruneEmptyBranches

TLDR: ygot.PruneEmptyBranches previously treated GoOrderedMap pointers as
regular GoStruct pointers and panicked on their unexported fields. This change
handles GoOrderedMap fields explicitly so PruneEmptyBranches removes empty
ordered maps and recurses safely into populated entries.

Problem Statement:
- Generated YANG ordered-by user lists implement ygot.GoOrderedMap on a struct
  pointer that holds unexported keys and valueMap fields.
- In ygot/struct_validation_map.go, pruneBranchesInternal checked
  util.IsTypeStructPtr before checking GoOrderedMap.
- When a GoOrderedMap field held entries -- or retained empty slices after
  Delete -- pruneBranchesInternal recursed into the struct.
- pruneBranchesInternal then called reflect.Value.Interface on unexported
  fields and panicked at runtime.

Proposed Solution:
- Check GoOrderedMap in pruneBranchesInternal before the regular struct pointer
  branch in ygot/struct_validation_map.go.
- Skip nil GoOrderedMap fields without changing allChildrenPruned.
- Set empty GoOrderedMap fields (Len() == 0) to nil so pruneBranchesInternal
  also removes empty parent containers.
- Set allChildrenPruned = false for non-empty GoOrderedMap fields and iterate
  their entries with yreflect.RangeOrderedMap to prune empty child branches.
- Add TestPruneEmptyBranchesOrderedMap in
  ygot/struct_validation_map_exported_test.go to test nil, empty, deleted,
  nested, compressed, and uncompressed GoOrderedMap cases.
Pull Request #1116: ygot: handle GoOrderedMap fields in PruneEmptyBranches

19 of 21 new or added lines in 1 file covered. (90.48%)

14167 of 15958 relevant lines covered (88.78%)

1522.01 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
94.26
-0.12% ygot/struct_validation_map.go
Jobs
ID Job ID Ran Files Coverage
1 40428056531.1 27 Oct 2026 12:44AM UTC 85
88.78
GitHub Action Run
Source Files on build 40428056531
  • Tree
  • List 85
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1116
  • 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