Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
502 changes: 502 additions & 0 deletions .github/scripts/check-sdk-versions.py

Large diffs are not rendered by default.

206 changes: 206 additions & 0 deletions .github/workflows/check-sdk-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
name: Check SDK versions

# Compares the Temporal SDK version each *-sandbox/ folder builds with (from
# its lockfile where one exists) against the latest stable release of the
# matching temporalio/sdk-<language> repo. Outdated SDKs don't fail the check
# job; they go to the upgrade job. When everything is current, the run ends
# after the check.
#
# The upgrade job bumps the outdated sandboxes and opens (or refreshes) a PR
# from docs/sdk-version-upgrades into the default branch, on every trigger;
# manual runs can skip it with the create_pr input. The upgrade commit is
# built on whatever the run checked out, so a run on a PR or another branch
# also carries that branch's unmerged commits into the upgrade PR.
# A language whose upgrade fails is left out of the PR, and scheduled runs
# open a tracking issue for it.
#
# Token: PRs opened and pushes made with the default GITHUB_TOKEN don't
# trigger other workflows, so the compile check in ci-on-pr.yml won't run on
# the upgrade PR. Add an SDK_UPGRADE_TOKEN secret (a fine-grained PAT or
# GitHub App token with Contents and Pull requests write access) so CI runs.
# Without it the workflow falls back to GITHUB_TOKEN, which needs "Allow
# GitHub Actions to create and approve pull requests" enabled in the repo's
# Actions settings.
#
# Not a PR check: a new upstream SDK release would otherwise turn every open
# PR red. Runs on PRs only when the check itself changes.

on:
pull_request:
paths:
- ".github/scripts/check-sdk-versions.py"
- ".github/workflows/check-sdk-versions.yml"
schedule:
# Weekly, Monday morning UTC.
- cron: "23 8 * * 1"
# Manual run: Actions tab > Check SDK versions > Run workflow, or
# `gh workflow run check-sdk-versions.yml [-f create_pr=false]`.
workflow_dispatch:
inputs:
create_pr:
description: Open or update an upgrade PR if any SDK is outdated (uncheck to only report)
type: boolean
default: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
UPGRADE_BRANCH: docs/sdk-version-upgrades

jobs:
check:
name: Check SDK versions
runs-on: ubuntu-latest
outputs:
# ok | outdated | error, and the outdated language slugs (e.g. "go java")
status: ${{ steps.check.outputs.status }}
languages: ${{ steps.check.outputs.languages }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"
- name: Compare against latest SDK releases
id: check
env:
GITHUB_TOKEN: ${{ github.token }}
# Exit 1 means some SDKs are outdated: that's a result, not a failure,
# so pass it to the upgrade job. Exit 2 (a version couldn't be read
# or fetched) still fails the job.
run: |
set +e
python .github/scripts/check-sdk-versions.py
code=$?
if [ "$code" -eq 1 ]; then exit 0; fi
exit "$code"

upgrade:
name: Open upgrade PR
needs: check
# Skipped, ending the run, when every SDK is up to date.
if: >-
needs.check.outputs.status == 'outdated'
&& (github.event_name != 'workflow_dispatch' || inputs.create_pr)
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
# Full history, to spot human commits on an existing upgrade branch.
fetch-depth: 0
token: ${{ secrets.SDK_UPGRADE_TOKEN || github.token }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"

# Toolchains to regenerate lockfiles, only for languages being upgraded.
# .NET and Java need none: their versions live in .csproj and pom.xml.
- if: contains(needs.check.outputs.languages, 'go')
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: go-sandbox/go.mod
cache-dependency-path: go-sandbox/go.sum
- if: contains(needs.check.outputs.languages, 'typescript')
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: typescript-sandbox/.nvmrc
- if: contains(needs.check.outputs.languages, 'python')
run: python -m pip install uv
- if: contains(needs.check.outputs.languages, 'php')
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: "8.5"
tools: composer
- if: contains(needs.check.outputs.languages, 'ruby')
uses: ruby/setup-ruby@b3aaceaef7e0ee231b499e7b5f49c03fc1d32199 # v1.338.0
with:
ruby-version: "3.3"
- if: contains(needs.check.outputs.languages, 'rust')
uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: stable

- name: Upgrade outdated SDKs
id: upgrade
env:
GITHUB_TOKEN: ${{ github.token }}
run: python .github/scripts/check-sdk-versions.py --upgrade --pr-body "$RUNNER_TEMP/pr-body.md"

- name: Open or update the upgrade PR
if: steps.upgrade.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.SDK_UPGRADE_TOKEN || github.token }}
BASE: ${{ github.event.repository.default_branch }}
TITLE: ${{ steps.upgrade.outputs.title }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
bot_email="41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git config user.email "$bot_email"
existing="$(gh pr list --head "$UPGRADE_BRANCH" --state open --json number --jq '.[0].number // empty')"

# The branch is rebuilt from scratch each run. Don't force-push over
# fixes someone pushed to it (e.g. code changes for a breaking release).
# Only commits after the bot's last upgrade commit count: a run from a
# PR builds on that PR's commits, which aren't fixes to protect.
if git ls-remote --exit-code --heads origin "$UPGRADE_BRANCH" >/dev/null; then
# Exact match: --author is a regex, and the email has [ ] and +.
last_bot="$(git log "origin/$UPGRADE_BRANCH" --format='%H %ae' | awk -v e="$bot_email" '$2 == e { print $1; exit }')"
human="$(git log "${last_bot:-origin/$BASE}..origin/$UPGRADE_BRANCH" --format=%ae | grep -vxF "$bot_email" || true)"
if [ -n "$human" ]; then
msg="New Temporal SDK releases are available, but $UPGRADE_BRANCH has commits from people, so this run didn't overwrite it. Merge or close the PR to get the next upgrade. Run: $RUN_URL"
echo "::warning::$msg"
if [ -n "$existing" ]; then gh pr comment "$existing" --body "$msg"; fi
exit 0
fi
fi

git switch -C "$UPGRADE_BRANCH"
git add -u -- '*-sandbox/*'
git commit -m "$TITLE" -m "Opened by the Check SDK versions workflow: $RUN_URL"
git push --force origin "$UPGRADE_BRANCH"

if [ -n "$existing" ]; then
gh pr edit "$existing" --title "$TITLE" --body-file "$RUNNER_TEMP/pr-body.md"
else
gh pr create --base "$BASE" --head "$UPGRADE_BRANCH" --title "$TITLE" --body-file "$RUNNER_TEMP/pr-body.md"
fi

- name: Fail if a language couldn't be upgraded
if: steps.upgrade.outputs.failed == 'true'
run: |
echo "::error::At least one SDK couldn't be upgraded automatically. See the step summary."
exit 1

report:
name: Report scheduled failure
needs: [check, upgrade]
# Being out of date isn't reported here; the upgrade PR covers that.
if: >-
always()
&& github.event_name == 'schedule'
&& (needs.check.outputs.status == 'error' || needs.upgrade.result == 'failure')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Open or update a tracking issue
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
title="Temporal SDK version check or upgrade failed"
existing="$(gh issue list --state open --search "in:title \"$title\"" --json number --jq '.[0].number')"
if [ -n "$existing" ]; then
gh issue comment "$existing" --body "Failed again: $RUN_URL"
else
gh issue create --title "$title" --body "The weekly SDK version check couldn't read a version, or couldn't upgrade an outdated SDK automatically. The run summary has the details. Run: $RUN_URL"
fi
4 changes: 2 additions & 2 deletions go-sandbox/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module my-org/quickstart

go 1.26.0

require go.temporal.io/sdk v1.49.0
require go.temporal.io/sdk v1.51.0

require github.com/uber-go/tally/v4 v4.1.1

Expand Down Expand Up @@ -181,7 +181,7 @@ require (
go.opentelemetry.io/otel v1.45.0
go.opentelemetry.io/otel/metric v1.45.0 // indirect
go.opentelemetry.io/otel/trace v1.45.0 // indirect
go.temporal.io/api v1.63.5
go.temporal.io/api v1.64.3
go.temporal.io/sdk/contrib/opentelemetry v0.8.1
go.temporal.io/sdk/contrib/tally v0.2.0
go.uber.org/atomic v1.11.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go-sandbox/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,11 @@ go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.2.0/go.mod h1:mUUH
go.shabbyrobe.org/gocovmerge v0.0.0-20230507111327-fa4f82cfbf4d h1:Ns9kd1Rwzw7t0BR8XMphenji4SmIoNZPn8zhYmaVKP8=
go.shabbyrobe.org/gocovmerge v0.0.0-20230507111327-fa4f82cfbf4d/go.mod h1:92Uoe3l++MlthCm+koNi0tcUCX3anayogF0Pa/sp24k=
go.temporal.io/api v1.5.0/go.mod h1:BqKxEJJYdxb5dqf0ODfzfMxh8UEQ5L3zKS51FiIYYkA=
go.temporal.io/api v1.63.5 h1:c11+kPYHkXXL3UiShPdbMD+xtvqGsbTibUA9ypmiCa4=
go.temporal.io/api v1.63.5/go.mod h1:SrlW2JMwVlDP4nRWSNznUFqnSHd+YeMDS1BkYo63HCQ=
go.temporal.io/api v1.64.3 h1:Q2oP9jVB5pSputb2j3BLAEjJsi8A2tSzMojqcSGyga0=
go.temporal.io/api v1.64.3/go.mod h1:acM0I9WPuYg8W3Pd9jOZvEgi7mRUttUQ4+e7fowKVnM=
go.temporal.io/sdk v1.12.0/go.mod h1:lSp3lH1lI0TyOsus0arnO3FYvjVXBZGi/G7DjnAnm6o=
go.temporal.io/sdk v1.49.0 h1:CtGI0BUe/SCo3eoqTwuWWtXKueii9GBVus7KrKKH1Vo=
go.temporal.io/sdk v1.49.0/go.mod h1:xP0FulN5JJSfisESUP60LlWsrKz2tLSStGjVdk8r5cc=
go.temporal.io/sdk v1.51.0 h1:RsEghFfg91qWgNaecRgPrms9TA7iXskSzSQO2BwhJRs=
go.temporal.io/sdk v1.51.0/go.mod h1:Gj2KwnQAlMhPRSX1RoqV3Zez8Y0U+6dCGxn1sg+j9kg=
go.temporal.io/sdk/contrib/aws/lambdaworker v0.1.1 h1:AQBa7CN+EOWhZaf4vr46TfxTZM7yCsvrzAsKqrExxmQ=
go.temporal.io/sdk/contrib/aws/lambdaworker v0.1.1/go.mod h1:Rgn/tlb4MDNAAjnXKNgHui4IY+MogMCk4Y4c2YA6Dcc=
go.temporal.io/sdk/contrib/aws/lambdaworker/otel v0.1.1 h1:sMTtpD5jsb4FeJadYkoOOzb84oWYK2/g0keb3IRO6xY=
Expand Down
4 changes: 2 additions & 2 deletions java-sandbox/activities/basics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions java-sandbox/activities/benign-exceptions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions java-sandbox/activities/execution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions java-sandbox/activities/standalone-activities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-envconfig</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions java-sandbox/activities/timeouts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions java-sandbox/best-practices/data-conversion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions java-sandbox/best-practices/data-encryption/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions java-sandbox/best-practices/error-handling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
6 changes: 3 additions & 3 deletions java-sandbox/best-practices/external-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-sdk</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>

<!-- @@@SNIPSTART java-external-storage-maven-dependency -->
<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-payload-storage-s3driver-awssdkv2</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
</dependency>
<!-- @@@SNIPEND -->

<dependency>
<groupId>io.temporal</groupId>
<artifactId>temporal-testing</artifactId>
<version>1.40.0</version>
<version>1.41.1</version>
<scope>test</scope>
</dependency>

Expand Down
Loading