hack: ensure go version is not specified for master in publishing rules

The go version for all master branches is defined in `default-go-version`
locally.

Note that this validation isn't added to publishing-bot directly because
we still want to give users of the publishing-bot the ability to specify
specific go versions for the master branch if they need, but we want to
explicitly disallow this for kubernetes repos.
This commit is contained in:
Nikhita Raghunath 2020-07-24 14:33:05 +05:30
parent ef90e6cbb3
commit 1dffb87037

View File

@ -86,6 +86,11 @@ def main():
if branch["source"]["branch"] != "master":
raise Exception("cannot find master source branch for destination %s" % rule["destination"])
# we specify the go version for all master branches through `default-go-version`
# so ensure we don't specify explicit go version for master branch in rules
if "go" in branch:
raise Exception("go version must not be specified for master branch for destination %s" % rule["destination"])
print("processing : %s" % rule["destination"])
if rule["destination"] not in gomod_dependencies:
raise Exception("missing go.mod for %s" % rule["destination"])