Skip to content

Commit 2c8f922

Browse files
authored
Merge branch 'main' into user-metadata
2 parents ebe745f + caae0a4 commit 2c8f922

File tree

168 files changed

+21026
-10347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+21026
-10347
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919

2020
# Use these variables to force specific version of CLI/Time Skipping Server for SDK tests
2121
# TESTS_CLI_VERSION: 'v0.13.2'
22+
TESTS_CLI_VERSION: 'v1.3.1-persistence-fix.0'
2223
# TESTS_TIME_SKIPPING_SERVER_VERSION: 'v1.24.1'
2324

2425
jobs:
@@ -129,14 +130,6 @@ jobs:
129130
- platform: windows-x64
130131
runner: windows-latest
131132
reuse-v8-context: true
132-
# Node 22.12.0 on Windows incorrectly resolves `localhost` to `::1`, rather than both `::1` and `127.0.0.1`.
133-
# We changed all of our internal tests to exclusively use `127.0.0.1`, but samples are still written to use
134-
# `localhost`, which really is the proper thing to do in samples. So until this gets fixed upstream, we force
135-
# the last known good version of Node on Windows.
136-
# See https://github.com/nodejs/node/issues/56137 (_resolved_ already, but not yet released).
137-
- platform: windows-x64
138-
node: 22
139-
node-release-override: 22.11.0
140133
runs-on: ${{ matrix.runner }}
141134
name: Run Integration Tests (${{ matrix.platform }}, Node ${{ matrix.node }}, Reuse V8 Context ${{ matrix.reuse-v8-context }})
142135
defaults:
@@ -212,25 +205,28 @@ jobs:
212205
--sqlite-pragma synchronous=OFF \
213206
--headless &> ./devserver.log &
214207
215-
# We write the certs to disk because it serves the sample. Written into /tmp/temporal-certs
216-
- name: Create certs dir
217-
run: node scripts/create-certs-dir.js ${{ steps.tmp-dir.outputs.dir }}/certs
218-
if: ${{ vars.TEMPORAL_CLIENT_NAMESPACE != '' }}
219-
env:
220-
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
221-
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
222-
223208
- name: Run Tests
224-
run: npm test
209+
run: npm run test
225210
env:
226211
RUN_INTEGRATION_TESTS: true
227212
REUSE_V8_CONTEXT: ${{ matrix.reuse-v8-context }}
228213

229-
# Cloud Tests will be skipped if TEMPORAL_CLIENT_CLOUD_API_KEY is left empty
230-
TEMPORAL_CLOUD_SAAS_ADDRESS: ${{ vars.TEMPORAL_CLOUD_SAAS_ADDRESS || 'saas-api.tmprl.cloud:443' }}
231-
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
232-
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
233-
TEMPORAL_CLIENT_CLOUD_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
214+
# For Temporal Cloud + mTLS tests
215+
TEMPORAL_CLOUD_MTLS_TEST_TARGET_HOST: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
216+
TEMPORAL_CLOUD_MTLS_TEST_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
217+
TEMPORAL_CLOUD_MTLS_TEST_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
218+
TEMPORAL_CLOUD_MTLS_TEST_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
219+
220+
# For Temporal Cloud + API key tests
221+
TEMPORAL_CLOUD_API_KEY_TEST_TARGET_HOST: us-west-2.aws.api.temporal.io:7233
222+
TEMPORAL_CLOUD_API_KEY_TEST_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
223+
TEMPORAL_CLOUD_API_KEY_TEST_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
224+
225+
# For Temporal Cloud + Cloud Ops tests
226+
TEMPORAL_CLOUD_OPS_TEST_TARGET_HOST: saas-api.tmprl.cloud:443
227+
TEMPORAL_CLOUD_OPS_TEST_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
228+
TEMPORAL_CLOUD_OPS_TEST_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
229+
TEMPORAL_CLOUD_OPS_TEST_API_VERSION: 2024-05-13-00
234230

235231
# FIXME: Move samples tests to a custom activity
236232
# Sample 1: hello-world to local server
@@ -241,17 +237,30 @@ jobs:
241237
242238
# Sample 2: hello-world-mtls to cloud server
243239
- name: Instantiate sample project using verdaccio artifacts - Hello World MTLS
244-
if: ${{ vars.TEMPORAL_CLIENT_NAMESPACE != '' }}
245240
run: |
241+
if [ -z "$TEMPORAL_ADDRESS" ] || [ -z "$TEMPORAL_NAMESPACE" ] || [ -z "$TEMPORAL_CLIENT_CERT" ] || [ -z "$TEMPORAL_CLIENT_KEY" ]; then
242+
echo "Skipping hello-world-mtls sample test as required environment variables are not set"
243+
exit 0
244+
fi
245+
246+
node scripts/create-certs-dir.js ${{ steps.tmp-dir.outputs.dir }}/certs
246247
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
247248
node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls"
248249
env:
249250
# These env vars are used by the hello-world-mtls sample
250-
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud
251+
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
251252
TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
253+
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
254+
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
255+
TEMPORAL_TASK_QUEUE: ${{ format('tssdk-ci-{0}-{1}-sample-hello-world-mtls-{2}-{3}', matrix.platform, matrix.node, github.run_id, github.run_attempt) }}
256+
252257
TEMPORAL_CLIENT_CERT_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.pem
253258
TEMPORAL_CLIENT_KEY_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.key
254-
TEMPORAL_TASK_QUEUE: ${{ format('{0}-{1}-sample-hello-world-mtls', matrix.platform, matrix.node) }}
259+
260+
- name: Destroy certs dir
261+
if: always()
262+
run: rm -rf ${{ steps.tmp-dir.outputs.dir }}/certs
263+
continue-on-error: true
255264

256265
# Sample 3: fetch-esm to local server
257266
- name: Instantiate sample project using verdaccio artifacts - Fetch ESM
@@ -261,11 +270,6 @@ jobs:
261270
262271
# End samples
263272

264-
- name: Destroy certs dir
265-
if: always()
266-
run: rm -rf ${{ steps.tmp-dir.outputs.dir }}/certs
267-
continue-on-error: true
268-
269273
- name: Upload NPM logs
270274
uses: actions/upload-artifact@v4
271275
if: failure() || cancelled()
@@ -293,7 +297,7 @@ jobs:
293297
typescript-repo-path: ${{github.event.pull_request.head.repo.full_name}}
294298
version: ${{github.event.pull_request.head.ref}}
295299
version-is-repo-ref: true
296-
features-repo-ref: sdk-1403-ts-startUpdate-require-wait-stage
300+
features-repo-ref: main
297301

298302
stress-tests-no-reuse-context:
299303
name: Stress Tests (No Reuse V8 Context)
@@ -322,3 +326,5 @@ jobs:
322326
secrets:
323327
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
324328
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
329+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
330+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

.github/workflows/docs.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ on:
1515
VERCEL_TOKEN:
1616
required: false
1717
description: The Vercel token. Required if 'publish_target' is set.
18+
VERCEL_ORG_ID:
19+
required: false
20+
description: The Vercel token. Required if 'publish_target' is set.
21+
VERCEL_PROJECT_ID:
22+
required: false
23+
description: The Vercel token. Required if 'publish_target' is set.
1824

1925
env:
2026
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -62,10 +68,11 @@ jobs:
6268

6369
- name: Publish docs
6470
if: ${{ inputs.publish_target }}
71+
env:
72+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
73+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
6574
run: |
6675
npx vercel deploy packages/docs/build \
6776
-t '${{ secrets.VERCEL_TOKEN }}' \
68-
--name typescript \
69-
--scope temporal \
7077
--yes \
7178
${{ inputs.publish_target == 'prod' && '--prod' || '' }}

.github/workflows/release.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414

1515
# Use these variables to force specific version of CLI/Time Skipping Server for SDK tests
1616
# TESTS_CLI_VERSION: 'v0.13.2'
17+
TESTS_CLI_VERSION: 'v1.3.1-persistence-fix.0'
1718
# TESTS_TIME_SKIPPING_SERVER_VERSION: 'v1.24.1'
1819

1920
jobs:
@@ -303,23 +304,32 @@ jobs:
303304
shell: bash
304305
run: node scripts/create-certs-dir.js "${{ runner.temp }}/certs"
305306
if: matrix.server == 'cloud'
307+
env:
308+
# These env vars are used by the hello-world-mtls sample
309+
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
310+
TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
311+
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
312+
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
306313

307314
- name: Test run a workflow (non-cloud)
308315
run: node scripts/test-example.js --work-dir "${{ runner.temp }}/example"
309316
shell: bash
310317
if: matrix.server == 'cli'
311318

312319
- name: Test run a workflow (cloud)
313-
run: node scripts/test-example.js --work-dir "${{ runner.temp }}/example"
320+
if: matrix.server == 'cloud'
321+
run: |
322+
# The required environment variables must be present for releases (this must be run from the official repo)
323+
node scripts/create-certs-dir.js ${{ steps.tmp-dir.outputs.dir }}/certs
324+
node scripts/test-example.js --work-dir "${{ runner.temp }}/example"
314325
shell: bash
315326
env:
316327
# These env vars are used by the hello-world-mtls sample
317-
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud
328+
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
318329
TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
319330
TEMPORAL_CLIENT_CERT_PATH: ${{ runner.temp }}/certs/client.pem
320331
TEMPORAL_CLIENT_KEY_PATH: ${{ runner.temp }}/certs/client.key
321-
TEMPORAL_TASK_QUEUE: ${{ format('{0}-{1}-{2}', matrix.platform, matrix.node, matrix.sample) }}
322-
if: matrix.server == 'cloud'
332+
TEMPORAL_TASK_QUEUE: ${{ format('tssdk-ci-{0}-{1}-sample-hello-world-mtls-{2}-{3}', matrix.platform, matrix.node, github.run_id, github.run_attempt) }}
323333

324334
- name: Destroy certs dir
325335
if: always()

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ packages/core-bridge/releases
1212
packages/*/package-lock.json
1313
/sdk-node.iml
1414
*~
15+
16+
# One test creates persisted SQLite DBs; they should normally be deleted automatically,
17+
# but may be left behind in some error scenarios.
18+
packages/test/temporal-db-*.sqlite

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.11.5",
2+
"version": "1.12.0-rc.0",
33
"npmClient": "npm",
44
"command": {
55
"publish": {

0 commit comments

Comments
 (0)