Skip to content

Commit

Permalink
Fixes issues in validation script
Browse files Browse the repository at this point in the history
This happens when the version of an addon is empty, the regex failed to
parse it.
Subsequently the validation gave a false positive since previous and
current version were the same.

Signed-off-by: Vicente Zepeda Mas <[email protected]>
  • Loading branch information
Vicente Zepeda Mas committed Nov 27, 2020
1 parent 6bb8947 commit 5fabebb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ci/jenkins/pipelines/prs/helpers/pr_manager/pr_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def check_pr_manifest_change(self):

added_changes = []
removed_changes = []
p = re.compile('(-|\+)([A-Za-z]+):&AddonVersion{"(.+)",([0-9]+)},')
p = re.compile('(-|\+)([A-Za-z]+):&AddonVersion{"(.*)",([0-9]+)},')

cmd = f'git diff --no-ext-diff --unified=0 origin/master -- {WORKSPACE}/internal/pkg/skuba/kubernetes/versions.go | grep "AddonVersion"'

Expand All @@ -65,7 +65,7 @@ def check_pr_manifest_change(self):
error = False
for r in removed_changes:
for a in added_changes:
if r["name"] == a["name"] and (r["version"] == a["version"] or r["manifest"] == a["manifest"]):
if r["name"] == a["name"] and ((r["version"] == a["version"] and r["version"] != "") or r["manifest"] == a["manifest"]):
error = True
print(f'Error in Addon {r["name"]} please double check the manifest number')

Expand Down

0 comments on commit 5fabebb

Please sign in to comment.