Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Merge requests
!42
Interdomain Component
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Interdomain Component
feat/interdomain
into
develop
Overview
0
Commits
45
Pipelines
0
Changes
6
Merged
Lluis Gifre Renom
requested to merge
feat/interdomain
into
develop
2 years ago
Overview
0
Commits
45
Pipelines
0
Changes
6
Expand
extended interdomain component to support DLT and non-DLT cases
minor corrections in other components/tests
Edited
2 years ago
by
Lluis Gifre Renom
0
0
Merge request reports
Compare
develop
version 5
77a1d88b
2 years ago
version 4
f2f95184
2 years ago
version 3
c05075fe
2 years ago
version 2
c69030e5
2 years ago
version 1
2a4b1996
2 years ago
develop (base)
and
latest version
latest version
9663240d
45 commits,
2 years ago
version 5
77a1d88b
44 commits,
2 years ago
version 4
f2f95184
43 commits,
2 years ago
version 3
c05075fe
42 commits,
2 years ago
version 2
c69030e5
41 commits,
2 years ago
version 1
2a4b1996
40 commits,
2 years ago
6 files
+
58
−
60
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
src/common/tools/service/ConstraintsChecker.py deleted
100644 → 0
+
0
−
38
Options
import
grpc
,
logging
from
typing
import
Dict
,
List
,
Set
,
Tuple
from
common.Checkers
import
chk_string
from
common.exceptions.ServiceException
import
ServiceException
from
service.proto.context_pb2
import
Constraint
def
check_constraint
(
logger
:
logging
.
Logger
,
constraint_number
:
int
,
parent_name
:
str
,
constraint
:
Constraint
,
add_constraints
:
Dict
[
str
,
Dict
[
str
,
Set
[
str
]]])
->
Tuple
[
str
,
str
]:
try
:
constraint_type
=
chk_string
(
'
constraint[#{}].constraint_type
'
.
format
(
constraint_number
),
constraint
.
constraint_type
,
allow_empty
=
False
)
constraint_value
=
chk_string
(
'
constraint[#{}].constraint_value
'
.
format
(
constraint_number
),
constraint
.
constraint_value
,
allow_empty
=
False
)
except
Exception
as
e
:
logger
.
exception
(
'
Invalid arguments:
'
)
raise
ServiceException
(
grpc
.
StatusCode
.
INVALID_ARGUMENT
,
str
(
e
))
if
constraint_type
in
add_constraints
:
msg
=
'
Duplicated ConstraintType({}) in {}.
'
msg
=
msg
.
format
(
constraint_type
,
parent_name
)
raise
ServiceException
(
grpc
.
StatusCode
.
INVALID_ARGUMENT
,
msg
)
add_constraints
[
constraint_type
]
=
constraint_value
return
constraint_type
,
constraint_value
def
check_constraints
(
logger
:
logging
.
Logger
,
parent_name
:
str
,
constraints
):
add_constraints
:
Dict
[
str
,
str
]
=
{}
constraint_tuples
:
List
[
Tuple
[
str
,
str
]]
=
[]
for
constraint_number
,
constraint
in
enumerate
(
constraints
):
_parent_name
=
'
Constraint(#{}) of {}
'
.
format
(
constraint_number
,
parent_name
)
constraint_type
,
constraint_value
=
check_constraint
(
logger
,
constraint_number
,
_parent_name
,
constraint
,
add_constraints
)
constraint_tuples
.
append
((
constraint_type
,
constraint_value
))
return
constraint_tuples
Loading