Skip to content

Commit f997891

Browse files
committed
CH-109 base libraries update
1 parent 8f83e50 commit f997891

12 files changed

Lines changed: 107 additions & 65 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{"packageName": "samples"}

applications/samples/backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
88
swagger-ui-bundle >= 0.0.2
99
python_dateutil >= 2.6.0
1010
setuptools >= 21.0.0
11-
Flask == 1.1.2
11+
Flask == 2.1.1

applications/samples/backend/samples/models/base_model_.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
class Model(object):
1212
# openapiTypes: The key is attribute name and the
1313
# value is attribute type.
14-
openapi_types = {}
14+
openapi_types: typing.Dict[str, type] = {}
1515

1616
# attributeMap: The key is attribute name and the
1717
# value is json key in definition.
18-
attribute_map = {}
18+
attribute_map: typing.Dict[str, str] = {}
1919

2020
@classmethod
2121
def from_dict(cls: typing.Type[T], dikt) -> T:

applications/samples/backend/samples/models/sample_resource.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def from_dict(cls, dikt) -> 'SampleResource':
5656
def a(self):
5757
"""Gets the a of this SampleResource.
5858
59+
# noqa: E501
5960
6061
:return: The a of this SampleResource.
6162
:rtype: float
@@ -66,6 +67,7 @@ def a(self):
6667
def a(self, a):
6768
"""Sets the a of this SampleResource.
6869
70+
# noqa: E501
6971
7072
:param a: The a of this SampleResource.
7173
:type a: float
@@ -79,6 +81,7 @@ def a(self, a):
7981
def b(self):
8082
"""Gets the b of this SampleResource.
8183
84+
# noqa: E501
8285
8386
:return: The b of this SampleResource.
8487
:rtype: float
@@ -89,6 +92,7 @@ def b(self):
8992
def b(self, b):
9093
"""Sets the b of this SampleResource.
9194
95+
# noqa: E501
9296
9397
:param b: The b of this SampleResource.
9498
:type b: float
@@ -100,6 +104,7 @@ def b(self, b):
100104
def id(self):
101105
"""Gets the id of this SampleResource.
102106
107+
# noqa: E501
103108
104109
:return: The id of this SampleResource.
105110
:rtype: float
@@ -110,6 +115,7 @@ def id(self):
110115
def id(self, id):
111116
"""Sets the id of this SampleResource.
112117
118+
# noqa: E501
113119
114120
:param id: The id of this SampleResource.
115121
:type id: float

applications/samples/backend/samples/openapi/openapi.yaml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ servers:
1212
tags:
1313
- name: auth
1414
- name: workflows
15-
- name: resource
15+
- description: ""
16+
name: resource
1617
paths:
1718
/error:
1819
get:
@@ -90,8 +91,8 @@ paths:
9091
schema:
9192
type: string
9293
description: Operation result
93-
summary: Send a synchronous operation and get results using the event queue.
94-
Just a sum, but in the cloud
94+
summary: "Send a synchronous operation and get results using the event queue.\
95+
\ Just a sum, but in the cloud"
9596
tags:
9697
- workflows
9798
x-openapi-router-controller: samples.controllers.workflows_controller
@@ -112,9 +113,9 @@ paths:
112113
- test
113114
x-openapi-router-controller: samples.controllers.test_controller
114115
/sampleresources:
115-
description: The REST endpoint/path used to list and create zero or more `SampleResource`
116-
entities. This path contains a `GET` and `POST` operation to perform the list
117-
and create tasks, respectively.
116+
description: "The REST endpoint/path used to list and create zero or more `SampleResource`\
117+
\ entities. This path contains a `GET` and `POST` operation to perform the\
118+
\ list and create tasks, respectively."
118119
get:
119120
description: Gets a list of all `SampleResource` entities.
120121
operationId: get_sample_resources
@@ -176,9 +177,9 @@ paths:
176177
tags:
177178
- resource
178179
x-openapi-router-controller: samples.controllers.resource_controller
179-
description: The REST endpoint/path used to get, update, and delete single instances
180-
of an `SampleResource`. This path contains `GET`, `PUT`, and `DELETE` operations
181-
used to perform the get, update, and delete tasks, respectively.
180+
description: "The REST endpoint/path used to get, update, and delete single instances\
181+
\ of an `SampleResource`. This path contains `GET`, `PUT`, and `DELETE` operations\
182+
\ used to perform the get, update, and delete tasks, respectively."
182183
get:
183184
description: Gets the details of a single instance of a `SampleResource`.
184185
operationId: get_sample_resource
@@ -229,7 +230,7 @@ paths:
229230
"202":
230231
description: Successful response.
231232
"400":
232-
description: Parameter must be integer, payload must be of type SampleResource
233+
description: "Parameter must be integer, payload must be of type SampleResource"
233234
"404":
234235
description: Resource not found
235236
summary: Update a SampleResource
@@ -250,7 +251,7 @@ paths:
250251
type: string
251252
description: Check if token is valid
252253
"401":
253-
description: invalid token, unauthorized
254+
description: "invalid token, unauthorized"
254255
security:
255256
- bearerAuth: []
256257
summary: Check if the token is valid. Get a token by logging into the base url
@@ -270,7 +271,7 @@ paths:
270271
type: string
271272
description: Check if token is valid
272273
"401":
273-
description: invalid token, unauthorized
274+
description: "invalid token, unauthorized"
274275
security:
275276
- cookieAuth: []
276277
summary: Check if the token is valid. Get a token by logging into the base url
@@ -306,18 +307,22 @@ components:
306307
title: inline_response_202
307308
type: object
308309
SampleResource:
310+
description: ""
309311
example:
310312
a: 0.8008281904610115
311313
b: 6.027456183070403
312314
id: 1.4658129805029452
313315
properties:
314316
a:
317+
description: ""
315318
title: a
316319
type: number
317320
b:
321+
description: ""
318322
title: b
319323
type: number
320324
id:
325+
description: ""
321326
title: id
322327
type: number
323328
required:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest~=4.6.7 # needed for python 2.7+3.4
1+
pytest~=7.1.0
22
pytest-cov>=2.8.1
3-
pytest-randomly==1.2.3 # needed for python 2.7+3.4
4-
Flask-Testing==0.8.0
3+
pytest-randomly>=1.2.3
4+
Flask-Testing==0.8.1

applications/samples/frontend/src/rest/common.ts

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,34 @@ export const setOAuthToObject = async function (object: any, name: string, scope
8383
}
8484
}
8585

86+
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
87+
if (typeof parameter === "object") {
88+
if (Array.isArray(parameter)) {
89+
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
90+
}
91+
else {
92+
Object.keys(parameter).forEach(currentKey =>
93+
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
94+
);
95+
}
96+
}
97+
else {
98+
if (urlSearchParams.has(key)) {
99+
urlSearchParams.append(key, parameter);
100+
}
101+
else {
102+
urlSearchParams.set(key, parameter);
103+
}
104+
}
105+
}
106+
86107
/**
87108
*
88109
* @export
89110
*/
90111
export const setSearchParams = function (url: URL, ...objects: any[]) {
91112
const searchParams = new URLSearchParams(url.search);
92-
for (const object of objects) {
93-
for (const key in object) {
94-
if (Array.isArray(object[key])) {
95-
searchParams.delete(key);
96-
for (const item of object[key]) {
97-
searchParams.append(key, item);
98-
}
99-
} else {
100-
searchParams.set(key, object[key]);
101-
}
102-
}
103-
}
113+
setFlattenedQueryParams(searchParams, objects);
104114
url.search = searchParams.toString();
105115
}
106116

deployment/codefresh-test.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,7 @@ steps:
445445
- kubectl config use-context ${{CLUSTER_NAME}}
446446
- kubectl config set-context --current --namespace=test-${{NAMESPACE_BASENAME}}
447447
- kubectl rollout status deployment/accounts
448-
- kubectl rollout status deployment/argo-server-gk
449448
- kubectl rollout status deployment/samples
450-
- kubectl rollout status deployment/samples-gk
451449
- kubectl rollout status deployment/common
452450
- kubectl rollout status deployment/workflows
453451
- sleep 60
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
certifi >= 14.5.14
2-
frozendict ~= 2.3.4
3-
python-dateutil ~= 2.7.0
4-
setuptools >= 21.0.0
5-
typing_extensions ~= 4.3.0
6-
urllib3 ~= 1.26.7
1+
certifi
2+
frozendict
3+
python-dateutil
4+
setuptools
5+
typing_extensions
6+
urllib3
Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1-
asn1crypto==0.24.0
2-
certifi==2019.3.9
3-
chardet==3.0.4
4-
idna==2.8
5-
pyjwt==2.6.0
6-
pyOpenSSL<22.1.0
7-
PySocks==1.6.8
8-
requests>=2.27.0
9-
ruamel.yaml==0.17.21
10-
six==1.16.0
11-
urllib3>=1.26
12-
pykafka==2.8.0
13-
pyaml
14-
kafka-python
15-
kubernetes
16-
sentry-sdk[flask]==0.14.4
17-
python-keycloak==2.6.0
181
argo-workflows==5.0.0
19-
cryptography<3.4
20-
hypothesis==6.54.2
21-
jsonschema<4.0.0
22-
httpx==0.23.0
2+
blinker==1.7.0
3+
cachetools==5.3.2
4+
certifi==2023.11.17
5+
cffi==1.16.0
6+
charset-normalizer==3.3.2
7+
click==8.1.7
8+
cryptography==41.0.7
9+
deprecation==2.1.0
10+
ecdsa==0.18.0
11+
idna==3.6
12+
importlib-metadata==7.0.1
13+
itsdangerous==2.1.2
14+
Jinja2==3.1.3
15+
kafka-python==2.0.2
16+
kubernetes==29.0.0
17+
MarkupSafe==2.1.3
18+
oauthlib==3.2.2
19+
oyaml==1.0
20+
packaging==23.2
21+
pyaml==23.12.0
22+
pyasn1==0.5.1
23+
pyasn1-modules==0.3.0
24+
pycparser==2.21
25+
pyhumps==3.8.0
26+
PyJWT==2.8.0
27+
python-dateutil==2.8.2
28+
python-jose==3.3.0
29+
python-keycloak==3.7.0
30+
PyYAML==6.0.1
31+
requests==2.31.0
32+
requests-oauthlib==1.3.1
33+
requests-toolbelt==1.0.0
34+
rsa==4.9
35+
sentry-sdk==1.39.2
36+
six==1.16.0
37+
urllib3==2.1.0
38+
Werkzeug==3.0.1
39+
zipp==3.17.0

0 commit comments

Comments
 (0)