[action] [PR:21907] sonic-yang-mgmt: uses clause with leaf-list, choice not honored#1731
Merged
mssonicbld merged 1 commit intoAzure:202412from Oct 18, 2025
Merged
Conversation
#### Why I did it When a uses clause imports a grouping, it was only processing leaf entries and ignoring leaf-list and choice clauses. That means that for instance in bgp route maps, route_map_in and route_map_out validations would fail. Honoring the uses `refine` clause is now also honored which is depended upon in sonic-utilities. This now precompiles the uses clause and integrates it as if the uses clause was not part of the schema as multiple end users were having to do this additional processing. This fixes that behavior and adds test cases to ensure it doesn't regress in the future. This is the proper fix, replacing #21078 that just worked around it. Removal of `uses` logic in sonic-utilities here: sonic-net/sonic-utilities#3814 Fixes sonic-net/sonic-buildimage#22382 ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Added leaf-list lookup. #### How to verify it See test cases pass #### Which release branch to backport (provide reason below if selected) - [X] 202405 - [X] 202411 #### Tested branch (Please provide the tested image version) master as of 20250304 #### Description for the changelog sonic-yang-mgmt: uses clause with leaf-list, choice not honored #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Brad House (@bradh352)
Collaborator
Author
|
Original PR: sonic-net/sonic-buildimage#21907 |
Collaborator
Author
|
/azp run |
Merged
2 tasks
|
Azure Pipelines successfully started running 1 pipeline(s). |
r12f
pushed a commit
that referenced
this pull request
Dec 17, 2025
…ce not honored (#1731) #### Why I did it When a uses clause imports a grouping, it was only processing leaf entries and ignoring leaf-list and choice clauses. That means that for instance in bgp route maps, route_map_in and route_map_out validations would fail. Honoring the uses `refine` clause is now also honored which is depended upon in sonic-utilities. This now precompiles the uses clause and integrates it as if the uses clause was not part of the schema as multiple end users were having to do this additional processing. This fixes that behavior and adds test cases to ensure it doesn't regress in the future. This is the proper fix, replacing #21078 that just worked around it. Removal of `uses` logic in sonic-utilities here: sonic-net/sonic-utilities#3814 Fixes sonic-net/sonic-buildimage#22382 ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Added leaf-list lookup. #### How to verify it See test cases pass #### Which release branch to backport (provide reason below if selected) - [X] 202405 - [X] 202411 #### Tested branch (Please provide the tested image version) master as of 20250304 #### Description for the changelog sonic-yang-mgmt: uses clause with leaf-list, choice not honored #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Brad House (@bradh352)
liushilongbuaa
pushed a commit
that referenced
this pull request
Mar 25, 2026
…tically (#24935) #### Why I did it src/sonic-sairedis ``` * f16b22aa - (HEAD -> master, origin/master, origin/HEAD) Fix sonic-vpp build issue in master (#1731) (50 minutes ago) [yue-fred-gao] ``` #### How I did it #### How to verify it #### Description for the changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
When a uses clause imports a grouping, it was only processing leaf entries and ignoring leaf-list and choice clauses. That means that for instance in bgp route maps, route_map_in and route_map_out validations would fail.
Honoring the uses
refineclause is now also honored which is depended upon in sonic-utilities.This now precompiles the uses clause and integrates it as if the uses clause was not part of the schema as multiple end users were having to do this additional processing.
This fixes that behavior and adds test cases to ensure it doesn't regress in the future.
This is the proper fix, replacing #21078 that just worked around it.
Removal of
useslogic in sonic-utilities here: sonic-net/sonic-utilities#3814Fixes sonic-net/sonic-buildimage#22382
Work item tracking
How I did it
Added leaf-list lookup.
How to verify it
See test cases pass
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
master as of 20250304
Description for the changelog
sonic-yang-mgmt: uses clause with leaf-list, choice not honored
Link to config_db schema for YANG module changes
N/A
A picture of a cute animal (not mandatory but encouraged)
Signed-off-by: Brad House (@bradh352)