Module to list arguments to salt modules without loading - #56685
Merged
Conversation
s0undt3ch
previously approved these changes
Apr 19, 2020
s0undt3ch
left a comment
Contributor
There was a problem hiding this comment.
Awesome approach!
Just found a nitpick on a comment.
Contributor
|
Windows test failures are related and look problematic. |
Contributor
Author
|
The windows failures seems to be with saltutils.sync* functions, which should not be impacted by the addition of this module. I am also unable to replicate the errors locally. Any thoughts? |
Contributor
Author
|
all tests for master currently appear to be dependent on #56700 |
dwoz
approved these changes
Apr 23, 2020
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.
What does this PR do?
This is a rewrite of the baredoc module first merged in #52044 and to be merged into master in #54570
The original baredoc used regex parsing to find functions and attributes. This PR rewrites baredoc to use python ast as a less brittle parser.
There are occasional use-cases for listing state functions. It might not be common, but in order to generate autocomplete listings for vscode, I needed to know what possible state functions might exist. I tried installing a bunch of dependencies and run on linux and windows to use sys.list_state_functions. That was pretty good, but probably missed lots of states which won't load due to dependencies.
The reasoning for baredoc's existence was listed as:
What issues does this PR fix or reference?
Possibly superseeds: #54570
New Behavior
Provides a listing of salt execution and state modules functions and default arguments by reading files from the filesystem rather than having to local code requiring dependencies. Support custom modules (anything synced with saltutil.sync_{states,modules} as well as func_alias
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No