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
58263161
Commit
58263161
authored
4 years ago
by
Daniel Lyons
Browse files
Options
Downloads
Patches
Plain Diff
On to the next error
parent
b08cdd9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
services/capability/src/capability/server.py
+1
-1
1 addition, 1 deletion
services/capability/src/capability/server.py
shared/workspaces/src/workspaces/services.py
+10
-5
10 additions, 5 deletions
shared/workspaces/src/workspaces/services.py
with
11 additions
and
6 deletions
services/capability/src/capability/server.py
+
1
−
1
View file @
58263161
...
...
@@ -32,7 +32,7 @@ class CapabilityRestService:
def
create
(
self
):
# create a capability request for this ... request
req
=
self
.
request
.
json_body
request
=
self
.
request
.
capabilities
.
create_request
(
req
.
capability_name
)
request
=
self
.
request
.
capabilities
.
create_request
(
req
)
return
request
@view_config
(
request_method
=
'
POST
'
,
route_name
=
'
submit_capability_request
'
,
renderer
=
'
json
'
)
...
...
This diff is collapsed.
Click to expand it.
shared/workspaces/src/workspaces/services.py
+
10
−
5
View file @
58263161
...
...
@@ -11,6 +11,7 @@ from typing import Dict, List, Union, Optional, Type
from
sqlalchemy.orm
import
Session
from
workflow.event_catcher
import
EventCatcher
from
workspaces.capability_interfaces
import
CapabilityIF
from
.capability_interfaces
import
CapabilityServiceIF
,
CapabilityQueueIF
,
CapabilityInfoIF
,
\
CapabilityEngineIF
,
CapabilityName
,
ParameterIF
...
...
@@ -91,9 +92,13 @@ class CapabilityInfo(CapabilityInfoIF):
Interface for data access object that can look up and record information about capabilities
and capability requests. Accesses and modifies the database.
"""
def
__init__
(
self
,
session
:
Session
):
self
.
session
=
session
def
lookup_capability
(
self
,
capability_name
:
str
)
->
CapabilityIF
:
return
self
.
session
.
query
(
Capability
).
filter_by
(
capability_name
=
capability_name
).
first
()
def
create_capability
(
self
,
name
:
CapabilityName
,
...
...
@@ -112,10 +117,10 @@ class CapabilityInfo(CapabilityInfoIF):
def
create_capability_request
(
self
,
capability
:
"
CapabilityIF
"
,
parameters
:
List
[
ParameterIF
],
future_products
:
List
[
FutureProductIF
],
versions
:
List
[
str
]
capability
_name
:
str
,
parameters
:
List
[
ParameterIF
]
=
None
,
future_products
:
List
[
FutureProductIF
]
=
None
,
versions
:
List
[
str
]
=
None
)
->
int
:
"""
Create new capability request and save it in the database
...
...
@@ -125,7 +130,7 @@ class CapabilityInfo(CapabilityInfoIF):
:param versions:
:return: Integer identifier of the request
"""
# FIXME: Parameters, future products and versions need valid str reprs
capability
=
self
.
lookup_capability
(
capability_name
)
request
=
CapabilityRequest
(
state
=
RequestState
.
Ready
.
name
,
capability
=
capability
.
id
,
...
...
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