-
Notifications
You must be signed in to change notification settings - Fork 313
[strict yang] Add YANG based cfg_schema.h to schema.h #1008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/azp run |
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
/azp run |
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…-net#1052) This PR is a partial duplicate of sonic-net/sonic-dash-ha#84 Since crates/swss-common will be moved in this repo. why During investigating issue sonic-net#75, I created test case to verify zmq behaviour in handling no connection and connection loss. It is found that with the current swss-common zmq implementation with below attributes, we don't need to handle reconnect explicitly. PUSH/PULL model ZMQ_IMMEDIATE = 0 (default) ZMQ_SNDHWM = 10000 what this PR does add unit test for zmq late connect and reconnect for regression remove unneeded code for falling back to ProducerStateTable in test environment since zmq client won't fail if zmq server is not connected. update test_utils/README.md with missing argument to start redis in test environment
Moving SonicDbTable to sonic-dash-ha as part of sonic-net/sonic-dash-ha#82
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables YANG-based configuration table generation by introducing an automated script to generate CFG_* macro definitions from YANG models. The changes integrate the generation of cfg_schema.h
into the build process and update the schema to use this dynamically generated header instead of hardcoded table definitions.
- Adds
gen_cfg_schema.py
script that dynamically generates CFG_* table macros from YANG models - Integrates the generation into the build system through Makefile changes and CI pipeline updates
- Replaces hardcoded CFG_* table definitions in
schema.h
with inclusion of the generatedcfg_schema.h
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
gen_cfg_schema.py | New Python script that extracts table names from YANG models and generates CFG_* macro definitions |
tests/test_gen_cfg_schema.py | Unit tests for the schema generation script |
common/Makefile.am | Build system integration to generate cfg_schema.h before compilation |
common/schema.h | Replaces hardcoded CFG_* macros with include of generated cfg_schema.h |
pyext/swsscommon.i | Adds cfg_schema.h to SWIG interface for Python bindings |
azure-pipelines.yml | Updates CI to install YANG dependencies for schema generation |
.azure-pipelines/*.yml | Additional CI updates for YANG package installation |
Comments suppressed due to low confidence (1)
tests/test_gen_cfg_schema.py:46
- The test only covers the case where a key contains a hyphen, but doesn't test other potentially invalid characters for C macro names (e.g., spaces, dots, special symbols). Consider adding test cases for other invalid characters that could appear in YANG model names.
# Check that memory-usage is commented out due to hyphen
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@wen587 , I tried to update swss-common submodule in sonic-buildimage with PR sonic-net/sonic-buildimage#23687. There is a compilation error
Is there another dependent submodule that I need to add to sonic-buildimage? |
Hi @yue-fred-gao , no . Investigating the compliation issue. |
Hi @yue-fred-gao , pr reverted. Please go ahead update your submodule. |
Thanks for the quick solution! |
…sonic-net#1008)" (sonic-net#1067)" This reverts commit dc05565.
Comparing to #1008, change to PYTHON3 for buster build failure. Improve the dynamic debian_version as an argument instead of static bookworm. Why I did it To enable YANG based CFG table generation, the ConfigDB related macro will be generated by YANG model How I did it Add gen_cfg_schema.py script to generate cfg_schema.h which will be included in schema.h Work item tracking Microsoft ADO: 31676863 How to verify it make deb build
Why I did it
To enable YANG based CFG table generation, the ConfigDB related macro will be generated by YANG model
How I did it
Add gen_cfg_schema.py script to generate cfg_schema.h which will be included in schema.h
Work item tracking
How to verify it
make deb build
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)