From 2ce4f85a465d19ef2c104687ae10ed2c9c76372e Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Mon, 25 Sep 2023 21:07:10 +0530 Subject: [PATCH] update verify script to check deprecated fields Signed-off-by: Akhil Mohan --- hack/verify-publishing-bot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hack/verify-publishing-bot.py b/hack/verify-publishing-bot.py index 1e9f6c69c2b..ee6b884bca8 100755 --- a/hack/verify-publishing-bot.py +++ b/hack/verify-publishing-bot.py @@ -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":