Skip to content
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

Fix packs.get action #6226

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Python 3.6 is no longer supported; Stackstorm requires at least Python 3.8.

Fixed
~~~~~
* Fix `packs.get` action. Assumed `master` is primary branch on all packs. #6225
* Restore Pack integration testing (it was inadvertently skipped) and stop testing against `bionic` and `el7`. #6135
* Fix Popen.pid typo in st2tests. #6184
* Bump tooz package to `6.2.0` to fix TLS. #6220 (@jk464)
Expand Down
5 changes: 5 additions & 0 deletions contrib/packs/actions/get.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ parameters:
type: "string"
description: "Name of pack to lookup"
required: true
branch:
type: "string"
description: "The primary branch of this pack repo"
required: false
default: "master"
6 changes: 3 additions & 3 deletions contrib/packs/actions/pack_mgmt/get_installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
class GetInstalled(Action):
"""Get information about installed pack."""

def run(self, pack):
def run(self, pack, branch):
"""
:param pack: Installed Pack Name to get info about
:type pack: ``str``
:type branch: ``str``
"""
packs_base_paths = get_packs_base_paths()

Expand Down Expand Up @@ -69,9 +70,8 @@ def run(self, pack):
repo.git.status().split("\n")[0],
"\n".join([remote.url for remote in repo.remotes]),
)

ahead_behind = repo.git.rev_list(
"--left-right", "--count", "HEAD...origin/master"
"--left-right", "--count", f"HEAD...origin/{branch}"
).split()
# Dear god.
if ahead_behind != ["0", "0"]:
Expand Down
Loading