Skip to content
Merged
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
38 changes: 28 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ jobs:
cooperative-integration:
name: Connected cooperative cancellation
if: ${{ github.event_name == 'workflow_dispatch' && inputs.cooperative_qualification }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 25
env:
COMPOSE_PROJECT_NAME: php-cooperative-${{ github.run_id }}-${{ github.run_attempt }}
Expand All @@ -788,22 +788,40 @@ jobs:
with:
path: sdk-php
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
- name: Select Ubuntu's Python 3.12
run: |
/usr/bin/python3 -I -S -c 'import sys; assert sys.version_info[:2] == (3, 12)'
echo /usr/bin >> "$GITHUB_PATH"
- name: Create isolated Composer state
run: |
state="$(mktemp -d "$RUNNER_TEMP/php-check.XXXXXX")"
mkdir -m 700 "$state/home" "$state/cache" "$state/tmp"
{
echo "COMPOSER_HOME=$state/home"
echo "COMPOSER_CACHE_DIR=$state/cache"
echo "TMPDIR=$state/tmp"
} >> "$GITHUB_ENV"
- name: Select authenticated dependency trust
id: trust
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
with:
clients: pip,python,composer,curl,git,cargo
- name: Disable APT download retries (CVE-2026-109518)
run: echo 'Acquire::Retries "0";' | sudo tee /etc/apt/apt.conf.d/99-no-retries >/dev/null
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
- uses: durable-workflow/.github/.github/actions/setup-php-linux@411a14ac07d32073eed6ab4977f2825eba4739a7 # bound-linux-php
with:
php-version: '8.3'
extensions: pcntl, posix
tools: composer:2.10.3
ini-file: production
tools: composer:2.10.3,phpunit:11.5.57
coverage: none
- name: Require the stock cooperative worker capabilities
run: |
php -r 'foreach (["pcntl", "posix"] as $extension) {
if (!extension_loaded($extension)) { throw new RuntimeException("Missing ".$extension); }
}
foreach (["pcntl_fork", "pcntl_waitpid", "pcntl_signal", "pcntl_async_signals", "posix_kill"] as $function) {
if (!function_exists($function)) { throw new RuntimeException("Missing ".$function); }
}'
- name: Check out the exact public Server source
env:
SERVER_COMMIT: ${{ inputs.server_commit }}
Expand Down Expand Up @@ -840,7 +858,7 @@ jobs:
'{qualification:"source",sdk_commit:$sdk,server_commit:$server,native_source_overlay:($native | if length > 0 then . else null end),python_sdk_commit:($python | if length > 0 then . else null end),rust_sdk_commit:($rust | if length > 0 then . else null end),cli_source_commit:($cli | if length > 0 then . else null end)}' \
> sdk-php/cooperative-source-provenance.json
- name: Verify Composer trust before requests
uses: durable-workflow/.github/.github/actions/verify-composer-trust@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/verify-composer-trust@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
- name: Bind exact CLI inspection source
if: ${{ inputs.cli_commit != '' }}
env:
Expand Down Expand Up @@ -901,7 +919,7 @@ jobs:
printf 'DURABLE_WORKFLOW_POLYGLOT_RUST_BINARY=%s\n' "$binary" >> "$GITHUB_ENV"
printf 'DURABLE_WORKFLOW_POLYGLOT_ARTIFACT_DIRECTORY=%s/sdk-php/polyglot-evidence\n' "$GITHUB_WORKSPACE" >> "$GITHUB_ENV"
- name: Verify Composer trust before requests
uses: durable-workflow/.github/.github/actions/verify-composer-trust@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/verify-composer-trust@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
with:
working-directory: sdk-php
- run: composer install --no-interaction --prefer-dist --no-progress
Expand Down
36 changes: 27 additions & 9 deletions .github/workflows/published-cancellation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ permissions:

jobs:
mixed-cascade:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
COMPOSE_PROJECT_NAME: published-cancellation-${{ github.run_id }}-${{ github.run_attempt }}
Expand All @@ -60,26 +60,44 @@ jobs:
for version in "$PHP_SDK_VERSION" "$PYTHON_SDK_VERSION" "$RUST_SDK_VERSION" "$CLI_VERSION"; do
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)\.[1-9][0-9]*)?$ ]]
done
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
- name: Select Ubuntu's Python 3.12
run: |
/usr/bin/python3 -I -S -c 'import sys; assert sys.version_info[:2] == (3, 12)'
echo /usr/bin >> "$GITHUB_PATH"
- name: Create isolated Composer state
run: |
state="$(mktemp -d "$RUNNER_TEMP/php-check.XXXXXX")"
mkdir -m 700 "$state/home" "$state/cache" "$state/tmp"
{
echo "COMPOSER_HOME=$state/home"
echo "COMPOSER_CACHE_DIR=$state/cache"
echo "TMPDIR=$state/tmp"
} >> "$GITHUB_ENV"
- name: Bootstrap published-consumer dependency trust
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
with:
clients: pip,python,composer,curl,git,cargo
- name: Disable APT download retries (CVE-2026-109518)
run: echo 'Acquire::Retries "0";' | sudo tee /etc/apt/apt.conf.d/99-no-retries >/dev/null
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
- uses: durable-workflow/.github/.github/actions/setup-php-linux@411a14ac07d32073eed6ab4977f2825eba4739a7 # bound-linux-php
with:
php-version: '8.3'
extensions: pcntl, posix
tools: composer:2.10.3
ini-file: production
tools: composer:2.10.3,phpunit:11.5.57
coverage: none
- name: Require the stock cooperative worker capabilities
run: |
php -r 'foreach (["pcntl", "posix"] as $extension) {
if (!extension_loaded($extension)) { throw new RuntimeException("Missing ".$extension); }
}
foreach (["pcntl_fork", "pcntl_waitpid", "pcntl_signal", "pcntl_async_signals", "posix_kill"] as $function) {
if (!function_exists($function)) { throw new RuntimeException("Missing ".$function); }
}'
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: 1.86.0
- name: Verify Composer trust before requests
uses: durable-workflow/.github/.github/actions/verify-composer-trust@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/verify-composer-trust@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
- name: Install the published SDKs and CLI
run: |
set -euo pipefail
Expand Down
38 changes: 28 additions & 10 deletions .github/workflows/service-mode-published-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ permissions:
jobs:
source-free-service-mode:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
DURABLE_WORKFLOW_SERVER_URL: http://127.0.0.1:8080
Expand All @@ -54,24 +54,42 @@ jobs:
exit 1
fi

- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
- name: Select Ubuntu's Python 3.12
run: |
/usr/bin/python3 -I -S -c 'import sys; assert sys.version_info[:2] == (3, 12)'
echo /usr/bin >> "$GITHUB_PATH"
- name: Create isolated Composer state
run: |
state="$(mktemp -d "$RUNNER_TEMP/php-check.XXXXXX")"
mkdir -m 700 "$state/home" "$state/cache" "$state/tmp"
{
echo "COMPOSER_HOME=$state/home"
echo "COMPOSER_CACHE_DIR=$state/cache"
echo "TMPDIR=$state/tmp"
} >> "$GITHUB_ENV"
- name: Select authenticated dependency trust
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
with:
clients: pip,python,composer,curl,git
- name: Disable APT download retries (CVE-2026-109518)
run: echo 'Acquire::Retries "0";' | sudo tee /etc/apt/apt.conf.d/99-no-retries >/dev/null
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
- uses: durable-workflow/.github/.github/actions/setup-php-linux@411a14ac07d32073eed6ab4977f2825eba4739a7 # bound-linux-php
with:
php-version: '8.3'
extensions: pcntl, posix
tools: composer:2.10.3
ini-file: production
tools: composer:2.10.3,phpunit:11.5.57
coverage: none
- name: Require the stock cooperative worker capabilities
run: |
php -r 'foreach (["pcntl", "posix"] as $extension) {
if (!extension_loaded($extension)) { throw new RuntimeException("Missing ".$extension); }
}
foreach (["pcntl_fork", "pcntl_waitpid", "pcntl_signal", "pcntl_async_signals", "posix_kill"] as $function) {
if (!function_exists($function)) { throw new RuntimeException("Missing ".$function); }
}'

- name: Verify Composer trust before requests
uses: durable-workflow/.github/.github/actions/verify-composer-trust@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/verify-composer-trust@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
- name: Resolve the immutable published SDK release
env:
SDK_VERSION: ${{ inputs.sdk_version }}
Expand Down Expand Up @@ -110,7 +128,7 @@ jobs:
PHP

- name: Verify Composer trust before requests
uses: durable-workflow/.github/.github/actions/verify-composer-trust@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
uses: durable-workflow/.github/.github/actions/verify-composer-trust@242c2a7fb23459db2e1ada5f84dbee6d61d9b1e5 # clean-trust
- name: Install only the published package
env:
SDK_VERSION: ${{ inputs.sdk_version }}
Expand Down
41 changes: 41 additions & 0 deletions tests/Integration/ActivityLeaseObservationTransport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace DurableWorkflow\Tests\Integration;

use DurableWorkflow\Transport\BoundedTransport;
use DurableWorkflow\Transport\Psr18Transport;

/** Observes only acknowledged presence from the independent lease helper. */
final class ActivityLeaseObservationTransport implements BoundedTransport
{
private readonly Psr18Transport $inner;

public function __construct(private readonly string $path)
{
$this->inner = new Psr18Transport();
}

public function supportsBoundedRequests(): bool { return $this->inner->supportsBoundedRequests(); }

public function send(string $method, string $uri, array $headers, ?array $body = null): ?array
{
return $this->inner->send($method, $uri, $headers, $body);
}

public function sendBounded(string $method, string $uri, array $headers, ?array $body, int $timeoutSeconds): ?array
{
$reply = $this->inner->sendBounded($method, $uri, $headers, $body, $timeoutSeconds);
if (str_ends_with($uri, '/worker/heartbeat') && ($reply['acknowledged'] ?? false) === true) {
$temporary = $this->path.'.tmp';
file_put_contents($temporary, json_encode([
'worker_id' => $reply['worker_id'] ?? null, 'acknowledged' => true,
], JSON_THROW_ON_ERROR), LOCK_EX);
chmod($temporary, 0600);
rename($temporary, $this->path);
}

return $reply;
}
}
Loading
Loading