opentf-toolkit-nightly 0.57.0.dev1109__py3-none-any.whl → 0.57.0.dev1115__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opentf/commons/__init__.py +7 -25
- opentf/commons/datasources.py +1 -1
- {opentf_toolkit_nightly-0.57.0.dev1109.dist-info → opentf_toolkit_nightly-0.57.0.dev1115.dist-info}/METADATA +1 -1
- {opentf_toolkit_nightly-0.57.0.dev1109.dist-info → opentf_toolkit_nightly-0.57.0.dev1115.dist-info}/RECORD +7 -7
- {opentf_toolkit_nightly-0.57.0.dev1109.dist-info → opentf_toolkit_nightly-0.57.0.dev1115.dist-info}/LICENSE +0 -0
- {opentf_toolkit_nightly-0.57.0.dev1109.dist-info → opentf_toolkit_nightly-0.57.0.dev1115.dist-info}/WHEEL +0 -0
- {opentf_toolkit_nightly-0.57.0.dev1109.dist-info → opentf_toolkit_nightly-0.57.0.dev1115.dist-info}/top_level.txt +0 -0
opentf/commons/__init__.py
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Union
|
|
18
18
|
|
|
19
|
-
import itertools
|
|
20
19
|
import logging
|
|
20
|
+
import os
|
|
21
21
|
import sys
|
|
22
22
|
|
|
23
23
|
from functools import wraps
|
|
@@ -289,7 +289,7 @@ def authorizer(resource: str, verb: str):
|
|
|
289
289
|
if not payload:
|
|
290
290
|
return make_status_response('Unauthorized', 'No JWT payload.')
|
|
291
291
|
user = payload['sub']
|
|
292
|
-
if
|
|
292
|
+
if 'namespaces' not in g and not is_user_authorized(
|
|
293
293
|
user, resource, verb, current_app.config['CONTEXT']
|
|
294
294
|
):
|
|
295
295
|
return make_status_response(
|
|
@@ -721,15 +721,14 @@ def validate_pipeline(
|
|
|
721
721
|
"""
|
|
722
722
|
try:
|
|
723
723
|
jobs = {}
|
|
724
|
-
for
|
|
725
|
-
needs
|
|
726
|
-
if needs:
|
|
724
|
+
for job_name, job_definition in workflow['jobs'].items():
|
|
725
|
+
if needs := job_definition.get('needs'):
|
|
727
726
|
if isinstance(needs, list):
|
|
728
|
-
jobs[
|
|
727
|
+
jobs[job_name] = set(needs)
|
|
729
728
|
else:
|
|
730
|
-
jobs[
|
|
729
|
+
jobs[job_name] = {needs}
|
|
731
730
|
else:
|
|
732
|
-
jobs[
|
|
731
|
+
jobs[job_name] = set()
|
|
733
732
|
for src, dependencies in jobs.items():
|
|
734
733
|
for dep in dependencies:
|
|
735
734
|
if dep not in jobs:
|
|
@@ -741,20 +740,3 @@ def validate_pipeline(
|
|
|
741
740
|
return True, [list(items) for items in toposort(jobs)]
|
|
742
741
|
except CircularDependencyError as err:
|
|
743
742
|
return False, str(err)
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
def get_execution_sequence(workflow: Dict[str, Any]) -> Optional[List[str]]:
|
|
747
|
-
"""Return an execution sequence for jobs.
|
|
748
|
-
|
|
749
|
-
# Required parameters
|
|
750
|
-
|
|
751
|
-
- workflow: a dictionary
|
|
752
|
-
|
|
753
|
-
# Returned value
|
|
754
|
-
|
|
755
|
-
`None` or a list of jobs names.
|
|
756
|
-
"""
|
|
757
|
-
ok, result = validate_pipeline(workflow)
|
|
758
|
-
if ok:
|
|
759
|
-
return list(itertools.chain.from_iterable(result))
|
|
760
|
-
return None
|
opentf/commons/datasources.py
CHANGED
|
@@ -557,7 +557,7 @@ def get_testcases(
|
|
|
557
557
|
testresults = get_testresults(events)
|
|
558
558
|
|
|
559
559
|
if not testresults:
|
|
560
|
-
|
|
560
|
+
return {}
|
|
561
561
|
try:
|
|
562
562
|
testcases = _extract_testcases(testresults, state, scope, events)
|
|
563
563
|
if not testcases:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentf-toolkit-nightly
|
|
3
|
-
Version: 0.57.0.
|
|
3
|
+
Version: 0.57.0.dev1115
|
|
4
4
|
Summary: OpenTestFactory Orchestrator Toolkit
|
|
5
5
|
Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
|
|
6
6
|
Author: Martin Lafaix
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
opentf/commons/__init__.py,sha256=
|
|
1
|
+
opentf/commons/__init__.py,sha256=AnnUMqwHwYnZxMhGdAwFGNbKIcr4HNVRUEfUuB2ub-c,22481
|
|
2
2
|
opentf/commons/auth.py,sha256=bM2Z3kxm2Wku1lKXaRAIg37LHvXWAXIZIqjplDfN2P8,15899
|
|
3
3
|
opentf/commons/config.py,sha256=dyus4K5Zdmcftc3Y9Z1YRkzA1KwiRLHoeAlg2_A49QM,7876
|
|
4
|
-
opentf/commons/datasources.py,sha256=
|
|
4
|
+
opentf/commons/datasources.py,sha256=a9oPZ0xKYk5lBXUaRVzNUpTvbAZkPoLKYt2v5K2Sow0,25995
|
|
5
5
|
opentf/commons/expressions.py,sha256=jM_YKXVOFhvOE2aE2IuacuvxhIsOYTFs2oQkpcbWR6g,19645
|
|
6
6
|
opentf/commons/pubsub.py,sha256=DVrSara5FRfNdPBwXKUkTobqGki0RPDehylTEFcJnFc,7341
|
|
7
7
|
opentf/commons/schemas.py,sha256=QtgVr_I2PAUAAQbutrhZ8y2AM-0w9GOQ6CztxZkkCYw,4265
|
|
@@ -55,8 +55,8 @@ opentf/scripts/startup.py,sha256=Da2zo93pBWbdRmj-wgekgLcF94rpNc3ZkbvR8R0w8XY,212
|
|
|
55
55
|
opentf/toolkit/__init__.py,sha256=nbllYXON3Rzd-hU7Cred7r4hPaCPbfSJmoY7cQ6RShc,22589
|
|
56
56
|
opentf/toolkit/channels.py,sha256=6xcVKHUK2FdyVKIQmPQbakngfVuQDzCcD_lInOdKpro,17171
|
|
57
57
|
opentf/toolkit/core.py,sha256=6nud1vqcfjs9swZu_Z-rbvdbejtrlSjOd8eZXIF0ChE,9795
|
|
58
|
-
opentf_toolkit_nightly-0.57.0.
|
|
59
|
-
opentf_toolkit_nightly-0.57.0.
|
|
60
|
-
opentf_toolkit_nightly-0.57.0.
|
|
61
|
-
opentf_toolkit_nightly-0.57.0.
|
|
62
|
-
opentf_toolkit_nightly-0.57.0.
|
|
58
|
+
opentf_toolkit_nightly-0.57.0.dev1115.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
59
|
+
opentf_toolkit_nightly-0.57.0.dev1115.dist-info/METADATA,sha256=Dm2fDUAvT7anuitd_q1I3E4Sf-SF-pTcMyy-JXvi2KE,1946
|
|
60
|
+
opentf_toolkit_nightly-0.57.0.dev1115.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
61
|
+
opentf_toolkit_nightly-0.57.0.dev1115.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
|
|
62
|
+
opentf_toolkit_nightly-0.57.0.dev1115.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|