-
Notifications
You must be signed in to change notification settings - Fork 659
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
[sonic-cli-gen] first phase implementation of the SONiC CLI Auto-generation tool #1644
Merged
renukamanavalan
merged 83 commits into
sonic-net:master
from
vadymhlushko-mlnx:sonic-cli-gen
Nov 17, 2021
Merged
Changes from 62 commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
548896a
Worked version
vadymhlushko-mlnx 3350f27
added stub for function to determine static or dynamic YANG
vadymhlushko-mlnx 1d1643a
_find_index_of_yang_model()
vadymhlushko-mlnx cd31f0d
added function to init list's for module, top, tables
vadymhlushko-mlnx 81b803d
Added func to determine - static or list, +comments
vadymhlushko-mlnx ecdf8b6
Added auto compleation file
vadymhlushko-mlnx 42779c7
Add CLI Jinja templates
stepanblyschak 12bf0b2
Fix the generated function name is incorrect
stepanblyschak c8eaa66
update and enhance templates with multiple lists in container
stepanblyschak dd29e33
fix cli templates
stepanblyschak 0b0a0c1
Merge branch 'master' of github.com:azure/sonic-utilities into sonic-…
stepanblyschak 16857c4
add clear list command
stepanblyschak dfa3ccc
Parsing for static YANG models - sonic-flex_counter.yang, sonic-devic…
vadymhlushko-mlnx 6b75f4b
Done refactoring for parsing 'static' YANG models
vadymhlushko-mlnx d2be52b
Added parsing for 'dynamic' YANG models, done refactoring of whole code
vadymhlushko-mlnx 73a3b12
Done parser for 'grouping' BUT need to deeply test it, added function…
vadymhlushko-mlnx 718f8ab
align with implementation
647537c
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
fa6299c
generate cli from templates
9d9f66b
Table can only have 'static-objects' OR 'dynamic-objects'
vadymhlushko-mlnx 38f4365
add missing " in help for option
591aced
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
0826ac5
Added remove_keys(), get_mandatory()
vadymhlushko-mlnx 069000f
fix issues
594acce
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
1723f0f
Refactored generator.py: generate_cli_plugin(), get_cli_plugin_path()
vadymhlushko-mlnx 0a78e19
Removed arguments from constructor of class CliGenerator, added funct…
vadymhlushko-mlnx 30d2cb9
Added sceleton for UT, added additional check for yang_parser.py, cha…
vadymhlushko-mlnx 0d371de
Refactored _init_yang_module_and_containers()
vadymhlushko-mlnx 1593039
added 2 test cases
vadymhlushko-mlnx 9004c1c
[sonic-cli-gen] put autogenerated plugins into plugins.auto
stepanblyschak 32e27a2
[sonic-cli-gen] fix show.py.j2 template
stepanblyschak 02e6d27
[sonic-cli-gen] add remove plugin method
stepanblyschak cb7fa06
refactored past test cases, added new
vadymhlushko-mlnx 5737f5f
added test_dynamic_object_complex
vadymhlushko-mlnx 7b167a6
[sonic-cli-gen] implement grouping in show template
stepanblyschak 16e0cca
Reworked 'grouping' parser
vadymhlushko-mlnx b0fb3a9
Added 'group' to 'attrs'
vadymhlushko-mlnx e2acf73
Fixed 'grouping' parsing
vadymhlushko-mlnx 3305faa
DONE. ALL UT PASSED
vadymhlushko-mlnx 30e8ac9
Refactored UT
vadymhlushko-mlnx 15aeb8c
Added docstrings, fixed names of variables
vadymhlushko-mlnx ea2c838
Added test_grouping_complex to the execution pipeline
vadymhlushko-mlnx f7a7ed2
Merge remote-tracking branch 'vadymh/sonic-cli-gen' into sonic-cli-gen
vadymhlushko-mlnx e18c888
Removed unused test YANG model
vadymhlushko-mlnx 7bd3ec9
Fixed indentation
vadymhlushko-mlnx d5dea7f
Added sonic-cli-gen remove cmd, reworked private initializer functions
vadymhlushko-mlnx aa4af1c
Added new lines, fixed some docstrings
vadymhlushko-mlnx 718a431
removed type from docstring
vadymhlushko-mlnx 2907523
Added list_handler()
vadymhlushko-mlnx a005d6d
[sonic-cli-gen] address review comments
stepanblyschak aa00b61
[sonic-cli-gen] fix review comments
stepanblyschak fd931ad
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak 5c4e219
Fixed comments, added list_handler() where needed
vadymhlushko-mlnx 6de672c
Added logger to CliGenerator class constructor
vadymhlushko-mlnx 2a2f9f2
Merge remote-tracking branch 'vadymh/sonic-cli-gen' into sonic-cli-gen
vadymhlushko-mlnx 1584fe3
pep8 for generator.py
vadymhlushko-mlnx 8f27d03
pep8 for the rest of files
vadymhlushko-mlnx aa6f806
pep8 for tests files, added comments to YANG models
vadymhlushko-mlnx 83ce9ee
Added handler for 1 'choice' 'case'
vadymhlushko-mlnx 702be74
Code style
vadymhlushko-mlnx c433a4c
Fixed review comments
vadymhlushko-mlnx 94cde8e
Changed tabs to spaces
vadymhlushko-mlnx 5fec4a7
Removed unnecessary config_db.json file
vadymhlushko-mlnx 3cd8ad9
Added test case, added support for UT for sonic-cli-gen implementation
vadymhlushko-mlnx 607b254
Added registering of plugins to UT
vadymhlushko-mlnx 6816903
Fixed name
vadymhlushko-mlnx 2aee883
Added helper.load_and_register_plugins()
vadymhlushko-mlnx 9fea6db
Added test cases for sonic-device_metadata
vadymhlushko-mlnx 69926ed
Added cli_autogen_common.py, added separate dir for each cli_autogen …
vadymhlushko-mlnx dd7ec5e
Added backup and restore func for yang models
vadymhlushko-mlnx eb85200
Removed if-else UT login from generator.py
vadymhlushko-mlnx 5ccefa6
Added couple UT for device-neighbor
vadymhlushko-mlnx 37ac0b7
Added UT for update flow
vadymhlushko-mlnx 4402203
Fixed codestyle
vadymhlushko-mlnx 9d07092
Fixed codestyle
vadymhlushko-mlnx 5b6a8aa
Fixed test path variables
vadymhlushko-mlnx df1d329
[sonic-cli-gen] add docstrings
stepanblyschak 9e1854f
use dict.pop() with default value
stepanblyschak f2677a1
if no data ion update_entry_validated() abort
stepanblyschak 4e0ac3e
if entry config did not change avoid calling set_entry()
stepanblyschak 6a7d7fa
pass a copy of cfg to FormatConverter.to_serialized() as it modifies …
stepanblyschak afc4afb
Added exception handling for j2 templates
vadymhlushko-mlnx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
Empty file.
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
_sonic_cli_gen_completion() { | ||
COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \ | ||
COMP_CWORD=$COMP_CWORD \ | ||
_SONIC_CLI_GEN_COMPLETE=complete $1 ) ) | ||
return 0 | ||
} | ||
|
||
complete -F _sonic_cli_gen_completion -o default sonic-cli-gen; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
bash_completion.d/ /etc/ | ||
templates/*.j2 /usr/share/sonic/templates/ | ||
bash_completion.d/ /etc/ | ||
templates/*.j2 /usr/share/sonic/templates/ | ||
templates/sonic-cli-gen/*.j2 /usr/share/sonic/templates/sonic-cli-gen/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% macro cli_name(name) -%} | ||
{{ name|lower|replace("_", "-") }} | ||
{%- endmacro %} |
Oops, something went wrong.
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.
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.
Looks like the below PR also has the same changes for some files, are we planning to consolidate the changes in one PR?
https://github.com/Azure/sonic-utilities/pull/1650/files
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.
Changes from this PR was added to https://github.com/Azure/sonic-utilities/pull/1650/files in order to pass CI, once this PR will be merged, the changes will be removed from https://github.com/Azure/sonic-utilities/pull/1650/files