From dc06b9724615607672f98077112b1402fdb08d92 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Mon, 23 Oct 2023 16:53:08 +0200 Subject: [PATCH] Added a sanity check for source_repo_uri Signed-off-by: Jose Luis Rivero --- release.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/release.py b/release.py index 7d4f6268e..81b3cafab 100755 --- a/release.py +++ b/release.py @@ -297,12 +297,23 @@ def sanity_project_package_in_stable(version, repo_name): return +def sanity_check_source_repo_uri(source_repo_uri): + # Check if the scheme is "https" and the path ends with ".git" + parsed_uri = urllib.parse.urlparse(source_repo_uri) + if not parsed_uri.scheme == "https" or \ + not parsed_uri.path.endswith(".git"): + error("--source-repo-uri parameter should start with https:// and end with .git") + + def sanity_checks(args, repo_dir): print("Safety checks:") sanity_package_name_underscore(args.package, args.package_alias) sanity_package_name(repo_dir, args.package, args.package_alias) sanity_check_repo_name(args.upload_to_repository) + if args.source_repo_uri: + sanity_check_source_repo_uri(args.source_repo_uri) + if not NIGHTLY: sanity_package_version(repo_dir, args.version, str(args.release_version)) sanity_check_sdformat_versions(args.package, args.version)