Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds missing bits #1960

Conversation

josenavas
Copy link
Contributor

Adds the missing code to be able to successfully install commands and types and adds some endpoints so the plugins can correctly run the tests.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling c86d37d on josenavas:plugin-installation-activate-cmd into * on biocore:plugin-installation*.

Copy link
Member

@antgonza antgonza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments.

self.finish()


class ReloadPluginAPItestHandler(OauthBaseHandler):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing a test, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this method idempotent? if not, should it be?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question regarding CommandActivateHandler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is idempotent as long as the files in qiita_config.plugin_dir do not change.
CommandActivateHandler is idempotent.

@@ -281,6 +284,17 @@ def create(cls, software, name, description, parameters):
for at in atypes]
qdb.sql_connection.TRN.add(sql_type, sql_params, many=True)

# Add the outputs to the command
if outputs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to confirm that now there are no tests without output. I think is fine due to how it work but want to double check it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@@ -425,6 +439,31 @@ def outputs(self):
qdb.sql_connection.TRN.add(sql, [self.id])
return qdb.sql_connection.TRN.execute_fetchindex()

@property
def active(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have an actual tests, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it through the function test_activate so it is implicitly tested.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling afc8707 on josenavas:plugin-installation-activate-cmd into * on biocore:plugin-installation*.

@antgonza
Copy link
Member

👍 , @wasade, could you review? Thanks.

Copy link
Contributor

@wasade wasade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few comments

The list filepath types that the new artifact type supports, and
if they're required or not in an artifact instance of this type

Raises
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the only type of unacceptable artifact a duplicate one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is creating a new artifact type (not a new artifact) and I couldn't think in any other case where a new type is unacceptable.

self.finish()


class ReloadPluginAPItestHandler(OauthBaseHandler):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this method idempotent? if not, should it be?

self.finish()


class ReloadPluginAPItestHandler(OauthBaseHandler):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question regarding CommandActivateHandler


obs = qdb.artifact.Artifact.types()
exp = [['BIOM', 'BIOM table'],
['Demultiplexed', 'Demultiplexed and QC sequeneces'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in sequences

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, opened #1961 cause this is a larger issue.

(r"/qiita_db/artifacts/(.*)/", ArtifactHandler),
(r"/qiita_db/prep_template/(.*)/data/", PrepTemplateDataHandler),
(r"/qiita_db/prep_template/(.*)/", PrepTemplateDBHandler),
(r"/qiita_db/references/(.*)/", ReferenceHandler),
(r"/qiita_db/plugins/(.*)/(.*)/commands/(.*)/activate/",
Copy link
Contributor

@wasade wasade Sep 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, why not do named regex? eg ?P<foo>[^/]+/?P<bar>[^/]+/?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what is the benefit?

@antgonza
Copy link
Member

@wasade thanks for review. Merging so we can continue reviews.

@antgonza antgonza merged commit 02dbb4d into qiita-spots:plugin-installation Sep 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants