From ef16341565f0d0b4dc9476d52dbe4a8ba9edf481 Mon Sep 17 00:00:00 2001 From: PJ Mara Date: Wed, 12 Jan 2022 09:57:01 -0500 Subject: [PATCH 1/2] actually fixed the problem, yikes --- .../rules/plugin_validators/version_bump_validator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/icon_validator/rules/plugin_validators/version_bump_validator.py b/icon_validator/rules/plugin_validators/version_bump_validator.py index 658c4943..e51b5e8b 100644 --- a/icon_validator/rules/plugin_validators/version_bump_validator.py +++ b/icon_validator/rules/plugin_validators/version_bump_validator.py @@ -49,6 +49,9 @@ def get_remote_spec(spec): remote_list = repo.remote().refs blob = VersionBumpValidator.get_plugin_spec_blob(remote_list, spec.spec_dictionary()["name"]) + # case: remote spec not found + if blob is None: + return None # if all went well and no exceptions, we now have the blob of plugin spec # using a temp file because stream_data requires a data object @@ -77,7 +80,7 @@ def get_plugin_spec_blob(remote_list: [git.RemoteReference], plugin_name: str): break except KeyError: # plugin name not found, so version increment is not really relevant - return + return None if blob is None: # throw error: no plugin spec found in remote raise ValidationException(f"{RepoConstants.PLUGIN_SPEC} not found in remote repo") @@ -354,6 +357,9 @@ def check_new_inputs_outputs(self, remote: dict, local: dict, input_output: str) def validate(self, spec): remote_spec = VersionBumpValidator.get_remote_spec(spec) + # case: new plugin with no remote spec + if remote_spec is None: + return local_spec = spec.spec_dictionary() # perform the different sections of validation # Check if we already did a major version bump- if so, no need to do all this checking From e7e3d05f12cd68f853312fce1b4f7cc23b8bdfd2 Mon Sep 17 00:00:00 2001 From: PJ Mara Date: Wed, 12 Jan 2022 10:38:30 -0500 Subject: [PATCH 2/2] updated readme and setup.py version updates --- README.md | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 618698ab..1396dd8b 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ be on your way to contributing! ## Changelog +* 2.44.2 - Fixed (and tested) VersionBumpValidator on new plugin * 2.44.1 - Fixed VersionBumpValidator bug on new plugins * 2.44.0 - Update WorkflowTitleValidator to validate titles in `.icon` file * 2.43.2 - Fixed breaking change that caused VersionBumpValidator to not get remote changes, made code safer diff --git a/setup.py b/setup.py index 3591c437..e6806ba5 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="insightconnect_integrations_validators", - version="2.44.1", + version="2.44.2", description="Validator tooling for InsightConnect integrations", long_description=long_description, long_description_content_type="text/markdown",