Skip to content

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

Merged
qiluo-msft merged 10 commits intosonic-net:masterfrom
dgsudharsan:yang_help
Jul 5, 2022
Merged

[yang]Adding a tool for generating documentation based on yang model#11291
qiluo-msft merged 10 commits intosonic-net:masterfrom
dgsudharsan:yang_help

Conversation

@dgsudharsan
Copy link
Copy Markdown
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
Copy Markdown

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 zhangyanzhao requested a review from qiluo-msft June 30, 2022 17:08
@zhangyanzhao
Copy link
Copy Markdown

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

@qiluo-msft qiluo-msft requested a review from ganglyu June 30, 2022 19:23
@dgsudharsan dgsudharsan requested a review from praveen-li June 30, 2022 19:57
def test_single_table(self):
argument = '-t AUTO_TECHSUPPORT'
output = self.run_script(argument)
self.assertEqual(output, techsupport_table_output)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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