Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0f2eedd
feat(engine): generate temporal's configuration from runtime.toml
hasithaa Oct 24, 2026
215fe37
test: run the ballerina suites on sqlite, postgresql and mysql
hasithaa Oct 24, 2026
714952b
test: run the ci gates and ballerina suites in docker
hasithaa Oct 25, 2026
b5fd4ac
fix(engine): give the generated configuration an internal frontend
hasithaa Oct 26, 2026
7cbd03c
refactor(engine): read runtime.toml with koanf
hasithaa Oct 26, 2026
562d940
test: point the runtime.toml comments at balsuite
hasithaa Oct 29, 2026
539c85f
fix(engine): verify database certificates and tighten sqlite rules
hasithaa Nov 3, 2026
8bdfaa5
test: keep the database password out of schema tool arguments
hasithaa Nov 3, 2026
4d7a32f
test: run the docker runner from linked worktrees
hasithaa Nov 3, 2026
0142ea7
test: check that a sqlite file keeps its data across a restart
hasithaa Nov 3, 2026
29e637c
fix(engine): keep the in-memory sqlite connection and refuse sqlite tls
hasithaa Nov 3, 2026
45b7585
fix(engine): refuse every database tls setting without tls
hasithaa Nov 3, 2026
c193768
fix(engine): refuse 0.0.0.0 as the broadcast address
hasithaa Nov 4, 2026
03e1f41
test: isolate concurrent engine and docker test runs
hasithaa Nov 4, 2026
63f9807
fix(engine): refuse a postgresql tls server name temporal ignores
hasithaa Nov 4, 2026
d207d00
test(engine): cover an ipv6 unspecified broadcast address
hasithaa Nov 4, 2026
b38d1cf
test: fix the engine test restart lock, toml quoting and windows stop
hasithaa Nov 4, 2026
a3c3b9b
build: let docker runs sharing the tools volume install at once
hasithaa Nov 4, 2026
b7a6810
feat(engine): map identity-provider tokens to temporal roles
hasithaa Nov 2, 2026
d46dbf7
feat(engine): secure the frontend and choose services from runtime.toml
hasithaa Nov 2, 2026
eceab09
docs: add the user guide and require it in every change
hasithaa Nov 2, 2026
3f54bb2
feat(engine): discover the identity provider's key set from its issuer
hasithaa Nov 2, 2026
0b2bc09
docs: create the WorkflowKind search attribute with the namespace
hasithaa Nov 2, 2026
109b680
fix(engine): require tls with tokens and protect the internal frontend
hasithaa Nov 3, 2026
72b53a6
docs: note the sqlite limits in the user guide
hasithaa Nov 3, 2026
2af8490
test: accept the temporal cli 1.9 wording of a tls refusal
hasithaa Nov 3, 2026
946453d
fix(engine): fetch identity provider keys only over https
hasithaa Nov 4, 2026
f735a1d
docs: note that postgresql verifies the database host name
hasithaa Nov 4, 2026
608630e
feat(engine): create and upgrade temporal's sql schema on start
hasithaa Oct 30, 2026
db2d96b
test: let the engine prepare the suites' sql databases
hasithaa Oct 30, 2026
f038c40
docs: add the database page to the user guide
hasithaa Nov 2, 2026
f86c3a2
fix(engine): resume an interrupted schema setup and lock in the database
hasithaa Nov 3, 2026
997c1c0
build: keep our own sql inside the sqlschema package
hasithaa Nov 3, 2026
568b44e
test: run a workflow across an upgrade from temporal 1.30.9
hasithaa Nov 4, 2026
aaa6160
ci: run the upgrade test only on postgresql and mysql
hasithaa Nov 4, 2026
026713f
feat(engine): add a log file and an automatic broadcast address
hasithaa Nov 2, 2026
5e83e37
build: ship start scripts, a systemd unit and the container image
hasithaa Nov 2, 2026
e1d34b0
docs: add install, container and AWS pages to the user guide
hasithaa Nov 2, 2026
bb95864
build: replace the start scripts with a native launcher
hasithaa Nov 2, 2026
59a7a49
docs: create WorkflowKind in the container try-out
hasithaa Nov 2, 2026
ace497f
fix(distribution): keep the try-out on loopback
hasithaa Nov 3, 2026
3c87a73
test(launcher): run the engine handoff in real processes
hasithaa Nov 3, 2026
3bd6c9d
fix(engine): report a log file the engine cannot open
hasithaa Nov 3, 2026
54a2fe9
ci: run the launcher tests on windows
hasithaa Nov 4, 2026
a773e6b
test(launcher): keep windows from holding directories the tests remove
hasithaa Nov 4, 2026
3944711
feat(engine): add a development mode and quiet transient start-up errors
hasithaa Nov 2, 2026
4e34273
docs: bring the launcher, profile and status notes up to date
hasithaa Nov 2, 2026
10a7bff
fix(engine): advertise a real address when dev listens everywhere
hasithaa Nov 3, 2026
7c743e5
fix(engine): create the directory of the dev database file
hasithaa Nov 3, 2026
941ac5c
test: prove that start-dev needs no namespace setup
hasithaa Nov 3, 2026
f18ad41
refactor(engine): register dev namespaces from the sqlschema package
hasithaa Nov 4, 2026
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 .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The image is assembled from the linux distribution directories only.
*
!dist/wso2-workflow-runtime-*-linux-*/
65 changes: 59 additions & 6 deletions .github/workflows/ballerina-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Ballerina tests

# Runs Ballerina programs on jBallerina (ballerina/workflow) against the engine binary built from this commit.
# Smoke on every pull request; the full suite on main, nightly and on demand.
# Runs Ballerina programs on jBallerina (ballerina/workflow) against the engine binary built from this commit, started
# from tests/engine/runtime-<database>.toml. Smoke on every pull request on SQLite, PostgreSQL and MySQL; smoke and full
# on all three on main, nightly and on demand.

on:
pull_request:
Expand All @@ -17,6 +18,12 @@ on:
default: full
type: choice
options: [smoke, full]
database:
description: 'Database'
required: true
default: sqlite
type: choice
options: [sqlite, postgresql, mysql, dev]

permissions:
contents: read
Expand All @@ -27,10 +34,12 @@ concurrency:

env:
TEMPORAL_CLI_VERSION: '1.9.1'
# Throwaway credentials for the service containers below; not a secret.
WORKFLOW_TEST_DB_PASSWORD: workflow-test

jobs:
suite:
name: ${{ matrix.suite }} suite
name: ${{ matrix.suite }} suite on ${{ matrix.database }}
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
Expand All @@ -41,6 +50,27 @@ jobs:
github.event_name == 'pull_request' && '["smoke"]' ||
github.event_name == 'workflow_dispatch' && format('["{0}"]', inputs.suite) ||
'["smoke", "full"]') }}
database: >-
${{ fromJSON(
github.event_name == 'workflow_dispatch' && format('["{0}"]', inputs.database) ||
'["sqlite", "postgresql", "mysql", "dev"]') }}
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: workflow
POSTGRES_PASSWORD: workflow-test
ports: ['15432:5432']
options: >-
--health-cmd "pg_isready -U workflow" --health-interval 5s --health-timeout 5s --health-retries 20
mysql:
image: mysql:8.4
env:
MYSQL_ROOT_PASSWORD: workflow-test
ports: ['13306:3306']
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -pworkflow-test" --health-interval 5s --health-timeout 5s
--health-retries 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -53,6 +83,11 @@ jobs:
tools/go.sum
- name: Build the engine
run: make engine && ./build/workflow-engine version
# Both service databases run in every job; one job covers the schema test for both.
- name: Test schema preparation on PostgreSQL and MySQL
if: matrix.database == 'postgresql' && matrix.suite == 'smoke'
working-directory: engine
run: go test -count=1 -run 'OnRealDatabases|LimitedToItsDatabases' -v ./internal/sqlschema
- name: Set up Ballerina (latest)
uses: ballerina-platform/setup-ballerina@585120e3f0e540bf127376ee6e75d39e8ce6aaa4 # v1.1.5
with:
Expand All @@ -67,16 +102,34 @@ jobs:
tar -xzf "$archive" temporal
sudo mv temporal /usr/local/bin/temporal
temporal --version
- name: Run the ${{ matrix.suite }} suite
# Real-engine tests driven by the Temporal CLI; one job is enough.
- name: Engine tests (restart persistence)
if: matrix.database == 'sqlite' && matrix.suite == 'smoke'
working-directory: tools
env:
WORKFLOW_ENGINE: ${{ github.workspace }}/build/workflow-engine
run: go test -count=1 -v ./internal/enginetest
- name: Run the ${{ matrix.suite }} suite on ${{ matrix.database }}
env:
ENGINE_LOG_DIR: build/logs
run: >-
go run ./tools/cmd/balsuite ${{ matrix.suite }} --database ${{ matrix.database }}
--engine build/workflow-engine
# A workflow started on the previous Temporal release, with its older schema, finishes on this engine.
- name: Upgrade from Temporal 1.30.9 on ${{ matrix.database }}
if: matrix.suite == 'smoke' && (matrix.database == 'postgresql' || matrix.database == 'mysql')
env:
ENGINE_LOG_DIR: build/logs
run: go run ./tools/cmd/balsuite ${{ matrix.suite }} --engine build/workflow-engine
run: >-
go run ./tools/cmd/balsuite upgrade --database ${{ matrix.database }}
--engine build/workflow-engine --old-temporal 1.30.9
- name: Upload engine and test logs
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ matrix.suite }}-logs
name: ${{ matrix.suite }}-${{ matrix.database }}-logs
path: |
build/logs/
tests/ballerina/${{ matrix.suite }}/target/report/
tests/ballerina/upgrade/target/report/
if-no-files-found: ignore
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,18 @@ jobs:
cache-dependency-path: engine/go.sum
- run: make engine GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }}

# The launcher starts the engine as a child process on Windows (exec elsewhere); run its process tests there.
windows-tests:
name: Launcher tests on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: engine/go.mod
cache-dependency-path: engine/go.sum
- name: Launcher tests
working-directory: engine
run: go test -count=1 -v ./internal/launcher/...
38 changes: 38 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,41 @@ jobs:
with:
version: ${{ needs.version.outputs.version }}
ref: ${{ needs.version.outputs.ref }}

# Test images go to GitHub's registry; releases go to WSO2's (release.yml).
image:
name: Publish a test image
needs: [version, build]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
IMAGE: ghcr.io/${{ github.repository }}
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.version.outputs.ref }}
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: wso2-workflow-runtime-linux-*
path: dist
merge-multiple: true
- name: Unpack the linux distributions
run: cd dist && for z in *-linux-*.zip; do unzip -q "$z"; done
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
env:
REF: ${{ needs.version.outputs.ref }}
run: |
tags="--tag $IMAGE:$VERSION"
if [[ "$REF" == "refs/heads/main" || "$REF" == "main" ]]; then tags="$tags --tag $IMAGE:nightly"; fi
docker buildx build --platform linux/amd64,linux/arm64 --build-arg VERSION="$VERSION" \
-f distribution/docker/Dockerfile $tags --push .
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,45 @@ jobs:
dist/*.sigstore.json
generate_release_notes: true
prerelease: ${{ needs.version.outputs.is_prerelease }}

# Off until the repository variable WORKFLOW_RUNTIME_IMAGE names the image in WSO2's registry (for example
# docker.wso2.com/wso2-workflow-runtime) and the secrets IMAGE_REGISTRY_USERNAME and IMAGE_REGISTRY_PASSWORD exist.
image:
name: Publish the container image
needs: [version, build]
if: vars.WORKFLOW_RUNTIME_IMAGE != ''
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # keyless signing with Sigstore
env:
IMAGE: ${{ vars.WORKFLOW_RUNTIME_IMAGE }}
VERSION: ${{ needs.version.outputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: wso2-workflow-runtime-linux-*
path: dist
merge-multiple: true
- name: Unpack the linux distributions
run: cd dist && for z in *-linux-*.zip; do unzip -q "$z"; done
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Log in to the registry
env:
REGISTRY_USERNAME: ${{ secrets.IMAGE_REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }}
run: echo "$REGISTRY_PASSWORD" | docker login "${IMAGE%%/*}" --username "$REGISTRY_USERNAME" --password-stdin
- name: Build and push
id: push
run: |
tags="--tag $IMAGE:$VERSION"
if [[ "${{ needs.version.outputs.is_prerelease }}" == "false" ]]; then tags="$tags --tag $IMAGE:latest"; fi
docker buildx build --platform linux/amd64,linux/arm64 --build-arg VERSION="$VERSION" \
-f distribution/docker/Dockerfile $tags --push --metadata-file metadata.json .
echo "digest=$(jq -r '."containerimage.digest"' metadata.json)" >> "$GITHUB_OUTPUT"
- uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
- name: Sign the image
run: cosign sign --yes "$IMAGE@${{ steps.push.outputs.digest }}"
31 changes: 31 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,43 @@ version: "2"
linters:
default: standard
enable:
- depguard
- gosec
- misspell
- unparam
- usetesting
- wastedassign
settings:
depguard:
rules:
# Our own SQL lives in internal/sqlschema; see AGENTS.md. Registering Temporal's plugins stays allowed.
sql-boundary:
files:
- $all
- "!$test"
- "!**/internal/sqlschema/*.go"
- "!**/cmd/workflow-engine-sql/*.go"
deny:
- pkg: database/sql
desc: run SQL from internal/sqlschema
- pkg: github.com/jmoiron/sqlx
desc: run SQL from internal/sqlschema
- pkg: github.com/lib/pq
desc: run SQL from internal/sqlschema
- pkg: github.com/jackc/pgx
desc: run SQL from internal/sqlschema
- pkg: github.com/go-sql-driver/mysql
desc: run SQL from internal/sqlschema
- pkg: modernc.org/sqlite
desc: run SQL from internal/sqlschema
- pkg: go.temporal.io/server/tools/sql
desc: run SQL from internal/sqlschema
- pkg: go.temporal.io/server/tools/common/schema
desc: manage Temporal's schema from internal/sqlschema
- pkg: go.temporal.io/server/common/persistence/sql$
desc: run SQL from internal/sqlschema
- pkg: go.temporal.io/server/common/persistence/sql/sqlplugin$
desc: run SQL from internal/sqlschema
usetesting:
os-temp-dir: true
staticcheck:
Expand Down
29 changes: 25 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Read [docs/guides/ARCHITECTURE.md](docs/guides/ARCHITECTURE.md) before changing
|---|---|---|
| Engine | `engine/` | Our Go binary that embeds Temporal's server (frontend, history, matching, worker) as a library, pinned in `engine/go.mod` |
| Engine endpoint | `engine/` (planned) | The integrations' one port (7233): gRPC to Temporal's frontend, `/runtime/...` HTTPS to the Manager |
| Launcher | `launcher/` (planned) | Starts components per profile, writes Temporal's configuration from `conf/runtime.toml`, enforces one-minor upgrades |
| Launcher | `engine/cmd/workflow-runtime` | `bin/workflow-runtime`, the command customers run: finds the runtime's home and starts the engine from `conf/runtime.toml` (`dev` for development mode). Supervision, restart and the one-minor upgrade guard are planned |
| Manager | `manager/` (planned) | Go service: engine administration, Workflow Management API, SSO sign-in, roles; serves both portals |
| Portals | `portals/` (planned) | Admin Portal and User Portal, static TypeScript apps served by the Manager |
| Distribution | `distribution/` | Zip and Docker layout, `conf/runtime.toml` |
Expand All @@ -35,8 +35,10 @@ Decision records live in `docs/decisions/`; feature documentation in `docs/featu
| `make tools` | Install the pinned golangci-lint, go-licenses, govulncheck and cyclonedx-gomod into `build/tools` (the targets that need them do this on first use) |
| `make lint` / `make vet` / `make fmt-check` | golangci-lint v2.13.2, go vet, gofmt |
| `make test-smoke` / `make test-full` | Ballerina suites against the engine (needs `bal` and the `temporal` CLI on `PATH`, or `BAL` / `TEMPORAL_CLI` set) |
| `make test-docker` | The CI gates and both suites in Docker, PostgreSQL and MySQL included (`DOCKER_TARGET`, `DATABASES`) |
| `make license-check` / `make vulncheck` | License gate and `govulncheck` |
| `make sbom` | CycloneDX SBOM per binary in `build/sbom/` (included by `make dist`) |
| `make dist` / `make image` | A distribution zip for `GOOS`/`GOARCH`; the container image from the linux zips (`IMAGE_PLATFORMS`, `IMAGE_ARGS=--load` or `--push`) |
| `make check` | Every gate CI runs, except the Ballerina suites |
| `make dist` | Zip for one `GOOS`/`GOARCH` in `dist/` |
| `make install-hooks` | Install the commit hook (subject format, license headers, gofmt, build, lint) |
Expand All @@ -48,6 +50,13 @@ Go 1.26.8 or later; the toolchain line in `go.work` and `engine/go.mod` selects
These are requirements, not suggestions. A change that misses one is not done.

1. **Document it in the same commit.**
- **User guide first.** Anything a user can see or do (install, configure, secure, run, connect, upgrade,
troubleshoot) updates `docs/user-guide/` with complete, working instructions: every step, command, key and
default a user needs, tried on a real build, not described from the code. Add a page when a task has none,
and update `docs/user-guide/reference/runtime-toml.md` for every configuration key.
- **Check the whole guide, not only your page.** Before opening the PR, read every page the change touches and
the pages that link to them, and make commands, key names, defaults, ports and file paths agree with the code
and with each other. A PR that leaves another page wrong is not done.
- A new or changed feature updates its page in `docs/features/` (create it from `docs/features/TEMPLATE.md`).
- A design change updates `docs/guides/ARCHITECTURE.md` or adds a decision record in `docs/decisions/`.
- A new or changed command, flag, configuration key or port updates the README, `docs/guides/DEVELOPING.md`
Expand Down Expand Up @@ -90,6 +99,10 @@ These are requirements, not suggestions. A change that misses one is not done.
`go run ./tools/cmd/<tool>`); no Python or JavaScript scripts. A shell script with logic gets its tests in
`tools/internal/scripts/`, which runs the script for real.
- Binary and product names never use "Temporal" (`workflow-engine`, not `temporal-server`).
- SQL stays in `engine/internal/sqlschema`: it alone opens database connections and runs statements, to create the
databases and manage Temporal's schema. Everything else delegates: Temporal's persistence plugins (the blank
`sqlplugin/...` imports), the DBA tool `cmd/workflow-engine-sql`, and test fixtures. The `depguard` rule in
`.golangci.yml` enforces this; widen it only with a reason in the PR.

## Tests

Expand All @@ -101,9 +114,12 @@ These are requirements, not suggestions. A change that misses one is not done.

### Ballerina suites

- `go run ./tools/cmd/balsuite <smoke|full> --engine build/workflow-engine` starts the engine on
`tests/engine/temporal-test.yaml` (ports 17xxx, in-memory SQLite, `--allow-no-auth`), creates the `default`
namespace and the `WorkflowKind` search attribute, runs `bal test` in the suite, and stops the engine.
- `go run ./tools/cmd/balsuite <smoke|full> --engine build/workflow-engine [--database sqlite|postgresql|mysql|dev]`
starts the engine from `tests/engine/runtime-<database>.toml` (ports 17xxx, `--allow-no-auth`), creating the SQL
schemas first for PostgreSQL and MySQL; then it creates the `default` namespace and the `WorkflowKind` search
attribute, runs `bal test` in the suite, and stops the engine.
- `balsuite upgrade --database postgresql|mysql` runs `tests/ballerina/upgrade` across an upgrade: its `before` group
on Temporal 1.30.9 in Docker, its `after` group on the engine started on the same databases.
- Each suite is a Ballerina package: workflows and activities in `workflows.bal`, tests in `tests/*_test.bal`
(one file per feature area), connection settings in `tests/Config.toml`.
- Tests use the public `ballerina/workflow` API only (`workflow:run`, `workflow:sendData`,
Expand All @@ -114,6 +130,11 @@ These are requirements, not suggestions. A change that misses one is not done.

## Documentation

- `docs/user-guide/` is for the people who install and run the runtime. It is the source of the Workflow Runtime
section of the WSO2 Integrator documentation (planned under `manage/workflow-runtime/` in wso2/docs-integrator,
shaped like its ICP section), so write it that way: front matter (`title`, `description`, `keywords`),
task-oriented pages, numbered steps, `:::info`/`:::tip`/`:::caution` admonitions, plain Markdown (no MDX
imports), links relative to the page. No internal plans, issue numbers or code internals.
- `docs/guides/` explains the system: `ARCHITECTURE.md` (components and how they connect), `DEVELOPING.md`
(build, run, debug), `TESTING.md` (test layers and how to add tests).
- `docs/features/` has one page per feature, from `TEMPLATE.md`: what it does, configuration, behavior, limits,
Expand Down
Loading
Loading