Skip to content

Commit

Permalink
chore: fix downstream_checks.py (#2918)
Browse files Browse the repository at this point in the history
Relates to #2917

The script was confusing to me. It printed SKIPPED for jobs that failed.
It is too easy to miss failure.

It was writing MISSING for cases where some jobs may still be in
progress.

It also tried to handle providers such as awsx that are not bridged -
best exclude these.
  • Loading branch information
t0yv0 authored Feb 27, 2025
1 parent ebf4276 commit 0fc4e0e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scripts/downstream_checks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from typing import Any, Iterator
import argparse
import subprocess as sp

import requests

NOT_BRIDGED_PROVIDERS = [
"aws-apigateway",
"awsx",
"eks",
"terraform-module",
]

QUERY = """
{
Expand Down Expand Up @@ -48,7 +53,7 @@ def get_provider_map() -> dict[str, bool]:
resp = requests.get(
"https://raw.githubusercontent.com/pulumi/ci-mgmt/master/provider-ci/providers.json"
)
return {k: False for k in resp.json()}
return {k: False for k in resp.json() if k not in NOT_BRIDGED_PROVIDERS}


def get_title(query_result: Any) -> str:
Expand Down Expand Up @@ -135,10 +140,15 @@ def main():
sp.check_call(["gh", "pr", "close", url])
else:
if not closed or show_closed:
print(sentinel_status, url)
# If the sentinel is SKIPPED, this very likely means the PR failed some checks.
if sentinel_status == "SKIPPED":
print('FAILED:', url)
else:
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))
# Possibly waiting for plumbing to propagate, we do not know for sure.
print("WAITING", missing_repo)


if __name__ == "__main__":
Expand Down

0 comments on commit 0fc4e0e

Please sign in to comment.