You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SONiC ConfigDB validator (osism/tasks/conductor/sonic/validator.py) generates Pydantic schemas from the YANG models shipped in files/sonic/yang_models/. That directory currently mirrors the Community SONiC YANG tree (sonic-net/sonic-buildimage/src/sonic-yang-models/yang-models).
When validating real configs, the validator emits warnings of the form:
[WARN] xxxxxx: No YANG schema for table 'SNMP_SERVER_USER' (validation skipped)
for 26 ConfigDB tables. Per the design in #2253, these are reported as warnings (not errors), but they leave a real coverage gap: rows in those tables are never schema-checked.
Why those tables are missing
The 26 tables fall into three groups:
1. Modeled in Enterprise SONiC (Broadcom/Dell), not in Community.
The Enterprise SONiC YANG tree (mirrored e.g. in oceans1908/dell-yang-model and oceans1908/sonic-yang) ships top-level container declarations for these tables in dedicated sonic-*.yang files that have no Community counterpart:
sonic-snmp.yang (Enterprise variant — distinct from the Community file of the same name, which only models SNMP/SNMP_COMMUNITY/SNMP_USER/SNMP_AGENT_ADDRESS_CONFIG)
BGP_GLOBALS_ROUTE_ADVERTISE — only appears as a sonic-ext:table-name annotation on an OpenConfig path (oc-bgp-evpn-ext:route-advertise-list) in openconfig-network-instance-annot.yang. There is no native sonic-* YANG container for this ConfigDB table.
3. Not modeled anywhere we found.
HOST_FEATURE — neither Community nor Enterprise trees contain a container declaration for this table. Likely a newer or internal addition.
Proposed approach
1. Vendor the missing Enterprise SONiC YANG files into files/sonic/yang_models/.
Add the 9 distinct Enterprise YANGs listed above. The Enterprise sonic-snmp.yang collides on filename with the Community version — rename one (e.g. sonic-snmp-server.yang for the Enterprise variant) or merge the containers, and document the choice in tools/sonic_yang_to_pydantic.py.
Source of truth: pick a single upstream reference (e.g. a tagged Broadcom EnterpriseSONiC release or the most recent oceans1908/dell-yang-model snapshot) and record commit / version in a files/sonic/yang_models/SOURCES.md so future refreshes are reproducible.
2. Verify the generator handles them.
tools/sonic_yang_to_pydantic.py should pick up the new files automatically. Re-run it and commit the regenerated osism/tasks/conductor/sonic/_generated/_schemas.py. Sanity-check that no new YANG construct (grouping, typedef, augment) trips the generator — if it does, extend the generator before vendoring.
3. Confirm the validator now covers the warned tables.
Re-run the validator against the config that produced the warnings above and confirm the 24 entries disappear from the warning list and become real schema checks (passing or failing on actual content).
4. Document the two residual gaps.
For HOST_FEATURE and BGP_GLOBALS_ROUTE_ADVERTISE, keep the warning behavior and add a brief note (in the validator docstring or the SOURCES.md) explaining there is no upstream YANG to vendor.
Acceptance criteria
The 9 Enterprise SONiC YANG files (or merged equivalents) are committed under files/sonic/yang_models/.
The source / version of the vendored Enterprise YANGs is recorded in a tracked file.
tools/sonic_yang_to_pydantic.py regenerates _schemas.py cleanly with the expanded set.
Validating a real config no longer warns for the 24 tables in group 1; only HOST_FEATURE and BGP_GLOBALS_ROUTE_ADVERTISE remain as No YANG schema warnings.
No regression on existing schema-level checks for tables already covered by the Community YANGs.
Out of scope
Authoring custom YANG for HOST_FEATURE / BGP_GLOBALS_ROUTE_ADVERTISE (would diverge from upstream).
Reconciling differences where Community and Enterprise model the same table differently (e.g. SNMP-related tables): the goal here is additive coverage, not replacement.
Background
The SONiC ConfigDB validator (
osism/tasks/conductor/sonic/validator.py) generates Pydantic schemas from the YANG models shipped infiles/sonic/yang_models/. That directory currently mirrors the Community SONiC YANG tree (sonic-net/sonic-buildimage/src/sonic-yang-models/yang-models).When validating real configs, the validator emits warnings of the form:
for 26 ConfigDB tables. Per the design in #2253, these are reported as warnings (not errors), but they leave a real coverage gap: rows in those tables are never schema-checked.
Why those tables are missing
The 26 tables fall into three groups:
1. Modeled in Enterprise SONiC (Broadcom/Dell), not in Community.
The Enterprise SONiC YANG tree (mirrored e.g. in
oceans1908/dell-yang-modelandoceans1908/sonic-yang) ships top-levelcontainerdeclarations for these tables in dedicatedsonic-*.yangfiles that have no Community counterpart:SWITCH(top-level)sonic-switch.yangCOREDUMPsonic-coredump.yangHARDWAREsonic-hardware.yangLOOPBACK(separate fromLOOPBACK_INTERFACE)sonic-loopback.yangSNMP_SERVER,SNMP_SERVER_USER,SNMP_SERVER_VIEW,SNMP_SERVER_GROUP,SNMP_SERVER_PARAMS,SNMP_SERVER_TARGET,SNMP_SERVER_GROUP_USER,SNMP_SERVER_GROUP_ACCESS,SNMP_SERVER_GROUP_MEMBER,SNMP_SERVER_GROUP_PARAMS,SNMP_SERVER_GROUP_TARGETsonic-snmp.yang(Enterprise variant — distinct from the Community file of the same name, which only modelsSNMP/SNMP_COMMUNITY/SNMP_USER/SNMP_AGENT_ADDRESS_CONFIG)SSHD_COMMONsonic-ssh-common.yangNEIGH_GLOBALsonic-neighbor.yangPOLICY_TABLE,POLICY_BINDING_TABLE,POLICY_SECTIONS_TABLE,CLASSIFIER_TABLEsonic-flow-based-services.yangBREAKOUT_PORTSsonic-port-breakout.yang(Community ships onlyBREAKOUT_CFG)ECMP_LOADSHARE_TABLE_IPV4,ECMP_LOADSHARE_TABLE_IPV6sonic-loadshare-mode.yang(also models_SEED/_RH/_OFFSET/_INGRESS_PORT/_ROCE/_UDF)That's 24 of the 26 warnings.
2. No native
sonic-*container in any tree.BGP_GLOBALS_ROUTE_ADVERTISE— only appears as asonic-ext:table-nameannotation on an OpenConfig path (oc-bgp-evpn-ext:route-advertise-list) inopenconfig-network-instance-annot.yang. There is no nativesonic-*YANG container for this ConfigDB table.3. Not modeled anywhere we found.
HOST_FEATURE— neither Community nor Enterprise trees contain a container declaration for this table. Likely a newer or internal addition.Proposed approach
1. Vendor the missing Enterprise SONiC YANG files into
files/sonic/yang_models/.Add the 9 distinct Enterprise YANGs listed above. The Enterprise
sonic-snmp.yangcollides on filename with the Community version — rename one (e.g.sonic-snmp-server.yangfor the Enterprise variant) or merge the containers, and document the choice intools/sonic_yang_to_pydantic.py.Source of truth: pick a single upstream reference (e.g. a tagged Broadcom EnterpriseSONiC release or the most recent
oceans1908/dell-yang-modelsnapshot) and record commit / version in afiles/sonic/yang_models/SOURCES.mdso future refreshes are reproducible.2. Verify the generator handles them.
tools/sonic_yang_to_pydantic.pyshould pick up the new files automatically. Re-run it and commit the regeneratedosism/tasks/conductor/sonic/_generated/_schemas.py. Sanity-check that no new YANG construct (grouping, typedef, augment) trips the generator — if it does, extend the generator before vendoring.3. Confirm the validator now covers the warned tables.
Re-run the validator against the config that produced the warnings above and confirm the 24 entries disappear from the warning list and become real schema checks (passing or failing on actual content).
4. Document the two residual gaps.
For
HOST_FEATUREandBGP_GLOBALS_ROUTE_ADVERTISE, keep the warning behavior and add a brief note (in the validator docstring or theSOURCES.md) explaining there is no upstream YANG to vendor.Acceptance criteria
files/sonic/yang_models/.tools/sonic_yang_to_pydantic.pyregenerates_schemas.pycleanly with the expanded set.HOST_FEATUREandBGP_GLOBALS_ROUTE_ADVERTISEremain asNo YANG schemawarnings.Out of scope
HOST_FEATURE/BGP_GLOBALS_ROUTE_ADVERTISE(would diverge from upstream).SNMP-related tables): the goal here is additive coverage, not replacement.References
tools/sonic_yang_to_pydantic.pyosism/tasks/conductor/sonic/validator.pyosism/tasks/conductor/sonic/_generated/_schemas.pysonic-net/sonic-buildimage/src/sonic-yang-models/yang-modelsoceans1908/dell-yang-model,oceans1908/sonic-yang