[code sync] Merge code from sonic-net/sonic-buildimage:202605 to 202608#2679
Open
mssonicbld wants to merge 7 commits into
Open
[code sync] Merge code from sonic-net/sonic-buildimage:202605 to 202608#2679mssonicbld wants to merge 7 commits into
mssonicbld wants to merge 7 commits into
Conversation
mssonicbld
commented
Jul 15, 2026
Collaborator
…g3 accepts empty pattern-constrained leaf-lists (#28308) #### Why I did it `config apply-patch`, `config replace` and `config rollback` fail on master for any configuration that contains an empty pattern-constrained leaf-list. `BGP_ALLOWED_PREFIXES` is the common trigger, because a deployment often populates only `prefixes_v4` or only `prefixes_v6`, leaving the other leaf-list empty. An empty leaf-list is stored in CONFIG DB as `field@ = ""`. The Python `ConfigDBConnector` deserialises that empty string into a single empty-string element (`['']`), which is the CONFIG DB representation of "no elements", not a real element. Before the libyang1 to libyang3 port ([#26584](sonic-net/sonic-buildimage#26584)) the `''` sentinel was tolerated by the validation library. libyang3 validates the `''` element against the leaf type's pattern (for example the ipv4-prefix pattern of `BGP_ALLOWED_PREFIXES.prefixes_v4`) and rejects the whole config: Unsatisfied pattern - "" does not conform to "(([0-9]| ... )/(([0-9])|([1-2][0-9])|(3[0-2]))( (le|ge) ...)?" Data path: .../BGP_ALLOWED_PREFIXES_LIST[deployment='DEPLOYMENT_ID'][id='0']/prefixes_v4 This is a read-side (config-to-YANG validation) regression. [#26584](sonic-net/sonic-buildimage#26584) did add a guard for the sibling case of an empty leaf-list that has a schema `default ""`, but missed the pattern-typed, no-default leaf-list case (`['']`), which is exactly `BGP_ALLOWED_PREFIXES`. This fixes the read-side regression behind sonic-mgmt test `generic_config_updater/test_bgp_prefix.py` (tracked by [sonic-mgmt issue 25549](sonic-net/sonic-mgmt#25549)). It is complementary to, and does not replace, the separate write-side effort that avoids writing `prefixes_v4@ = ""` into CONFIG DB in the first place ([sonic-buildimage issue 27818](sonic-net/sonic-buildimage#27818), [sonic-utilities PR 4478](sonic-net/sonic-utilities#4478)). Even with that write-side fix, existing configs and other tables can still present an empty leaf-list, so the validation layer should accept it. ##### Work item tracking - Microsoft ADO **(number only)**: 38183186 #### How I did it In the CONFIG DB to YANG translation in `src/sonic-yang-mgmt/sonic_yang_ext.py` (the leaf-list branch of `_findYangTypedValue`), drop the empty-string sentinel so an empty leaf-list is represented as an empty list `[]`, which libyang3 accepts. The drop is gated on the leaf-list having no schema default (`not list(leaf.defaults())`), so the existing empty-with-default handling introduced by [#26584](sonic-net/sonic-buildimage#26584) is left byte-for-byte unchanged. Added a regression unit test (`test_empty_leaflist_collapses_to_empty`) that loads `BGP_ALLOWED_PREFIXES` with an empty `prefixes_v4` leaf-list and asserts the config validates and the leaf-list collapses to `[]`. #### How to verify it Unit test (sonic-yang-mgmt suite): with the fix the new test passes and the full suite is green; reverting only the two changed lines makes just `test_empty_leaflist_collapses_to_empty` fail with the `Unsatisfied pattern - ""` error above. End-to-end on a KVM t1 testbed (`vms-kvm-t1-lag`), baseline master image built after [#26584](sonic-net/sonic-buildimage#26584) (so it carries the regression), matched before/after with only `sonic_yang_ext.py` swapped: | DUT state | `generic_config_updater/test_bgp_prefix.py::test_bgp_prefix_tc1_suite` | |---|---| | before (unpatched baseline) | 2 failed, 2 errors — `config apply-patch` returns non-zero, teardown `config rollback failed` | | after (fix applied) | 2 passed | Also verified the mechanism directly: with `BGP_ALLOWED_PREFIXES|DEPLOYMENT_ID|0` holding `prefixes_v4@ = ""`, a subsequent valid `config apply-patch` fails with the `Unsatisfied pattern - ""` error before the fix and succeeds after it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 #### Tested branch (Please provide the tested image version) - [x] master — `SONiC.master.1145536-931dbfb70` (build 2026-06-22) #### Description for the changelog [yang-mgmt] Treat an empty CONFIG DB leaf-list (`['']`) as empty so libyang3 does not reject empty pattern-constrained leaf-lists such as BGP_ALLOWED_PREFIXES. #### Link to config_db schema for YANG module changes No YANG model change. `BGP_ALLOWED_PREFIXES` schema: https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md#bgp_allowed_prefixes #### A picture of a cute animal (not mandatory but encouraged) 🦔 Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
… automatically (#28311) #### Why I did it src/sonic-platform-common ``` * 357115b - (HEAD -> 202605, origin/202605) add cpo bailly xcvr cmis (Azure#689) (6 days ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
… (#28350) #### Why I did it src/dhcpmon ``` * 9db5c0c - (HEAD -> 202605, origin/202605) [dhcp_devman] Ignore duplicate -i* arguments instead of crashing/leaking (Azure#86) (5 days ago) [mssonicbld] * 3ce9b8c - [dhcpmon] Log Relay-Forward / Relay-Reply counters in v6 status (Azure#85) (5 days ago) [mssonicbld] * 7bf209d - [dhcpmon] Cleanup stale v6 counters from COUNTERS_DB (Azure#84) (5 days ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
…atically (#28402) #### Why I did it src/sonic-utilities ``` * 351be6e8 - (HEAD -> 202605, origin/202605) fix GCU patch sorter crash on create-only field change referenced by a leaf-list (#4681) (17 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
…ions (#28285) <!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md CODE_OF_CONDUCT.md LICENSE README.md SECURITY.md SUPPORT.md azure-pipelines failure_prs.log scripts skip_prs.log Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> #### Why I did it The version-upgrade pipeline classifies a build artifact as arm (and thus freezes its package versions into arch-specific files via `-d` flag) by matching `arm64|armhf` in the artifact name. Nvidia-bluefield is an arm64 platform, but its artifact name carries no arch token, so it fell into the amd64 group and was frozen with `-a` flag (for_all_arch), putting its arm-resolved pip versions into the arch-independent common version files. This is how `pyroute2==0.9.6` leaked into `files/build/versions-public/build/build-sonic-slave-trixie/versions-py3`. The arm slaves have no Debian python3-pyroute2 and pip pulls the unpinned latest (0.9.6) when installing the sonic-utilities wheel, the pip installs the `pyroute2==0.9.6` based on the constraint in the versions-py3 file, but the RECORD-less Debian package cannot be uninstalled to satisfy the constraint. ``` Installing collected packages: www-authenticate, toposort, ipaddress, colorful, xmltodict, semantic-version, pyroute2, prettyprinter, lazy-object-proxy, jsonpatch, filelock, docker-image-py, click-log, docker, scp, sonic-utilities Attempting uninstall: pyroute2 Found existing installation: pyroute2 0.7.7 error: uninstall-no-record-file × Cannot uninstall pyroute2 0.7.7 ╰─> The package's contents are unknown: no RECORD file was found for pyroute2. hint: The package was installed by debian. You should check if it can uninstall the package. Failed to run the command with constraint, try to install with the original command ``` ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Match nvidia-bluefield alongside arm64/armhf so it is frozen with `-d` and its versions stay in the arch-specific files instead of the common ones. #### How to verify it <!-- If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012. --> #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com> #### A picture of a cute animal (not mandatory but encouraged)
…#28260) Add FRR patch 0115 to drop the erroneous route_unlock_node() in the zebra northbound oper-state RIB route iterator (lib_vrf_zebra_ribs_rib_route_ lookup_next). The node returned by lookup_next() seeds the get_next -> route_next() iteration, which unlocks its input; releasing the lock in lookup_next() under-runs the route_node lock to zero and aborts zebra (assertion node->lock > 0) during the post-restart RIB sweep, wedging vtysh and stalling bgpd. Backport of sonic-net/sonic-buildimage#28094 to 202605. Fixes: sonic-net/sonic-buildimage#27788 Signed-off-by: Deepak Singhal <deepsinghal@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
Author
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
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.