[master][WIP] github.get_releases() & github.check_releases#64704
Draft
gluf-technik wants to merge 3 commits intosaltstack:masterfrom
Draft
[master][WIP] github.get_releases() & github.check_releases#64704gluf-technik wants to merge 3 commits intosaltstack:masterfrom
gluf-technik wants to merge 3 commits intosaltstack:masterfrom
Conversation
Takes a list `orig` and inserts the elements of `updates_list` anyplace where an element equal `placeholder` has been. In list ['a', 'bx', 'c'] placeholder 'bx' would be replaced with the elements of ['b1', 'b2', 'b3'] resulting in list ['a', 'b1', 'b2', 'b3', 'c']. TODO: Update docs
Uses fnmatch for "globbing" elements of a list: The globbing the list [eth0, eth2, lo] with pattern 'eth*' results in [eth0, eth2] Same function as used in Salt's match.glob. https://docs.python.org/3/library/fnmatch.html TODO: - Update docs - Add `jinja_filter("glob_list")`?
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?
Big W.I.P., quite some clean-up needed besides docs missing.
Adds functions to get a list of a Github project's releases and to check for a specific project's release. Globbing of the version number (querying for version 1.2 and accepting 1.2.1, too) in the later one depends on
salt.utils.data.glob_list(), see PR #64703.1Doesn't actually use PyGithub just the pure JSON API so it would work despite PyGithub missing on the minion.
Would be nice to have a reduced
githubexec module is PyGithub is missing, wouldn't it?What issues does this PR fix or reference?
Fixes:
NoneMerge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes/NoPlease review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.
Footnotes
No idea why idea why the changes from
f664e6ewhich addedreplace_list_element()were applied when I cherry-picked the one forsalt.utils.data.glob_list()but cherry-picking both resulted in a cleaner commit history. ↩