Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(specs): enable watcher for push [skip-bc] #4229

Merged
merged 7 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions specs/ingestion/common/schemas/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,6 @@ ShopifyMarket:
- countries
- currencies
- locales

PushTaskResponse:
$ref: './source.yml#/SourceWatchResponse'
2 changes: 1 addition & 1 deletion specs/ingestion/paths/tasks/v2/pushTask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ post:
content:
application/json:
schema:
$ref: '../../../common/schemas/run.yml#/RunResponse'
$ref: '../../../common/schemas/task.yml#/PushTaskResponse'
'400':
$ref: '../../../../common/responses/BadRequest.yml'
6 changes: 4 additions & 2 deletions templates/csharp/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ class PushSetup

try
{
var run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
Console.WriteLine(run.RunID);
// setting `watch` to `true` will make the call synchronous
var resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};

Console.WriteLine(resp);
}
catch (Exception e)
{
Expand Down
6 changes: 3 additions & 3 deletions templates/go/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func push() {
panic(err)
}

run, err := {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
// setting `watch` to `true` will make the call synchronous
resp, err := {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
if err != nil {
panic(err)
}

// use runID in the Observability debugger
fmt.Println("run", run.RunID)
fmt.Printf("%#v\n", resp)
}
6 changes: 3 additions & 3 deletions templates/java/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public class pushSetup {
// use the region matching your applicationID
{{> snippets/init}}

RunResponse run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};
// setting `watch` to `true` will make the call synchronous
PushTaskResponse resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}};

// use runID in the Observability debugger
System.out.println(run.getRunID());
System.out.println(resp);

client.close();
}
Expand Down
7 changes: 3 additions & 4 deletions templates/javascript/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ try {
// read local JSON file containing array of records
const records = JSON.parse(fs.readFileSync('records.json', 'utf8')) as PushTaskRecords[];

// push records to the API
const run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
// setting `watch` to `true` will make the call synchronous
const resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}

// use runID in the Observability debugger
console.log(run.runID);
console.log(resp);
} catch (err) {
console.error(err);
}
6 changes: 3 additions & 3 deletions templates/kotlin/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ suspend fun main() {
{{> snippets/init}}

try {
val run = client.{{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
// setting `watch` to `true` will make the call synchronous
val resp = client.{{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}

// use runID in the Observability debugger
println(run)
println(resp)
} catch(e: Exception) {
println(e.message)
}
Expand Down
6 changes: 3 additions & 3 deletions templates/php/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $records = json_decode(file_get_contents("records.json"), true);
// use the region matching your applicationID
{{> snippets/init}}

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

// use runID in the Observability debugger
print($run);
print($resp);
6 changes: 3 additions & 3 deletions templates/python/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ async def main():
with open("records.json") as f:
records = json.load(f)

run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
# setting `watch` to `true` will make the call synchronous
resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}

# use runID in the Observability debugger
print(run.run_id)
print(resp)

asyncio.run(main())
6 changes: 3 additions & 3 deletions templates/ruby/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ records = JSON.parse(File.read('records.json'))
# use the region matching your applicationID
{{> snippets/init}}

run = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}
# setting `watch` to `true` will make the call synchronous
resp = {{#dynamicSnippet}}pushSetup{{/dynamicSnippet}}

# use runID in the Observability debugger
puts run.run_id
puts resp
6 changes: 3 additions & 3 deletions templates/scala/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ object PushSetup {
{{> snippets/init}}

try {
val run = Await.result(
// setting `watch` to `true` will make the call synchronous
val resp = Await.result(
{{#dynamicSnippet}}pushSetup{{/dynamicSnippet}},
Duration(100, "sec")
)

// use runID in the Observability debugger
println(run.runID)
println(resp)
} catch {
case e: Exception => println(e)
}
Expand Down
6 changes: 3 additions & 3 deletions templates/swift/guides/ingestion/pushSetup.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func pushSetup() async throws {
// use the region matching your applicationID
{{> snippets/init}}

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

// use runID in the Observability debugger
dump(run)
dump(resp)
} catch {
print(error)
}
Expand Down
3 changes: 2 additions & 1 deletion tests/CTS/guides/ingestion.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"pushTaskPayload": {
"action": "addObject",
"records": "$var: records"
}
},
"watch": true
}
}
}
Loading