Skip to content

[action] [PR:21907] sonic-yang-mgmt: uses clause with leaf-list, choice not honored#1731

Merged
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/21907
Oct 18, 2025
Merged

[action] [PR:21907] sonic-yang-mgmt: uses clause with leaf-list, choice not honored#1731
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/21907

Conversation

@mssonicbld
Copy link
Collaborator

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)

  • 202405
  • 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)

#### 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)
@mssonicbld
Copy link
Collaborator Author

Original PR: sonic-net/sonic-buildimage#21907

@mssonicbld
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 46ac1f5 into Azure:202412 Oct 18, 2025
17 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant