Skip to content

[master][WIP] github.get_releases() & github.check_releases#64704

Draft
gluf-technik wants to merge 3 commits intosaltstack:masterfrom
gluf-technik:get_check_gh_releases
Draft

[master][WIP] github.get_releases() & github.check_releases#64704
gluf-technik wants to merge 3 commits intosaltstack:masterfrom
gluf-technik:get_check_gh_releases

Conversation

@gluf-technik
Copy link

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.1

Doesn'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 github exec module is PyGithub is missing, wouldn't it?

What issues does this PR fix or reference?

Fixes: None

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Footnotes

  1. No idea why idea why the changes from f664e6e which added replace_list_element() were applied when I cherry-picked the one for salt.utils.data.glob_list() but cherry-picking both resulted in a cleaner commit history.

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")`?
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title [WIP] github.get_releases() & github.check_releases [master][WIP] github.get_releases() & github.check_releases Jul 24, 2023
@dwoz dwoz added this to the Argon v3008.0 milestone Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants