Skip to content

Commit

Permalink
automatically approve operations on tests passed
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Nov 26, 2024
1 parent d4a42c7 commit 275f3e7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
"y19y19": ["ml"],
}

# Automatically sign these categories if tests are passed
CATS_TO_APPROVE_ON_TEST = ["operations"]

# All CMS_SDT members can sign externals ( e.g Pull Requests in cms-sw/cmsdist , cms-data and cms-externals
for user in CMS_SDT:
if user not in CMSSW_L2:
Expand Down
15 changes: 14 additions & 1 deletion process_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper

try:
from categories import CATS_TO_APPROVE_ON_TEST
except:
CATS_TO_APPROVE_ON_TEST = []
try:
from categories import CMSSW_LABELS
except:
Expand Down Expand Up @@ -2081,6 +2084,16 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
signatures["tests"] = "approved"
labels.append("tests-" + override_tests_failure)

# automatically approve CATS_TO_APPROVE_ON_TEST on test-approved
if ("tests" in signatures) and (signatures["tests"] == "approved"):
for cat in [
c
for c in CATS_TO_APPROVE_ON_TEST
if ((c in signatures) and (signatures[c] == "pending"))
]:
signatures[cat] = "approved"
print("Overriding/Approving singatures for %s due to tests-approved" % cat)

for cat in signing_categories:
l = cat + "-pending"
if cat in signatures:
Expand Down

0 comments on commit 275f3e7

Please sign in to comment.