Skip to content

Commit cd59f44

Browse files
authored
fix(specs): enable watcher for push [skip-bc] (#4229)
1 parent fd58f03 commit cd59f44

File tree

17 files changed

+59
-57
lines changed

17 files changed

+59
-57
lines changed

specs/ingestion/common/schemas/common.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,25 @@ Window:
9696
required:
9797
- startDate
9898
- endDate
99+
100+
WatchResponse:
101+
type: object
102+
additionalProperties: false
103+
properties:
104+
runID:
105+
$ref: './common.yml#/runID'
106+
data:
107+
type: array
108+
description: when used with discovering or validating sources, the sampled data of your source is returned.
109+
items:
110+
type: object
111+
events:
112+
description: in case of error, observability events will be added to the response, if any.
113+
type: array
114+
items:
115+
$ref: '../../common/schemas/event.yml#/Event'
116+
message:
117+
description: a message describing the outcome of a validate run.
118+
type: string
119+
required:
120+
- message

specs/ingestion/common/schemas/source.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -476,28 +476,6 @@ sourceShopifyBase:
476476
x-discriminator-fields:
477477
- shopURL
478478

479-
SourceWatchResponse:
480-
type: object
481-
additionalProperties: false
482-
properties:
483-
runID:
484-
$ref: './common.yml#/runID'
485-
data:
486-
type: array
487-
description: depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).
488-
items:
489-
type: object
490-
events:
491-
description: in case of error, observability events will be added to the response, if any.
492-
type: array
493-
items:
494-
$ref: '../../common/schemas/event.yml#/Event'
495-
message:
496-
description: a message describing the outcome of a validate run.
497-
type: string
498-
required:
499-
- message
500-
501479
RunSourcePayload:
502480
type: object
503481
additionalProperties: false

specs/ingestion/paths/sources/discover.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ post:
1818
content:
1919
application/json:
2020
schema:
21-
$ref: '../../common/schemas/source.yml#/SourceWatchResponse'
21+
$ref: '../../common/schemas/common.yml#/WatchResponse'
2222
'400':
2323
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/paths/sources/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ post:
2121
content:
2222
application/json:
2323
schema:
24-
$ref: '../../common/schemas/source.yml#/SourceWatchResponse'
24+
$ref: '../../common/schemas/common.yml#/WatchResponse'
2525
'400':
2626
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/paths/sources/validateID.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ post:
2323
content:
2424
application/json:
2525
schema:
26-
$ref: '../../common/schemas/source.yml#/SourceWatchResponse'
26+
$ref: '../../common/schemas/common.yml#/WatchResponse'
2727
'400':
2828
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/paths/tasks/v2/pushTask.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ post:
4747
content:
4848
application/json:
4949
schema:
50-
$ref: '../../../common/schemas/run.yml#/RunResponse'
50+
$ref: '../../../common/schemas/common.yml#/WatchResponse'
5151
'400':
5252
$ref: '../../../../common/responses/BadRequest.yml'

templates/csharp/guides/ingestion/pushSetup.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ class PushSetup
2020

2121
try
2222
{
23-
var run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
24-
Console.WriteLine(run.RunID);
23+
// setting `watch` to `true` will make the call synchronous
24+
var resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
25+
26+
Console.WriteLine(resp);
2527
}
2628
catch (Exception e)
2729
{

templates/go/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ func push() {
2626
panic(err)
2727
}
2828

29-
run, err := {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
29+
// setting `watch` to `true` will make the call synchronous
30+
resp, err := {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
3031
if err != nil {
3132
panic(err)
3233
}
3334

34-
// use runID in the Observability debugger
35-
fmt.Println("run", run.RunID)
35+
fmt.Printf("%#v\n", resp)
3636
}

templates/java/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ public class pushSetup {
1313
// use the region matching your applicationID
1414
{{> snippets/init}}
1515

16-
RunResponse run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
16+
// setting `watch` to `true` will make the call synchronous
17+
WatchResponse resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
1718

18-
// use runID in the Observability debugger
19-
System.out.println(run.getRunID());
19+
System.out.println(resp);
2020

2121
client.close();
2222
}

templates/javascript/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ try {
1010
// read local JSON file containing array of records
1111
const records = JSON.parse(fs.readFileSync('records.json', 'utf8')) as PushTaskRecords[];
1212
13-
// push records to the API
14-
const run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
13+
// setting `watch` to `true` will make the call synchronous
14+
const resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
1515

16-
// use runID in the Observability debugger
17-
console.log(run.runID);
16+
console.log(resp);
1817
} catch (err) {
1918
console.error(err);
2019
}

templates/kotlin/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ suspend fun main() {
1818
{{> snippets/init}}
1919

2020
try {
21-
val run = client.{{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
21+
// setting `watch` to `true` will make the call synchronous
22+
val resp = client.{{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
2223

23-
// use runID in the Observability debugger
24-
println(run)
24+
println(resp)
2525
} catch(e: Exception) {
2626
println(e.message)
2727
}

templates/php/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $records = json_decode(file_get_contents("records.json"), true);
77
// use the region matching your applicationID
88
{{> snippets/init}}
99

10-
$run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
10+
// setting `watch` to `true` will make the call synchronous
11+
$resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
1112

12-
// use runID in the Observability debugger
13-
print($run);
13+
print($resp);

templates/python/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ async def main():
1010
with open("records.json") as f:
1111
records = json.load(f)
1212

13-
run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
13+
# setting `watch` to `true` will make the call synchronous
14+
resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
1415

15-
# use runID in the Observability debugger
16-
print(run.run_id)
16+
print(resp)
1717

1818
asyncio.run(main())

templates/ruby/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ records = JSON.parse(File.read('records.json'))
66
# use the region matching your applicationID
77
{{> snippets/init}}
88

9-
run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
9+
# setting `watch` to `true` will make the call synchronous
10+
resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
1011

11-
# use runID in the Observability debugger
12-
puts run.run_id
12+
puts resp

templates/scala/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ object PushSetup {
2121
{{> snippets/init}}
2222

2323
try {
24-
val run = Await.result(
24+
// setting `watch` to `true` will make the call synchronous
25+
val resp = Await.result(
2526
{{#dynamicSnippet}}pushSetup{{/dynamicSnippet}},
2627
Duration(100, "sec")
2728
)
2829

29-
// use runID in the Observability debugger
30-
println(run.runID)
30+
println(resp)
3131
} catch {
3232
case e: Exception => println(e)
3333
}

templates/swift/guides/ingestion/pushSetup.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ func pushSetup() async throws {
1616
// use the region matching your applicationID
1717
{{> snippets/init}}
1818

19-
let run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
19+
// setting `watch` to `true` will make the call synchronous
20+
let resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
2021

21-
// use runID in the Observability debugger
22-
dump(run)
22+
dump(resp)
2323
} catch {
2424
print(error)
2525
}

tests/CTS/guides/ingestion.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"pushTaskPayload": {
77
"action": "addObject",
88
"records": "$var: records"
9-
}
9+
},
10+
"watch": true
1011
}
1112
}
1213
}

0 commit comments

Comments
 (0)