WIP: Extension validation for the YANG module versioning work#2446
Open
xorrkaz wants to merge 8 commits intoCESNET:masterfrom
Open
WIP: Extension validation for the YANG module versioning work#2446xorrkaz wants to merge 8 commits intoCESNET:masterfrom
xorrkaz wants to merge 8 commits intoCESNET:masterfrom
Conversation
Add the ietf-yang-semver and ietf-yang-revisions YANG modules along with their generated header files and test module copies. - ietf-yang-semver@2025-09-29: Defines version and recommended-min-version extensions - ietf-yang-revisions@2025-01-28: Defines non-backwards-compatible and recommended-min-date extensions
Add validation plugins for ietf-yang-semver and ietf-yang-revisions extensions: yang_semver.c: - Implements validation for ysv:version extension * Validates MAJOR.MINOR.PATCH format with optional modifiers * Ensures version uniqueness across module revisions * Checks for duplicate versions in same revision - Implements validation for ysv:recommended-min-version extension * Validates strict MAJOR.MINOR.PATCH format (no modifiers) * Ensures correct placement in import statements * Prevents duplicate declarations yang_revisions.c: - Implements validation for rev:non-backwards-compatible extension * Validates placement in revision statements * Prevents duplicate declarations - Implements validation for rev:recommended-min-date extension * Validates YYYY-MM-DD date format * Ensures correct placement in import statements * Prevents duplicate declarations
- Add external declarations for plugins_yang_semver and plugins_yang_revisions - Register both plugin sets during library initialization - Add source files to build system (CMakeLists.txt)
Split tests into separate modules for ietf-yang-semver and ietf-yang-revisions extensions: test_yang_semver.c: - Tests for ysv:version extension * Valid formats (basic, with modifiers, pre-release, metadata) * Invalid formats (wrong placement, malformed versions) * Version uniqueness across revisions - Tests for ysv:recommended-min-version extension * Valid MAJOR.MINOR.PATCH format * Invalid formats (with modifiers, pre-release) * Duplicate prevention test_yang_revisions.c: - Tests for rev:non-backwards-compatible extension * Valid usage in revision statements * Invalid placement and duplicates - Tests for rev:recommended-min-date extension * Valid date formats (YYYY-MM-DD) * Invalid date formats * Duplicate prevention Update CMakeLists.txt to register both test suites.
Add ietf-yang-semver and ietf-yang-revisions to the internal modules list so they are automatically available in all contexts. - Update context.c to include generated headers and module registrations - Update test_context.c to reflect new module count in test assertions
Member
|
It seems you have understood the code perfectly and I see no major issues, just some minor ones. Not sure what additional changes you have in mind but I have way too much work at least until the IETF so I am not able to help. It also seems that the CI is broken but that is likely just some minor issue. |
This is an attempt to fix some out-of-bounds issues.
Author
|
I think I licked the CI problem. Can you re-run the PR? And thanks for the quick look. |
Member
|
Yes, it works now, only some formatting issue left. I can fix that, if you want. |
Author
|
Should be all fixed. Give it another shot. I do want to give this some time to bake, though. I want more IETFers to look at it, and the YANG modules may rev prior to an RFC number being issued. |
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.
This is a WIP PR. An early review would be appreciated, but I want to see if others can bang on the code a bit, too.