Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Commits
26b37862
Commit
26b37862
authored
4 years ago
by
Charlotte Hausman
Browse files
Options
Downloads
Patches
Plain Diff
workflow and capability request submission
parent
df79a180
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!66
workflow and capability request submission
Pipeline
#465
passed
4 years ago
Stage: build-dev
Stage: unit-test-dev
Stage: push-dev
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/workflow/src/workflow/server.py
+17
-9
17 additions, 9 deletions
services/workflow/src/workflow/server.py
with
17 additions
and
9 deletions
services/workflow/src/workflow/server.py
+
17
−
9
View file @
26b37862
...
...
@@ -27,6 +27,11 @@ def lookup_workflow(request):
return
request
.
info
.
lookup_workflow_definition
(
request
.
matchdict
[
"
name
"
])
def
lookup_workflow_json
(
request
):
req
=
request
.
json_body
return
request
.
info
.
lookup_workflow_definition
(
req
[
"
workflow
"
])
def
lookup_request
(
request
):
return
request
.
info
.
lookup_workflow_request
(
request
.
matchdict
[
"
request_id
"
])
...
...
@@ -94,12 +99,9 @@ class WorkflowRequestRestService:
Audience: front-end and CLI
:return:
"""
# all we should have to do here is take the WorkflowRequest from the context and
# hand it to WorkflowInfo to save it, but we're still conflating
# workflows and workflow requests right now
request
=
self
.
request
.
info
.
create_workflow_request
(
self
.
request
.
context
,
self
.
request
.
GET
.
getall
(
"
args
"
)
)
req
=
self
.
request
.
json_body
request
=
self
.
request
.
info
.
create_workflow_request
(
req
[
"
workflow
"
],
req
[
"
args
"
])
return
request
@view_config
(
request_method
=
"
POST
"
,
route_name
=
"
submit_workflow_request
"
)
...
...
@@ -111,8 +113,9 @@ class WorkflowRequestRestService:
:return:
"""
print
(
f
"
Submitting workflow
{
self
.
request
.
context
}
"
)
return
self
.
request
.
workflows
.
execute
(
self
.
request
.
context
,
self
.
request
.
GET
.
getall
(
"
files
"
)
self
.
request
.
context
,
self
.
request
.
json_body
[
"
files
"
]
)
...
...
@@ -246,10 +249,12 @@ def main(global_config, **settings):
config
.
add_route
(
"
workflows
"
,
"
/workflows
"
)
config
.
add_route
(
"
workflow
"
,
"
/workflows/{name}
"
,
factory
=
lookup_workflow
)
# parameters are passed with json: {workflow:<name>, args: <args>}
config
.
add_route
(
"
create_workflow_request
"
,
"
/workflows/
{name}/
requests/create
"
,
factory
=
lookup_workflow
,
"
/workflows/requests/create
"
,
factory
=
lookup_workflow
_json
,
)
config
.
add_route
(
"
workflow_request
"
,
...
...
@@ -266,6 +271,9 @@ def main(global_config, **settings):
"
/workflows/requests/{request_id}/files/{filename}
"
,
factory
=
lookup_request
,
)
# parameters are passed with json: {files:{<name>}}.
# Use empty braces for no additional files
config
.
add_route
(
"
submit_workflow_request
"
,
"
/workflows/requests/{request_id}/submit
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment