Skip to content

Commit 70bf0df

Browse files
committed
Merge remote-tracking branch 'chris/olszewski/bump_to_heatbeat' into bump_to_heartbeat
2 parents 32404c4 + f278408 commit 70bf0df

File tree

11 files changed

+628
-197
lines changed

11 files changed

+628
-197
lines changed

.github/workflows/ci.yml

Lines changed: 71 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ jobs:
6060
run:
6161
shell: bash
6262
steps:
63-
- name: 'Checkout code'
63+
- name: "Checkout code"
6464
uses: actions/checkout@v4
6565
with:
6666
submodules: recursive
6767

68-
- name: 'Cache index.node'
68+
- name: "Cache index.node"
6969
id: cached-artifact
7070
uses: actions/cache@v4
7171
with:
@@ -77,7 +77,7 @@ jobs:
7777
uses: arduino/setup-protoc@v3
7878
with:
7979
# TODO: Upgrade proto once https://github.com/arduino/setup-protoc/issues/99 is fixed
80-
version: '23.x'
80+
version: "23.x"
8181
repo-token: ${{ secrets.GITHUB_TOKEN }}
8282

8383
- name: Upgrade Rust to latest stable
@@ -90,7 +90,7 @@ jobs:
9090
workspaces: packages/core-bridge -> target
9191
prefix-key: corebridge-buildcache-debug
9292
shared-key: ${{ matrix.platform }}
93-
env-vars: ''
93+
env-vars: ""
9494
save-if: ${{ env.IS_MAIN_OR_RELEASE == 'true' }}
9595

9696
- name: Compile rust code
@@ -148,7 +148,7 @@ jobs:
148148
- name: Set git config
149149
run: git config --global core.autocrlf false
150150

151-
- name: 'Checkout code'
151+
- name: "Checkout code"
152152
uses: actions/checkout@v4
153153
with:
154154
submodules: recursive
@@ -209,13 +209,20 @@ jobs:
209209
--db-filename temporal.sqlite \
210210
--sqlite-pragma journal_mode=WAL \
211211
--sqlite-pragma synchronous=OFF \
212+
--dynamic-config-value system.enableEagerWorkflowStart=true \
213+
--dynamic-config-value system.enableNexus=true \
214+
--dynamic-config-value frontend.workerVersioningWorkflowAPIs=true \
215+
--dynamic-config-value frontend.workerVersioningDataAPIs=true \
216+
--dynamic-config-value system.enableDeploymentVersions=true \
217+
--dynamic-config-value component.nexusoperations.recordCancelRequestCompletionEvents=true \
212218
--dynamic-config-value frontend.WorkerHeartbeatsEnabled=true \
213219
--dynamic-config-value frontend.ListWorkersEnabled=true \
214220
--headless &> ./devserver.log &
215221
216222
- name: Run Tests # DEBUG,temporal_sdk_core=DEBUG,temporal_client=DEBUG,temporal_sdk=DEBUG
217223
run: RUST_LOG=DEBUG,temporal_sdk_core=DEBUG,temporal_client=DEBUG,temporal_sdk=DEBUG npm run test
218224
env:
225+
TEMPORAL_TRACE_NATIVE_CALLS: true
219226
RUN_INTEGRATION_TESTS: true
220227
REUSE_V8_CONTEXT: ${{ matrix.reuse-v8-context }}
221228

@@ -235,66 +242,65 @@ jobs:
235242
TEMPORAL_CLOUD_OPS_TEST_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
236243
TEMPORAL_CLOUD_OPS_TEST_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
237244
TEMPORAL_CLOUD_OPS_TEST_API_VERSION: 2024-05-13-00
238-
239-
# FIXME: Move samples tests to a custom activity
240-
# Sample 1: hello-world to local server
241-
- name: Instantiate sample project using verdaccio artifacts - Hello World
242-
run: |
243-
node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world
244-
node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world"
245-
246-
# Sample 2: hello-world-mtls to cloud server
247-
- name: Instantiate sample project using verdaccio artifacts - Hello World MTLS
248-
run: |
249-
if [ -z "$TEMPORAL_ADDRESS" ] || [ -z "$TEMPORAL_NAMESPACE" ] || [ -z "$TEMPORAL_CLIENT_CERT" ] || [ -z "$TEMPORAL_CLIENT_KEY" ]; then
250-
echo "Skipping hello-world-mtls sample test as required environment variables are not set"
251-
exit 0
252-
fi
253-
254-
node scripts/create-certs-dir.js ${{ steps.tmp-dir.outputs.dir }}/certs
255-
node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world-mtls --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls
256-
node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls"
257-
env:
258-
# These env vars are used by the hello-world-mtls sample
259-
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
260-
TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
261-
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
262-
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
263-
TEMPORAL_TASK_QUEUE: ${{ format('tssdk-ci-{0}-{1}-sample-hello-world-mtls-{2}-{3}', matrix.platform, matrix.node, github.run_id, github.run_attempt) }}
264-
265-
TEMPORAL_CLIENT_CERT_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.pem
266-
TEMPORAL_CLIENT_KEY_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.key
267-
268-
- name: Destroy certs dir
269-
if: always()
270-
run: rm -rf ${{ steps.tmp-dir.outputs.dir }}/certs
271-
continue-on-error: true
272-
273-
# Sample 3: fetch-esm to local server
274-
- name: Instantiate sample project using verdaccio artifacts - Fetch ESM
275-
run: |
276-
node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/fetch-esm --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm
277-
node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm"
278-
279-
# End samples
280-
281-
- name: Upload NPM logs
282-
uses: actions/upload-artifact@v4
283-
if: failure() || cancelled()
284-
with:
285-
name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-logs
286-
path: ${{ startsWith(matrix.platform, 'windows') && 'C:\\npm\\_logs\\' || '~/.npm/_logs/' }}
287-
288-
- name: Upload Dev Server logs
289-
uses: actions/upload-artifact@v4
290-
if: failure() || cancelled()
291-
with:
292-
name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-devserver-logs
293-
path: ${{ steps.tmp-dir.outputs.dir }}/devserver.log
294-
295-
# conventions:
296-
# name: Lint and Prune
297-
# uses: ./.github/workflows/conventions.yml
245+
# # FIXME: Move samples tests to a custom activity
246+
# # Sample 1: hello-world to local server
247+
# - name: Instantiate sample project using verdaccio artifacts - Hello World
248+
# run: |
249+
# node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world
250+
# node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world"
251+
#
252+
# # Sample 2: hello-world-mtls to cloud server
253+
# - name: Instantiate sample project using verdaccio artifacts - Hello World MTLS
254+
# run: |
255+
# if [ -z "$TEMPORAL_ADDRESS" ] || [ -z "$TEMPORAL_NAMESPACE" ] || [ -z "$TEMPORAL_CLIENT_CERT" ] || [ -z "$TEMPORAL_CLIENT_KEY" ]; then
256+
# echo "Skipping hello-world-mtls sample test as required environment variables are not set"
257+
# exit 0
258+
# fi
259+
#
260+
# node scripts/create-certs-dir.js ${{ steps.tmp-dir.outputs.dir }}/certs
261+
# node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world-mtls --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls
262+
# node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls"
263+
# env:
264+
# # These env vars are used by the hello-world-mtls sample
265+
# TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
266+
# TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
267+
# TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
268+
# TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
269+
# TEMPORAL_TASK_QUEUE: ${{ format('tssdk-ci-{0}-{1}-sample-hello-world-mtls-{2}-{3}', matrix.platform, matrix.node, github.run_id, github.run_attempt) }}
270+
#
271+
# TEMPORAL_CLIENT_CERT_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.pem
272+
# TEMPORAL_CLIENT_KEY_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.key
273+
#
274+
# - name: Destroy certs dir
275+
# if: always()
276+
# run: rm -rf ${{ steps.tmp-dir.outputs.dir }}/certs
277+
# continue-on-error: true
278+
#
279+
# # Sample 3: fetch-esm to local server
280+
# - name: Instantiate sample project using verdaccio artifacts - Fetch ESM
281+
# run: |
282+
# node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/fetch-esm --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm
283+
# node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm"
284+
#
285+
# # End samples
286+
#
287+
# - name: Upload NPM logs
288+
# uses: actions/upload-artifact@v4
289+
# if: failure() || cancelled()
290+
# with:
291+
# name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-logs
292+
# path: ${{ startsWith(matrix.platform, 'windows') && 'C:\\npm\\_logs\\' || '~/.npm/_logs/' }}
293+
#
294+
# - name: Upload Dev Server logs
295+
# uses: actions/upload-artifact@v4
296+
# if: failure() || cancelled()
297+
# with:
298+
# name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-devserver-logs
299+
# path: ${{ steps.tmp-dir.outputs.dir }}/devserver.log
300+
301+
#conventions:
302+
# name: Lint and Prune
303+
# uses: ./.github/workflows/conventions.yml
298304

299305
# # Runs the features repo tests with this repo's current SDK code
300306
# # FIXME: Update this job to reuse native build artifacts from compile-native-binaries

packages/core-bridge/Cargo.lock

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core-bridge/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ prost = "0.14"
3535
prost-types = "0.14"
3636
serde = { version = "1.0", features = ["derive"] }
3737
serde_json = "1.0"
38-
temporalio-sdk-core = { version = "*", path = "./sdk-core/crates/sdk-core", features = [
38+
temporal-sdk-core = { version = "*", path = "./sdk-core/core", features = [
3939
"ephemeral-server",
4040
] }
4141
temporalio-client = { version = "*", path = "./sdk-core/crates/client" }

packages/core-bridge/src/client.rs

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,33 +55,36 @@ pub fn client_new(
5555
let runtime = runtime.borrow()?.core_runtime.clone();
5656
let config: CoreClientOptions = config.try_into()?;
5757

58-
runtime.clone().future_to_promise(async move {
59-
let metric_meter = runtime.clone().telemetry().get_temporal_metric_meter();
60-
let res = config.connect_no_namespace(metric_meter).await;
61-
62-
let core_client = match res {
63-
Ok(core_client) => core_client,
64-
Err(ClientInitError::InvalidHeaders(e)) => Err(BridgeError::TypeError {
65-
message: format!("Invalid metadata key: {e}"),
66-
field: None,
67-
})?,
68-
Err(ClientInitError::SystemInfoCallError(e)) => Err(BridgeError::TransportError(
69-
format!("Failed to call GetSystemInfo: {e}"),
70-
))?,
71-
Err(ClientInitError::TonicTransportError(e)) => {
72-
Err(BridgeError::TransportError(format!("{e:?}")))?
73-
}
74-
Err(ClientInitError::InvalidUri(e)) => Err(BridgeError::TypeError {
75-
message: e.to_string(),
76-
field: None,
77-
})?,
78-
};
79-
80-
Ok(OpaqueOutboundHandle::new(Client {
81-
core_runtime: runtime,
82-
core_client,
83-
}))
84-
})
58+
runtime.clone().future_to_promise_named(
59+
async move {
60+
let metric_meter = runtime.clone().telemetry().get_temporal_metric_meter();
61+
let res = config.connect_no_namespace(metric_meter).await;
62+
63+
let core_client = match res {
64+
Ok(core_client) => core_client,
65+
Err(ClientInitError::InvalidHeaders(e)) => Err(BridgeError::TypeError {
66+
message: format!("Invalid metadata key: {e}"),
67+
field: None,
68+
})?,
69+
Err(ClientInitError::SystemInfoCallError(e)) => Err(BridgeError::TransportError(
70+
format!("Failed to call GetSystemInfo: {e}"),
71+
))?,
72+
Err(ClientInitError::TonicTransportError(e)) => {
73+
Err(BridgeError::TransportError(format!("{e:?}")))?
74+
}
75+
Err(ClientInitError::InvalidUri(e)) => Err(BridgeError::TypeError {
76+
message: e.to_string(),
77+
field: None,
78+
})?,
79+
};
80+
81+
Ok(OpaqueOutboundHandle::new(Client {
82+
core_runtime: runtime,
83+
core_client,
84+
}))
85+
},
86+
"client_new",
87+
)
8588
}
8689

8790
/// Update a Client's HTTP request headers

0 commit comments

Comments
 (0)