diff --git a/scripts/get_staging_hash.py b/scripts/get_staging_hash.py index fe69a3f7e56..5947471770c 100644 --- a/scripts/get_staging_hash.py +++ b/scripts/get_staging_hash.py @@ -37,7 +37,12 @@ def filter_issue(issue): re.search("^Testsuite Status [0-9a-f]{40}$", issue["title"]) is not None ) # re.search returns None if pattern not found issue_labels = [label["name"] for label in issue["labels"]] - labels_check = "valid-baseline" in issue_labels + # guaranteed that all issues have at least one label. If there are any + # without labels, something went wrong. Allow to choose baseline that + # has resolved regressions + labels_check = sorted(issue_labels) in [["valid-baseline"], + ["resolved-regressions", "valid-baseline"], + ["new-regressions", "resolved-regressions", "valid-baseline"]] if "pull_request" not in issue.keys() and labels_check and title_check: return True return False diff --git a/scripts/get_staging_patch.py b/scripts/get_staging_patch.py index 50587542cc2..49e30dc31df 100644 --- a/scripts/get_staging_patch.py +++ b/scripts/get_staging_patch.py @@ -20,13 +20,16 @@ def parse_arguments(): help="Github access token", ) + return parser.parse_args() def filter_issue(issue): title_check = issue["title"].split("-")[-1] == "1" issue_labels = [label["name"] for label in issue["labels"]] - labels_check = "valid-baseline" in issue_labels + # Having no labels means no failures and is not a staging run + # Allow choosing issues that only have 'linter-failure' + labels_check = issue_labels == [] or issue_labels == ['linter-failure'] if "pull_request" not in issue.keys() and labels_check and title_check: return True return False