Merge pull request #120822 from akhilerm/change-from-deprecated-fields

update rules to switch from deprecated dir field
This commit is contained in:
Kubernetes Prow Robot 2023-10-04 14:00:38 +02:00 committed by GitHub
commit 56f330493c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 298 additions and 146 deletions

View File

@ -80,7 +80,13 @@ def main():
continue
for item in rule["branches"]:
if not item["source"]["dir"].endswith(rule["destination"]):
if "dir" in item["source"]:
raise Exception("use of deprecated `dir` field in rules for `%s`" % (rule["destination"]))
if len(item["source"]["dirs"]) > 1:
raise Exception("cannot have more than one directory (`%s`) per source branch `%s` of `%s`" %
(item["source"]["dirs"], item["source"]["branch"], rule["destination"])
)
if not item["source"]["dirs"][0].endswith(rule["destination"]):
raise Exception("copy/paste error `%s` refers to `%s`" % (rule["destination"],item["source"]["dir"]))
if branch["name"] != "master":

File diff suppressed because it is too large Load Diff