summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-pr-title-and-commit-messages.py11
-rwxr-xr-xscripts/update-configd-include-file2
2 files changed, 11 insertions, 2 deletions
diff --git a/scripts/check-pr-title-and-commit-messages.py b/scripts/check-pr-title-and-commit-messages.py
index 3317745d6..1d4a3cfe3 100755
--- a/scripts/check-pr-title-and-commit-messages.py
+++ b/scripts/check-pr-title-and-commit-messages.py
@@ -2,12 +2,13 @@
import re
import sys
+import time
import requests
from pprint import pprint
# Use the same regex for PR title and commit messages for now
-title_regex = r'^(([a-zA-Z.]+:\s)?)T\d+:\s+[^\s]+.*'
+title_regex = r'^(([a-zA-Z\-_.]+:\s)?)T\d+:\s+[^\s]+.*'
commit_regex = title_regex
def check_pr_title(title):
@@ -27,9 +28,17 @@ if __name__ == '__main__':
print("Please specify pull request URL!")
sys.exit(1)
+ # There seems to be a race condition that causes this scripts to receive
+ # an incomplete PR object that is missing certain fields,
+ # which causes temporary CI failures that require re-running the script
+ #
+ # It's probably better to add a small delay to prevent that
+ time.sleep(5)
+
# Get the pull request object
pr = requests.get(sys.argv[1]).json()
if "title" not in pr:
+ print("The PR object does not have a title field!")
print("Did not receive a valid pull request object, please check the URL!")
sys.exit(1)
diff --git a/scripts/update-configd-include-file b/scripts/update-configd-include-file
index 6615e21ff..ca23408f0 100755
--- a/scripts/update-configd-include-file
+++ b/scripts/update-configd-include-file
@@ -31,7 +31,7 @@ from inspect import signature, getsource
from vyos.defaults import directories
from vyos.version import get_version
-from vyos.util import cmd
+from vyos.utils.process import cmd
# Defaults