Skip to content

Commit

Permalink
pw_brancher: make more resilient to repeat checks
Browse files Browse the repository at this point in the history
There's no way to delete checks from patchwork, so new results
are added as new checks. Patchwork UI just displays the most
recent. Use the most recent to determine if patch is good, too.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jul 11, 2024
1 parent 5d6352a commit a331727
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pw_brancher.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ def pwe_has_all_checks(pw, entry) -> bool:
if "checks" not in entry:
return False
checks = pw.request(entry["checks"])
found = 0
found = dict.fromkeys(gate_checks, 0)
for c in checks:
if c["context"] in gate_checks and c["state"] == "success":
found += 1
return found == len(gate_checks)
if c["context"] in gate_checks:
found[c["context"]] = int(c["state"] == "success")
return sum(found.values()) == len(gate_checks)


def pwe_series_id_or_none(entry) -> int:
Expand Down

0 comments on commit a331727

Please sign in to comment.