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

api: Add MOCKED /workflows -endpoint #21

Merged
merged 1 commit into from Mar 31, 2017

Conversation

hjhsalo
Copy link
Contributor

@hjhsalo hjhsalo commented Mar 24, 2017

Signed-off-by: Harri Hirvonsalo harri.hirvonsalo@cern.ch

@app.route('/workflows', methods=['GET'])
def get_workflows():
"""Get all workflows.

Copy link
Member

Choose a reason for hiding this comment

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

PEP8 expects here and empty line. Try to plug some linter to your editor so you notice this kind of errors before! :)

"""Get all workflows.

.. http:get:: /workflows
Returns a JSON list with all the workflows.
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to keep empty lines between different blocks when documenting as in yadage_endpoint() docstring, in favor of readability


.. http:get:: /workflows
Returns a JSON list with all the workflows.
NOTE: Currently just a mock that can used e.g. to quickly
Copy link
Member

Choose a reason for hiding this comment

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

Regarding to the NOTE, it is rendered all in the same line and it doesn't look very pretty. I would do either one of the following things:

  • Add empty line between the endpoint description and the note.
        Returns a JSON list with all the workflows.

        NOTE: Currently just a mock that can used e.g. to quickly
        check if reana-workflow-controller is running.
  • Use sphinx .. warning:: so it gets nicely rendered with red background.
        .. warning::
            Not implemented, just a mock that can be used e.g. to quickly
            check if reana-workflow-controller is running.

p.s. mind the missing verb in ... just a mock that can [be] used ...

}
:resheader Content-Type: application/json
:statuscode 200: no error - the list has been returned.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Remember that you should reference this new endpoint in https://raw.githubusercontent.com/reanahub/reana-workflow-controller/master/docs/restapi.rst otherwise it doesn't get rendered

Copy link
Member

@diegodelemos diegodelemos left a comment

Choose a reason for hiding this comment

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

p.s. run test locally and build docs so you can see how the documentation gets rendered 😄

@tiborsimko
Copy link
Member

@hjhsalo Please squash the commits together at the end and use something like the following commit message style:

 api: mocked `/workflows` endpoint

* Adds mocked `/workflows` endpoint that provides a quick way to
  check if reana-workflow-engine is running. (closes #20)

This could be important later for automatic generation of release notes...

* Adds mocked `/workflows` endpoint that provides a quick way to
  check if reana-workflow-engine is running. (closes reanahub#20)

Signed-off-by: Harri Hirvonsalo <harri.hirvonsalo@cern.ch>
@diegodelemos diegodelemos merged commit 6eb1e81 into reanahub:master Mar 31, 2017
@diegodelemos diegodelemos self-assigned this Apr 12, 2017
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

3 participants