opentf-toolkit-nightly 0.57.0.dev1118__py3-none-any.whl → 0.57.0.dev1129__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/schemas.py CHANGED
@@ -44,7 +44,7 @@ WORKFLOWRESULT = 'opentestfactory.org/v1alpha1/WorkflowResult'
44
44
  GENERATORCOMMAND = 'opentestfactory.org/v1alpha1/GeneratorCommand'
45
45
  GENERATORRESULT = 'opentestfactory.org/v1/GeneratorResult'
46
46
 
47
- PROVIDERCOMMAND = 'opentestfactory.org/v1beta1/ProviderCommand'
47
+ PROVIDERCOMMAND = 'opentestfactory.org/v1/ProviderCommand'
48
48
  PROVIDERRESULT = 'opentestfactory.org/v1/ProviderResult'
49
49
 
50
50
  EXECUTIONCOMMAND = 'opentestfactory.org/v1/ExecutionCommand'
@@ -0,0 +1,151 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2019-09/schema#",
3
+ "title": "JSON SCHEMA for opentestfactory.org/v1 ProviderCommand manifests",
4
+ "type": "object",
5
+ "properties": {
6
+ "apiVersion": {
7
+ "const": "opentestfactory.org/v1"
8
+ },
9
+ "kind": {
10
+ "const": "ProviderCommand"
11
+ },
12
+ "metadata": {
13
+ "type": "object",
14
+ "properties": {
15
+ "name": {
16
+ "type": "string"
17
+ },
18
+ "namespace": {
19
+ "type": "string",
20
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
21
+ },
22
+ "workflow_id": {
23
+ "type": "string"
24
+ },
25
+ "job_id": {
26
+ "type": "string"
27
+ },
28
+ "job_origin": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "string"
32
+ }
33
+ },
34
+ "step_id": {
35
+ "type": "string"
36
+ },
37
+ "step_origin": {
38
+ "type": "array",
39
+ "items": {
40
+ "type": "string"
41
+ }
42
+ },
43
+ "labels": {
44
+ "type": "object",
45
+ "patternProperties": {
46
+ "^([a-zA-Z0-9-.]+/)?[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$": {
47
+ "type": "string"
48
+ }
49
+ },
50
+ "minProperties": 1,
51
+ "additionalProperties": false
52
+ }
53
+ },
54
+ "additionalProperties": true,
55
+ "required": [
56
+ "name",
57
+ "workflow_id",
58
+ "job_id",
59
+ "job_origin",
60
+ "step_id",
61
+ "step_origin"
62
+ ]
63
+ },
64
+ "runs-on": {
65
+ "$ref": "#/definitions/runs-on-maybe-empty-const-array"
66
+ },
67
+ "contexts": {
68
+ "type": "object"
69
+ },
70
+ "step": {
71
+ "type": "object",
72
+ "properties": {
73
+ "name": {
74
+ "type": "string"
75
+ },
76
+ "id": {
77
+ "type": "string"
78
+ },
79
+ "uses": {
80
+ "type": "string"
81
+ },
82
+ "with": {
83
+ "type": "object"
84
+ },
85
+ "variables": {
86
+ "$ref": "#/definitions/variables"
87
+ },
88
+ "timeout-minutes": {
89
+ "type": "number"
90
+ },
91
+ "continue-on-error": {
92
+ "type": "boolean"
93
+ },
94
+ "working-directory": {
95
+ "type": "string"
96
+ }
97
+ },
98
+ "required": [
99
+ "uses"
100
+ ],
101
+ "additionalProperties": false
102
+ }
103
+ },
104
+ "required": [
105
+ "apiVersion",
106
+ "kind",
107
+ "metadata",
108
+ "runs-on",
109
+ "step",
110
+ "contexts"
111
+ ],
112
+ "additionalProperties": false,
113
+ "definitions": {
114
+ "runs-on-maybe-empty-const-array": {
115
+ "type": "array",
116
+ "items": {
117
+ "type": "string",
118
+ "pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
119
+ },
120
+ "minItems": 0
121
+ },
122
+ "variables": {
123
+ "type": "object",
124
+ "patternProperties": {
125
+ "^[a-zA-Z0-9_]+$": {
126
+ "oneOf": [
127
+ {
128
+ "type": "string"
129
+ },
130
+ {
131
+ "type": "object",
132
+ "properties": {
133
+ "value": {
134
+ "type": "string"
135
+ },
136
+ "verbatim": {
137
+ "type": "boolean"
138
+ }
139
+ },
140
+ "required": [
141
+ "value"
142
+ ],
143
+ "additionalProperties": false
144
+ }
145
+ ]
146
+ }
147
+ },
148
+ "minProperties": 1
149
+ }
150
+ }
151
+ }
@@ -18,6 +18,7 @@ from typing import Any, Callable, Dict, Optional, Tuple
18
18
 
19
19
  import os
20
20
  import threading
21
+ import sys
21
22
 
22
23
  from collections import defaultdict
23
24
  from time import sleep
@@ -478,10 +479,23 @@ def _subscribe(
478
479
  manifest.get('inputs', {}),
479
480
  manifest.get('additionalInputs'),
480
481
  )
481
- context[OUTPUTS_KEY][(cat_prefix, cat, cat_version)] = {
482
- k: v['value'] if isinstance(v, dict) else v
483
- for k, v in manifest.get('outputs', {}).items()
484
- }
482
+ try:
483
+ context[OUTPUTS_KEY][(cat_prefix, cat, cat_version)] = {
484
+ k: v['value'] if isinstance(v, dict) else v
485
+ for k, v in manifest.get('outputs', {}).items()
486
+ }
487
+ except KeyError as err:
488
+ plugin.logger.error(
489
+ "Invalid descriptor 'outputs' section, could not find key %s in: %s.",
490
+ err,
491
+ manifest.get('outputs', {}),
492
+ )
493
+ sys.exit(2)
494
+ except Exception as err:
495
+ plugin.logger.error(
496
+ "Invalid descriptor 'outputs' section, got %s while parsing outputs.", err
497
+ )
498
+ sys.exit(2)
485
499
  return subscribe(kind=kind, target='inbox', app=plugin, labels=labels)
486
500
 
487
501
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: opentf-toolkit-nightly
3
- Version: 0.57.0.dev1118
3
+ Version: 0.57.0.dev1129
4
4
  Summary: OpenTestFactory Orchestrator Toolkit
5
5
  Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
6
6
  Author: Martin Lafaix
@@ -4,12 +4,13 @@ opentf/commons/config.py,sha256=dyus4K5Zdmcftc3Y9Z1YRkzA1KwiRLHoeAlg2_A49QM,7876
4
4
  opentf/commons/datasources.py,sha256=OcwVLPGK0iCnTgHu3RJ9C1U3AUs5LTKvyOTQZFIh7Ek,25996
5
5
  opentf/commons/expressions.py,sha256=jM_YKXVOFhvOE2aE2IuacuvxhIsOYTFs2oQkpcbWR6g,19645
6
6
  opentf/commons/pubsub.py,sha256=DVrSara5FRfNdPBwXKUkTobqGki0RPDehylTEFcJnFc,7341
7
- opentf/commons/schemas.py,sha256=QtgVr_I2PAUAAQbutrhZ8y2AM-0w9GOQ6CztxZkkCYw,4265
7
+ opentf/commons/schemas.py,sha256=Ub6klLnDh_O44r0aZzsspMV3sx-An0lClfim1dyASZQ,4260
8
8
  opentf/commons/selectors.py,sha256=DEpLgRAr5HXSpSYI4liXP2hLUTvOSexFa9Vfa1xIQTk,7134
9
9
  opentf/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  opentf/schemas/abac.opentestfactory.org/v1alpha1/Policy.json,sha256=JXsfNAPSEYggeyaDutSQBeG38o4Bmcr70dPLWWeqIh8,2105
11
11
  opentf/schemas/opentestfactory.org/v1/ExecutionCommand.json,sha256=UtmAlTaYdPSZDeQnx-ocX8IonyEPWoNmgDkHwQwQxWE,4126
12
12
  opentf/schemas/opentestfactory.org/v1/GeneratorResult.json,sha256=neoFocJGkVTQQPtnG5xnbqNLX8ivFBJbanbbPweId7s,16608
13
+ opentf/schemas/opentestfactory.org/v1/ProviderCommand.json,sha256=EU4kvEKxlqpH2IkLZ1HdBealuG6C0YzPkAtI7dNrfHg,4427
13
14
  opentf/schemas/opentestfactory.org/v1/ProviderResult.json,sha256=Ej4zhCE3rCqCGKcaeAoIHwSJTV_7fw-rAxhJ52qA-Gs,9641
14
15
  opentf/schemas/opentestfactory.org/v1/Workflow.json,sha256=WAFvCAIxmp22-AN1wPuOkd3BYs8UP5u3hj74NnlO3vU,22945
15
16
  opentf/schemas/opentestfactory.org/v1/WorkflowCanceled.json,sha256=BCWxnm3rt4VWh9GXkIhdNY9JYohFWxi9Wg3JjXIavaU,1694
@@ -52,11 +53,11 @@ opentf/schemas/opentestfactory.org/v1beta1/Workflow.json,sha256=QZ8mM9PhzsI9gTmw
52
53
  opentf/schemas/opentestfactory.org/v1beta2/ServiceConfig.json,sha256=rEvK2YWL5lG94_qYgR_GnLWNsaQhaQ-2kuZdWJr5NnY,3517
53
54
  opentf/scripts/launch_java_service.sh,sha256=S0jAaCuv2sZy0Gf2NGBuPX-eD531rcM-b0fNyhmzSjw,2423
54
55
  opentf/scripts/startup.py,sha256=Da2zo93pBWbdRmj-wgekgLcF94rpNc3ZkbvR8R0w8XY,21279
55
- opentf/toolkit/__init__.py,sha256=nbllYXON3Rzd-hU7Cred7r4hPaCPbfSJmoY7cQ6RShc,22589
56
+ opentf/toolkit/__init__.py,sha256=mYeJPZ92ulbTBItqEsZgF4nnuRh6G19QPY3Jxc92ifc,23028
56
57
  opentf/toolkit/channels.py,sha256=6xcVKHUK2FdyVKIQmPQbakngfVuQDzCcD_lInOdKpro,17171
57
58
  opentf/toolkit/core.py,sha256=6nud1vqcfjs9swZu_Z-rbvdbejtrlSjOd8eZXIF0ChE,9795
58
- opentf_toolkit_nightly-0.57.0.dev1118.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
59
- opentf_toolkit_nightly-0.57.0.dev1118.dist-info/METADATA,sha256=fr_0Yv5d6o47lQMzVuXmoXRs9sfCLFh0nIfG4PcZggM,1946
60
- opentf_toolkit_nightly-0.57.0.dev1118.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
61
- opentf_toolkit_nightly-0.57.0.dev1118.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
62
- opentf_toolkit_nightly-0.57.0.dev1118.dist-info/RECORD,,
59
+ opentf_toolkit_nightly-0.57.0.dev1129.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
60
+ opentf_toolkit_nightly-0.57.0.dev1129.dist-info/METADATA,sha256=tmXgnoeS1Ql8EdjnWk8L0EehqXWtMJHZWFtO0GgJIqk,1946
61
+ opentf_toolkit_nightly-0.57.0.dev1129.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
62
+ opentf_toolkit_nightly-0.57.0.dev1129.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
63
+ opentf_toolkit_nightly-0.57.0.dev1129.dist-info/RECORD,,