diff options
| author | dd <91662885+dd010101@users.noreply.github.com> | 2024-05-25 17:48:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-25 17:48:38 +0200 |
| commit | 196e3e8b55b83710c867632131a4129971d1e5b7 (patch) | |
| tree | 64700c37c609b19951a5d414f9a622b7788e67a1 /scripts | |
| parent | 9b5161b074eea6e5395bab4d984cec92434d503f (diff) | |
| parent | cc9d1af8b7f3b2b4b76d9b4a3bcf151b841074dc (diff) | |
| download | vyos-build-196e3e8b55b83710c867632131a4129971d1e5b7.tar.gz vyos-build-196e3e8b55b83710c867632131a4129971d1e5b7.zip | |
Merge branch 'vyos:current' into current
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-pr-title-and-commit-messages.py | 54 | ||||
| -rw-r--r-- | scripts/image-build/raw_image.py | 1 |
2 files changed, 0 insertions, 55 deletions
diff --git a/scripts/check-pr-title-and-commit-messages.py b/scripts/check-pr-title-and-commit-messages.py deleted file mode 100755 index f7376e98..00000000 --- a/scripts/check-pr-title-and-commit-messages.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 - -import re -import sys -import time - -import requests - -# Use the same regex for PR title and commit messages for now -title_regex = r'^(([a-zA-Z\-_.]+:\s)?)T\d+:\s+[^\s]+.*' -commit_regex = title_regex - - -def check_pr_title(title): - if not re.match(title_regex, title): - print(f"PR title '{title}' does not match the required format!") - print("Valid title example: T99999: make IPsec secure") - sys.exit(1) - - -def check_commit_message(title): - if not re.match(commit_regex, title): - print(f"Commit title '{title}' does not match the required format!") - print("Valid title example: T99999: make IPsec secure") - sys.exit(1) - - -if __name__ == '__main__': - if len(sys.argv) < 2: - 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) - - check_pr_title(pr["title"]) - - # Get the list of commits - commits = requests.get(pr["commits_url"]).json() - for c in commits: - # Retrieve every individual commit and check its title - co = requests.get(c["url"]).json() - check_commit_message(co["commit"]["message"]) diff --git a/scripts/image-build/raw_image.py b/scripts/image-build/raw_image.py index 5068ba1b..dedb6f5e 100644 --- a/scripts/image-build/raw_image.py +++ b/scripts/image-build/raw_image.py @@ -18,7 +18,6 @@ import os import sys import shutil -import traceback import vyos.utils.process |
