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

Downstream checks: add show closed and only failed options #2033

Merged
merged 2 commits into from
May 29, 2024
Merged
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
17 changes: 11 additions & 6 deletions scripts/downstream_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ def repo_actions_url(repo: str) -> str:
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--hash", required=True)
ap.add_argument("--show-closed", action="store_true")
ap.add_argument("--only-failed", action="store_true")
args = ap.parse_args()
c = args.hash
show_closed: bool = args.show_closed
only_failed: bool = args.only_failed

replaced_query = QUERY.replace("???", c)
token = sp.check_output(["gh", "auth", "token"]).decode("utf-8").strip()
Expand All @@ -122,15 +126,16 @@ def main():

provider_map[repo.removeprefix("pulumi-")] = True

if closed:
continue

sentinel_status = get_sentinel_status(pr_checks)

if sentinel_status == "SUCCESS":
print("SUCCESS", url)
sp.check_call(["gh", "pr", "close", url])
if not only_failed:
print("SUCCESS", url)
if not closed:
sp.check_call(["gh", "pr", "close", url])
else:
print(sentinel_status, url)
if not closed or show_closed:
print(sentinel_status, url)

for missing_repo in {repo for repo in provider_map if not provider_map[repo]}:
print("MISSING", repo_actions_url(missing_repo))
Expand Down