From ffef2d1f1ae190dcd1fd987e98fa3b2a68c95eec Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Tue, 29 Nov 2022 15:07:28 -0500 Subject: [PATCH] add more validation to rules.yaml We need to better catch problems like the one we fixed in: 7b6a3d6a33527fdbdf06253452363b33f2cdf025 Essentially a copy-paste error where had a branch pointing to staging/src/k8s.io/code-generator instead of staging/src/k8s.io/apimachinery Signed-off-by: Davanum Srinivas --- hack/verify-publishing-bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/verify-publishing-bot.py b/hack/verify-publishing-bot.py index 908fa335830..d63521cdd77 100755 --- a/hack/verify-publishing-bot.py +++ b/hack/verify-publishing-bot.py @@ -81,6 +81,10 @@ def main(): # And skip validation of publishing rules for it continue + for item in rule["branches"]: + if not item["source"]["dir"].endswith(rule["destination"]): + raise Exception("copy/paste error `%s` refers to `%s`" % (rule["destination"],item["source"]["dir"])) + if branch["name"] != "master": raise Exception("cannot find master branch for destination %s" % rule["destination"]) if branch["source"]["branch"] != "master":