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

Plugin install gui #1966

Merged

Conversation

josenavas
Copy link
Contributor

Depends on #1965 so review/merge that one first.

Modifies the command retrieval to retrieve only active commands (this way only active commands are shown in the GUI).

Makes sure that when Qiita starts, the plugins are called so they register their commands.

The call to create types need to be idempotent, instead of failing. So I changed it here.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9baf425 on josenavas:plugin-install-gui 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.

1 question.

except qdb.exceptions.QiitaDBDuplicateError as e:
raise HTTPError(400, str(e))
except qdb.exceptions.QiitaDBDuplicateError:
pass
Copy link
Member

Choose a reason for hiding this comment

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

Could you comment why this change?

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling a2ecb01 on josenavas:plugin-install-gui into * on biocore:plugin-installation*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling a2ecb01 on josenavas:plugin-install-gui into * on biocore:plugin-installation*.

Copy link
Member

@ElDeveloper ElDeveloper left a comment

Choose a reason for hiding this comment

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

This looks great, just a few minor questions.

except qdb.exceptions.QiitaDBDuplicateError:
# Ignoring this error as we want this endpoint in the rest api
# to be idempotent.
pass
Copy link
Member

Choose a reason for hiding this comment

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

I think you can also set the _reason to the response so that there's a difference between it already exists and everything went fine. Not blocking though. http://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.set_status

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"""Returns the commands that can process the given artifact types

Parameters
----------
artifact_type : list of str
The artifact types
active_only : bool
Copy link
Member

Choose a reason for hiding this comment

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

bool, optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

WHERE artifact_type IN %s"""
if active_only:
sql = "%s AND active = True" % sql
Copy link
Member

Choose a reason for hiding this comment

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

I almost thought there was a bug in there, was expecting something like sql += ' AND active = True'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

for s in qdb.software.Software.iter_active():
s.register_commands()

ioloop.add_timeout(time() + 0.5, callback_function)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe more convenient to use tornado's time? http://www.tornadoweb.org/en/stable/ioloop.html#tornado.ioloop.IOLoop.time

Not suer if it is available in the version of tornado we are using.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6671707 on josenavas:plugin-install-gui into * on biocore:plugin-installation*.

@ElDeveloper ElDeveloper merged commit 95bf847 into qiita-spots:plugin-installation Sep 30, 2016
@ElDeveloper
Copy link
Member

Thanks @josenavas

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6671707 on josenavas:plugin-install-gui into * on biocore:plugin-installation*.

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