Skip to content

Commit db88433

Browse files
authored
Merge pull request #351 from keboola/odin-SOX-431
Allow integers for orchestrationTaskId
2 parents bea8c0d + 6b21aed commit db88433

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

src/JobFactory/FullJobDefinition.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,6 @@ protected function getRootDefinition(TreeBuilder $treeBuilder): ArrayNodeDefinit
193193
->beforeNormalization()->always($this->getStringNormalizer())->end()
194194
->end()
195195
->scalarNode('orchestrationTaskId')
196-
->validate()
197-
->ifTrue(fn($v) => $v !== null && !is_string($v))
198-
->thenInvalid('value must be a string')
199-
->end()
200196
->validate()
201197
->ifTrue(fn($v) => $v === '')
202198
->thenInvalid('value cannot be empty string')

src/JobFactory/NewJobDefinition.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ protected function getRootDefinition(TreeBuilder $treeBuilder): ArrayNodeDefinit
8686
->end()
8787
->scalarNode('orchestrationJobId')->end()
8888
->scalarNode('orchestrationTaskId')
89-
->validate()
90-
->ifTrue(fn($v) => $v !== null && !is_string($v))
91-
->thenInvalid('value must be a string')
92-
->end()
9389
->validate()
9490
->ifTrue(fn($v) => $v === '')
9591
->thenInvalid('value cannot be empty string')

tests/JobFactory/FullJobDefinitionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public function invalidJobProvider(): array
409409
],
410410
'#The value "invalid" is not allowed for path "job.branchType". Permissible values: "default", "dev"#',
411411
],
412-
'orchestrationTaskId not string' => [
412+
'orchestrationTaskId not scalar' => [
413413
[
414414
'#tokenString' => getenv('TEST_STORAGE_API_TOKEN'),
415415
'id' => '12345',
@@ -421,9 +421,9 @@ public function invalidJobProvider(): array
421421
'configId' => '123',
422422
'componentId' => 'keboola.test',
423423
'mode' => 'run',
424-
'orchestrationTaskId' => 134,
424+
'orchestrationTaskId' => [123],
425425
],
426-
'/Invalid configuration for path "job.orchestrationTaskId": value must be a string/',
426+
'#Invalid type for path "job.orchestrationTaskId". Expected "?scalar"?, but got "?array"?.#',
427427
],
428428
'orchestrationTaskId empty string' => [
429429
[

tests/JobFactory/NewJobDefinitionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ public function invalidJobProvider(): array
154154
],
155155
'#Invalid type for path "job.parentRunId". Expected "?scalar"?, but got "?array"?.#',
156156
],
157-
'orchestrationTaskId not string' => [
157+
'orchestrationTaskId not scalar' => [
158158
[
159159
'#tokenString' => getenv('TEST_STORAGE_API_TOKEN'),
160160
'configId' => '123',
161161
'componentId' => 'keboola.test',
162162
'result' => [],
163-
'orchestrationTaskId' => 134,
163+
'orchestrationTaskId' => [134],
164164
],
165-
'/Invalid configuration for path "job.orchestrationTaskId": value must be a string/',
165+
'#Invalid type for path "job.orchestrationTaskId". Expected "?scalar"?, but got "?array"?.#',
166166
],
167167
'orchestrationTaskId empty string' => [
168168
[

0 commit comments

Comments
 (0)