diff --git a/apps_validation/catalog_reader/app.py b/apps_validation/catalog_reader/app.py index fc82835..d6de873 100644 --- a/apps_validation/catalog_reader/app.py +++ b/apps_validation/catalog_reader/app.py @@ -149,7 +149,7 @@ def get_app_version_details( ) -> dict: version_data = {'location': version_path, 'required_features': set()} for key, filename, parser in ( - ('chart_metadata', 'Chart.yaml', yaml.safe_load), + ('chart_metadata', 'app.yaml', yaml.safe_load), ('app_metadata', 'metadata.yaml', yaml.safe_load), ('schema', 'questions.yaml', yaml.safe_load), ('readme', 'README.md', markdown.markdown), # TODO: Has been changed, make sure json schema accounts for it diff --git a/apps_validation/catalog_reader/catalog.py b/apps_validation/catalog_reader/catalog.py index 4a5e33d..631d680 100644 --- a/apps_validation/catalog_reader/catalog.py +++ b/apps_validation/catalog_reader/catalog.py @@ -30,7 +30,7 @@ def get_apps_in_trains(trains_to_traverse: list, catalog_location: str) -> dict: for train in trains_to_traverse: items.update({ f'{i}_{train}': train for i in os.listdir(os.path.join(get_train_path(catalog_location), train)) - if os.path.isdir(os.path.join(catalog_location, train, i)) + if os.path.isdir(os.path.join(get_train_path(catalog_location), train, i)) }) return items diff --git a/apps_validation/schema/attrs/base.py b/apps_validation/schema/attrs/base.py index c9fa504..a89c429 100644 --- a/apps_validation/schema/attrs/base.py +++ b/apps_validation/schema/attrs/base.py @@ -9,7 +9,7 @@ class SchemaMeta(type): def __new__(cls, name, bases, dct): klass = type.__new__(cls, name, bases, dct) - if getattr(klass, 'SCHEMA_NAME', NotImplementedError) is NotImplementedError: + if klass.__name__ != 'BaseSchema' and getattr(klass, 'SCHEMA_NAME', NotImplementedError) is NotImplementedError: raise ValueError(f'{name!r} attr schema does not has SCHEMA_NAME defined') ATTRIBUTES_SCHEMA[klass.SCHEMA_NAME] = klass diff --git a/apps_validation/schema/attrs/string.py b/apps_validation/schema/attrs/string.py index 9c9985f..0f9ee28 100644 --- a/apps_validation/schema/attrs/string.py +++ b/apps_validation/schema/attrs/string.py @@ -81,7 +81,7 @@ class URISchema(BaseSchema): class IPAddrSchema(BaseSchema): DEFAULT_TYPE = 'string' - SCHEMA_NAME = 'uri' + SCHEMA_NAME = 'ipaddr' def __init__(self, data): self.ipv4 = self.ipv6 = self.cidr = None diff --git a/apps_validation/scripts/catalog_update.py b/apps_validation/scripts/catalog_update.py index 71b3b14..6cc1156 100644 --- a/apps_validation/scripts/catalog_update.py +++ b/apps_validation/scripts/catalog_update.py @@ -13,6 +13,7 @@ get_app_version, get_ci_development_directory, get_to_keep_versions, OPTIONAL_METADATA_FILES, REQUIRED_METADATA_FILES, version_has_been_bumped, ) +from apps_validation.catalog_reader.train_utils import get_train_path from apps_validation.ci.names import CACHED_CATALOG_FILE_NAME, CACHED_VERSION_FILE_NAME from apps_validation.exceptions import ValidationErrors from apps_validation.validation.json_schema_utils import CATALOG_JSON_SCHEMA @@ -21,7 +22,7 @@ def get_trains(location: str) -> typing.Tuple[dict, dict]: preferred_trains: list = [] - trains_to_traverse = retrieve_train_names(location) + trains_to_traverse = retrieve_train_names(get_train_path(location)) catalog_data = {} versions_data = {} for train_name, train_data in retrieve_trains_data( @@ -88,7 +89,7 @@ def publish_updated_apps(catalog_path: str) -> None: for train_name, apps in get_apps_to_publish(catalog_path).items(): dev_train_path = os.path.join(ci_dev_directory, train_name) - publish_train_path = os.path.join(catalog_path, train_name) + publish_train_path = os.path.join(get_train_path(catalog_path), train_name) os.makedirs(publish_train_path, exist_ok=True) for app in apps: @@ -141,7 +142,7 @@ def update_catalog_file(location: str) -> None: for train_name, train_data in versions_data.items(): for app_name, app_data in train_data.items(): - version_path = os.path.join(location, train_name, app_name, CACHED_VERSION_FILE_NAME) + version_path = os.path.join(get_train_path(location), train_name, app_name, CACHED_VERSION_FILE_NAME) with open(version_path, 'w') as f: f.write(json.dumps(app_data['versions'], indent=4)) diff --git a/apps_validation/validation/validate_dev_directory.py b/apps_validation/validation/validate_dev_directory.py index de34073..307f211 100644 --- a/apps_validation/validation/validate_dev_directory.py +++ b/apps_validation/validation/validate_dev_directory.py @@ -67,7 +67,7 @@ def validate_upgrade_strategy(app_path: str, schema: str, verrors: ValidationErr def validate_app(app_dir_path: str, schema: str) -> None: app_name = os.path.basename(app_dir_path) - chart_version_path = os.path.join(app_dir_path, 'Chart.yaml') + chart_version_path = os.path.join(app_dir_path, 'app.yaml') verrors = validate_app_version_file(ValidationErrors(), chart_version_path, schema, app_name) validate_keep_versions(app_dir_path, app_name, verrors) verrors.check()