Skip to content
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

[yang]Adding a tool for generating documentation based on yang model #11291

Merged
merged 10 commits into from
Jul 5, 2022

Conversation

dgsudharsan
Copy link
Collaborator

Why I did it

Added a tool to generate configuration based on yang model

How I did it

Parse the yang model and create documentation based on description field.

How to verify it

Added UT to verify it.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@dgsudharsan dgsudharsan requested a review from a team as a code owner June 29, 2022 22:00
@lgtm-com
Copy link

lgtm-com bot commented Jun 29, 2022

This pull request introduces 3 alerts when merging c6d0814 into 05f1c6f - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Unused local variable

@zhangyanzhao zhangyanzhao added the YANG YANG model related changes label Jun 30, 2022
@zhangyanzhao
Copy link
Collaborator

This tool is very helpful to improve the user experience and dev productivity. Love this idea and thanks for the contribution!

def test_single_table(self):
argument = '-t AUTO_TECHSUPPORT'
output = self.run_script(argument)
self.assertEqual(output, techsupport_table_output)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we modify techsupport yang model, this unit test will fail?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We need to update this test as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can create some dummy yang models for unit test.
And then we can modify Yang model, and don't need to update this unit test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ganglyu ,
I prefer to use any active yang model rather than introducing a dummy for the test. We do have instances of such tests in other repositories where if schema is changed, the UT needs to be updated.
I don't think the yang model I chosen would change quite often. Even if someone changes it and accidentally misses to update UT, it will be caught during build time and build will fail, forcing the user to modify the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
YANG YANG model related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants