-
Notifications
You must be signed in to change notification settings - Fork 38
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
workflows: add validate function to workspace_root_path #397
Conversation
reana_server/rest/workspaces.py
Outdated
type: object | ||
properties: | ||
workspaces_available: | ||
type: list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small mistake here, it should be array
instead of list
. You can update reana_server openapi
docs and publish it to reana-commons
by doing the following:
cd reana_server
FLASK_APP=reana_server/app.py python ./scripts/generate_openapi_spec.py --publish
diff -q -w temp_openapi.json docs/openapi.json
mv temp_openapi.json docs/openapi.json
reana-dev git-submodule --update
edit: it seems you also have to specify types of list items, something like this:
...
properties:
workspaces_available:
type: array
items:
type: string
...
fccae78
to
871aa43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working nicely, just leaving minor comments 🚀
reana_server/rest/workflows.py
Outdated
@@ -401,10 +402,15 @@ def create_workflow(user): # noqa | |||
workflow_dict["operational_options"] = validate_operational_options( | |||
workflow_engine, reana_spec_file.get("inputs", {}).get("options", {}) | |||
) | |||
workspace_root_path = validate_workspace( | |||
reana_spec_file.get("workspace", {}).get("root_path", None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: None
is default option for .get()
, no need to specify it
reana_server/rest/workspaces.py
Outdated
Request failed. Internal controller error. | ||
""" | ||
try: | ||
if ADMIN_ALLOWED_WORKSPACES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comment, I think this part could be simplified if we would store the final list in reana-commons
871aa43
to
ee81a92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
P.S. tests are passing locally
…point to list available workspaces Closes reanahub/reana-client#546
ee81a92
to
d019dac
Compare
Codecov Report
@@ Coverage Diff @@
## master #397 +/- ##
==========================================
+ Coverage 49.92% 50.05% +0.12%
==========================================
Files 22 23 +1
Lines 1957 1974 +17
==========================================
+ Hits 977 988 +11
- Misses 980 986 +6
|
Goes on top of reanahub/reana-client#545 PR set, and reanahub/reana#532 PR set
Closes reanahub/reana-client#546