-
Notifications
You must be signed in to change notification settings - Fork 148
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
Validation Script for OC Path and RPC Coverage in READMEs #2865
Conversation
This file contains 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
* `mdocspec` package parses ocpath.proto and ocrpcs.proto from yaml according to the format shown below by mdocspec.Parse's documentation. * `tools/validate_readme_spec/validate_readme_spec.go` script is added that can parse and then validate OC Paths and RPCs according to existing repo states in github.com/openconfig. ```go // Parse extracts sorted OpenConfig Path and RPC Coverage from an FNT README. // // The first yaml code block after a heading line named exactly as // "OpenConfig Path and RPC Coverage" will be used. Any other code blocks are // ignored. // // Expected markdown format: // // ## OpenConfig Path and RPC Coverage // // ```yaml // paths: // /interfaces/interface/config/description: // /interfaces/interface/config/enabled: // /components/component/state/name: // platform_type: "CHASSIS" // // rpcs: // gnmi: // gNMI.Set: // union_replace: true // gNMI.Subscribe: // on_change: true // ``` // // Note: For `rpcs`, only the RPC name and methods are validated. Any // attributes defined below RPC methods (e.g. union_replace) are not validated. ```
Pull Request Test Coverage Report for Build 8606754992Details
💛 - Coveralls |
This validation routine is based on the template README style being defined in #2863 |
dplore
reviewed
Apr 5, 2024
Co-authored-by: Darren Loher <dloher@google.com>
* Skip repo-cloning during validation if repo already cloned. * Validate that at least one RPC method is specified for any coverage spec. * Add additional validation for script in bash file. * Style Improvements.
dplore
reviewed
Apr 8, 2024
dplore
previously approved these changes
Apr 8, 2024
@dplore Need another approval due to slight doc fix. |
dplore
approved these changes
Apr 8, 2024
frasieroh
pushed a commit
to aristanetworks/openconfig-featureprofiles
that referenced
this pull request
Apr 9, 2024
…#2865) * Add yaml spec for oc path/rpc to test-requirements-template * revise yaml * revise yaml * Validation Script for OC Path and RPC Coverage in READMEs * `mdocspec` package parses ocpath.proto and ocrpcs.proto from yaml according to the format shown below by mdocspec.Parse's documentation. * `tools/validate_readme_spec/validate_readme_spec.go` script is added that can parse and then validate OC Paths and RPCs according to existing repo states in github.com/openconfig. ```go // Parse extracts sorted OpenConfig Path and RPC Coverage from an FNT README. // // The first yaml code block after a heading line named exactly as // "OpenConfig Path and RPC Coverage" will be used. Any other code blocks are // ignored. // // Expected markdown format: // // ## OpenConfig Path and RPC Coverage // // ```yaml // paths: // /interfaces/interface/config/description: // /interfaces/interface/config/enabled: // /components/component/state/name: // platform_type: "CHASSIS" // // rpcs: // gnmi: // gNMI.Set: // union_replace: true // gNMI.Subscribe: // on_change: true // ``` // // Note: For `rpcs`, only the RPC name and methods are validated. Any // attributes defined below RPC methods (e.g. union_replace) are not validated. ``` * Add invalid README example * Fix style * Make YAMLRenderer unexported * Improve comments * Update tools/internal/mdocspec/ocspec.go Co-authored-by: Darren Loher <dloher@google.com> * Minor improvements for OC coverage validation * Skip repo-cloning during validation if repo already cloned. * Validate that at least one RPC method is specified for any coverage spec. * Add additional validation for script in bash file. * Style Improvements. * Improve logic by searching from header rather than YAML block * add another corner case test * add another corner case test * Improve doc comment * Improve doc comments * Fix doc comment --------- Co-authored-by: Darren Loher <dloher@google.com>
ANISH-GOTTAPU
pushed a commit
to open-traffic-generator/featureprofiles
that referenced
this pull request
Jul 10, 2024
…#2865) * Add yaml spec for oc path/rpc to test-requirements-template * revise yaml * revise yaml * Validation Script for OC Path and RPC Coverage in READMEs * `mdocspec` package parses ocpath.proto and ocrpcs.proto from yaml according to the format shown below by mdocspec.Parse's documentation. * `tools/validate_readme_spec/validate_readme_spec.go` script is added that can parse and then validate OC Paths and RPCs according to existing repo states in github.com/openconfig. ```go // Parse extracts sorted OpenConfig Path and RPC Coverage from an FNT README. // // The first yaml code block after a heading line named exactly as // "OpenConfig Path and RPC Coverage" will be used. Any other code blocks are // ignored. // // Expected markdown format: // // ## OpenConfig Path and RPC Coverage // // ```yaml // paths: // /interfaces/interface/config/description: // /interfaces/interface/config/enabled: // /components/component/state/name: // platform_type: "CHASSIS" // // rpcs: // gnmi: // gNMI.Set: // union_replace: true // gNMI.Subscribe: // on_change: true // ``` // // Note: For `rpcs`, only the RPC name and methods are validated. Any // attributes defined below RPC methods (e.g. union_replace) are not validated. ``` * Add invalid README example * Fix style * Make YAMLRenderer unexported * Improve comments * Update tools/internal/mdocspec/ocspec.go Co-authored-by: Darren Loher <dloher@google.com> * Minor improvements for OC coverage validation * Skip repo-cloning during validation if repo already cloned. * Validate that at least one RPC method is specified for any coverage spec. * Add additional validation for script in bash file. * Style Improvements. * Improve logic by searching from header rather than YAML block * add another corner case test * add another corner case test * Improve doc comment * Improve doc comments * Fix doc comment --------- Co-authored-by: Darren Loher <dloher@google.com>
bkreddy143
pushed a commit
to nokia/featureprofiles
that referenced
this pull request
Jul 17, 2024
…#2865) * Add yaml spec for oc path/rpc to test-requirements-template * revise yaml * revise yaml * Validation Script for OC Path and RPC Coverage in READMEs * `mdocspec` package parses ocpath.proto and ocrpcs.proto from yaml according to the format shown below by mdocspec.Parse's documentation. * `tools/validate_readme_spec/validate_readme_spec.go` script is added that can parse and then validate OC Paths and RPCs according to existing repo states in github.com/openconfig. ```go // Parse extracts sorted OpenConfig Path and RPC Coverage from an FNT README. // // The first yaml code block after a heading line named exactly as // "OpenConfig Path and RPC Coverage" will be used. Any other code blocks are // ignored. // // Expected markdown format: // // ## OpenConfig Path and RPC Coverage // // ```yaml // paths: // /interfaces/interface/config/description: // /interfaces/interface/config/enabled: // /components/component/state/name: // platform_type: "CHASSIS" // // rpcs: // gnmi: // gNMI.Set: // union_replace: true // gNMI.Subscribe: // on_change: true // ``` // // Note: For `rpcs`, only the RPC name and methods are validated. Any // attributes defined below RPC methods (e.g. union_replace) are not validated. ``` * Add invalid README example * Fix style * Make YAMLRenderer unexported * Improve comments * Update tools/internal/mdocspec/ocspec.go Co-authored-by: Darren Loher <dloher@google.com> * Minor improvements for OC coverage validation * Skip repo-cloning during validation if repo already cloned. * Validate that at least one RPC method is specified for any coverage spec. * Add additional validation for script in bash file. * Style Improvements. * Improve logic by searching from header rather than YAML block * add another corner case test * add another corner case test * Improve doc comment * Improve doc comments * Fix doc comment --------- Co-authored-by: Darren Loher <dloher@google.com>
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.
tools/internal/mdocspec/*
package parses ocpath.proto and ocrpcs.proto from yaml according to the format shown below by mdocspec.Parse's documentation.tools/validate_readme_spec/validate_readme_spec.go
script is added that can parse and then validate OC Paths and RPCs according to existing repo states in github.com/openconfig.