Skip to content

Commit 6a46e14

Browse files
committed
refactor(wit): Bump obelisk_webhook to 5.2.0, add execution-id-current
1 parent 5d3302b commit 6a46e14

7 files changed

Lines changed: 26 additions & 11 deletions

File tree

crates/utils/src/wit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ pub const WIT_OBELISK_WORKFLOW_PACKAGE: [&str; 3] = [
5252
];
5353

5454
pub const WIT_OBELISK_WEBHOOK_PACKAGE: [&str; 3] = [
55-
"obelisk_webhook@5.1.0",
56-
"obelisk_webhook@5.1.0.wit",
55+
"obelisk_webhook@5.2.0",
56+
"obelisk_webhook@5.2.0.wit",
5757
include_str!(concat!(
5858
env!("CARGO_MANIFEST_DIR"),
59-
"/wit/obelisk_webhook@5.1.0/obelisk_webhook@5.1.0.wit"
59+
"/wit/obelisk_webhook@5.2.0/obelisk_webhook@5.2.0.wit"
6060
)),
6161
];
6262

crates/wasm-workers/src/registry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ impl ComponentConfigRegistry {
258258
"wasi" => true,
259259
"obelisk" => matches!(
260260
import.ffqn.ifc_fqn.pkg_fqn_name().to_string().as_str(),
261-
"obelisk:webhook@5.1.0"
261+
"obelisk:webhook@5.2.0"
262+
| "obelisk:webhook@5.1.0"
262263
| "obelisk:webhook@5.0.0"
263264
| "obelisk:log@1.0.0"
264265
| "obelisk:types@4.0.0"

crates/wasm-workers/src/webhook/webhook_trigger.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub(crate) mod types {
7070
import obelisk:types/execution@4.2.0;
7171
import obelisk:types/backtrace@4.2.0;
7272
import obelisk:types/join-set@4.2.0;
73-
import obelisk:webhook/webhook-support@5.1.0;
73+
import obelisk:webhook/webhook-support@5.2.0;
7474
}",
7575
world: "any:any/bindings",
7676
imports: {
@@ -633,8 +633,15 @@ impl WebhookSupportHost for WebhookEndpointCtx {
633633
})
634634
}
635635

636+
/// Deprecated, use `execution_id_current`.
636637
async fn current_execution_id(
637638
&mut self,
639+
) -> wasmtime::Result<types::obelisk::webhook::webhook_support::ExecutionId> {
640+
self.execution_id_current().await
641+
}
642+
643+
async fn execution_id_current(
644+
&mut self,
638645
) -> wasmtime::Result<types::obelisk::webhook::webhook_support::ExecutionId> {
639646
Ok(types::obelisk::webhook::webhook_support::ExecutionId {
640647
id: self.execution_id.to_string(),

crates/webhook-js-runtime/src/webhook_js_runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ fn setup_obelisk_api(context: &mut Context) -> JsResult<()> {
346346

347347
// obelisk.executionIdCurrent()
348348
let current_execution_id_fn = NativeFunction::from_fn_ptr(|_this, _args, _ctx| {
349-
let exec_id = webhook_support::current_execution_id();
349+
let exec_id = webhook_support::execution_id_current();
350350
Ok(JsValue::from(js_string!(exec_id.id)))
351351
});
352352
obelisk.set(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package any:any;
22

33
world any {
4-
import obelisk:webhook/webhook-support@5.1.0;
4+
import obelisk:webhook/webhook-support@5.2.0;
55
import obelisk:log/log@1.0.0;
66
}

wit/obelisk_webhook@5.1.0/obelisk_webhook@5.1.0.wit renamed to wit/obelisk_webhook@5.2.0/obelisk_webhook@5.2.0.wit

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package obelisk:webhook@5.1.0;
1+
package obelisk:webhook@5.2.0;
22

33
@since(version = 5.0.0)
44
interface webhook-support {
@@ -65,10 +65,17 @@ interface webhook-support {
6565
@since(version = 5.0.0)
6666
execution-id-generate: func() -> execution-id;
6767

68-
/// Get the execution ID of the current webhook handler invocation.
69-
/// Returns the ID assigned to this webhook execution by the engine.
68+
/// Use `execution-id-get`
7069
@since(version = 5.1.0)
70+
@deprecated(version = 5.2.0)
7171
current-execution-id: func() -> execution-id;
72+
73+
/// Get the execution ID of the current webhook handler invocation.
74+
/// Returns the ID assigned to this webhook execution by the engine.
75+
@since(version = 5.2.0)
76+
execution-id-current: func() -> execution-id;
77+
78+
7279
/// Call a function and wait for the result.
7380
/// Creates a child execution, waits for it to complete, and returns the result.
7481
/// Parameters are serialized as a JSON array.

wit/obelisk_webhook@latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
obelisk_webhook@5.1.0
1+
obelisk_webhook@5.2.0/

0 commit comments

Comments
 (0)