Skip to content

Commit

Permalink
Merge pull request #147 from rapid7/fix_new_plugin
Browse files Browse the repository at this point in the history
ACTUALLY fixed version Increment Validator
  • Loading branch information
pmara-r7 authored Jan 12, 2022
2 parents 2801685 + b09dfb1 commit 4a6a361
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4a6a361

Please sign in to comment.