Skip to content

Commit 46483ac

Browse files
author
Nicolas Georges
committed
Update VIP-specific descriptor checks
- Add author field - Add missing '@' character in appname - Cross-reference comment to similar rules in VIP-portal
1 parent 7e799af commit 46483ac

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

vipapps/vipapps.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,18 @@ def load_descriptor(filepath, silent=False) -> dict:
174174
rawtext = f.read()
175175
f.seek(0)
176176
desc = json.load(f)
177+
# VIP-specific checks, in addition to "bosh validate".
178+
# These rules should be kept similar to those in VIP-portal/BoutiquesParser.java.
177179
appname = desc["name"]
178180
appversion = desc["tool-version"]
179-
# check name and version strings
180-
if not re.match(r"^[a-zA-Z0-9_\. +-]+$", appname):
181+
# check mandatory fields, and name+version content
182+
if not re.match(r"^[a-zA-Z0-9_\.@ +-]+$", appname):
181183
raise ValueError("invalid name '%s'" % appname)
182184
if not re.match(r"^[a-zA-Z0-9_\.@ +-]+$", appversion):
183185
raise ValueError("invalid version '%s'" % appversion)
186+
# author field mandatory
187+
if "author" not in desc:
188+
raise ValueError("%s: missing author" % filepath)
184189
# check container-image (just warnings)
185190
if not silent:
186191
if not "container-image" in desc:

0 commit comments

Comments
 (0)