Skip to content

Commit ed4d291

Browse files
committed
Merge remote-tracking branch 'origin/2.11' into 2-11-x-fixes
# Conflicts: # .github/workflows/run-test-suite.yml # src/Interceptor/WorkflowInbound/QueryInput.php # src/Internal/Workflow/Process/Scope.php # src/Internal/Workflow/WorkflowContext.php # src/Workflow.php # src/Workflow/WorkflowContextInterface.php
2 parents 942885c + 5c86db5 commit ed4d291

File tree

250 files changed

+398
-2876
lines changed

Some content is hidden

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

250 files changed

+398
-2876
lines changed

.github/workflows/run-test-suite.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,21 @@ jobs:
4242
test:
4343
name: PHP${{ matrix.php }}${{ matrix.extensions-suffix }}, ${{ matrix.os }}, ${{ matrix.dependencies }} deps
4444
runs-on: ${{ matrix.os }}
45-
timeout-minutes: ${{ matrix.timeout-minutes }}
45+
timeout-minutes: ${{ inputs.test-timeout }}
4646
env:
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
strategy:
4949
fail-fast: ${{ inputs.fail-fast }}
5050
matrix:
51-
php: [ 8.1, 8.2, 8.3 ]
52-
os: [ ubuntu-latest, windows-latest ]
51+
php: [ 8.1, 8.2, 8.3, 8.4 ]
52+
os: [ ubuntu-latest ]
5353
extensions-suffix: [ '', ', protobuf' ]
5454
dependencies: [ lowest , highest ]
55-
timeout-minutes: [ '${{ inputs.test-timeout }}' ]
56-
exclude:
57-
- os: windows-latest
58-
php: 8.2
55+
include:
5956
- os: windows-latest
6057
extensions-suffix: ', protobuf'
61-
- os: windows-latest
62-
php: 8.3
58+
php: 8.1
59+
dependencies: highest
6360
steps:
6461
- name: Set Git To Use LF
6562
run: |
@@ -82,6 +79,10 @@ jobs:
8279
- name: Validate composer.json and composer.lock
8380
run: composer validate --strict
8481

82+
- name: Download CPX (PHP 8.4)
83+
if: inputs.download-binaries == true && matrix.php == '8.4'
84+
run: composer global require cpx/cpx
85+
8586
- name: Get Composer Cache Directory
8687
id: composer-cache
8788
run: |
@@ -96,23 +97,37 @@ jobs:
9697
php-${{ matrix.php }}-${{ matrix.os }}-composer-
9798
9899
- name: Install lowest dependencies from composer.json
99-
if: matrix.dependencies == 'lowest'
100+
if: matrix.dependencies == 'lowest' && matrix.php != '8.4'
100101
run: composer update --no-interaction --no-progress --prefer-lowest
101102

103+
- name: Install lowest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
104+
if: matrix.dependencies == 'lowest' && matrix.php == '8.4'
105+
run: composer update --no-interaction --no-progress --prefer-lowest --ignore-platform-req php
106+
107+
102108
- name: Validate lowest dependencies
103-
if: matrix.dependencies == 'lowest'
109+
if: matrix.dependencies == 'lowest' && matrix.php == '8.1'
104110
env:
105111
COMPOSER_POOL_OPTIMIZER: 0
106112
run: vendor/bin/validate-prefer-lowest
107113

114+
108115
- name: Install highest dependencies from composer.json
109-
if: matrix.dependencies == 'highest'
116+
if: matrix.dependencies == 'highest' && matrix.php != '8.4'
110117
run: composer update --no-interaction --no-progress
111118

112-
- name: Download RoadRunner
113-
if: inputs.download-binaries == true
114-
run: |
115-
vendor/bin/dload get --no-interaction -vv
119+
- name: Install highest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
120+
if: matrix.dependencies == 'highest' && matrix.php == '8.4'
121+
run: composer update --no-interaction --no-progress --ignore-platform-req php
122+
123+
124+
- name: Download binaries
125+
if: inputs.download-binaries == true && matrix.php != '8.4'
126+
run: composer get:binaries
127+
128+
- name: Download binaries (PHP 8.4)
129+
if: inputs.download-binaries == true && matrix.php == '8.4'
130+
run: cpx internal/dload get --no-interaction
116131

117132
- name: Run tests
118133
run: ${{ inputs.test-command }}

.github/workflows/static-analysis.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,43 @@ jobs:
4242
- name: Install Composer Dependencies
4343
run: composer install --prefer-dist --no-interaction
4444

45-
- name: Run Tests
45+
- name: 🔍 Run Tests
4646
run: vendor/bin/psalm
47+
48+
arch:
49+
name: Architecture tests
50+
runs-on: ${{ matrix.os }}
51+
continue-on-error: true
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
php: [8.3]
56+
os: [ubuntu-latest]
57+
steps:
58+
- name: Set up PHP ${{ matrix.php }}
59+
uses: shivammathur/setup-php@v2
60+
with:
61+
php-version: ${{ matrix.php }}
62+
extensions: dom
63+
64+
- name: Check Out Code
65+
uses: actions/checkout@v4
66+
with:
67+
fetch-depth: 1
68+
69+
- name: Get Composer Cache Directory
70+
id: composer-cache
71+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
72+
73+
- name: Cache Dependencies
74+
uses: actions/cache@v3
75+
with:
76+
path: ${{ steps.composer-cache.outputs.dir }}
77+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
78+
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer-
79+
80+
- name: Install Composer Dependencies
81+
run: composer install --prefer-dist --no-interaction
82+
83+
- name: 🔍 Run Tests
84+
run: composer test:arch

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"spiral/roadrunner-kv": "^4.2",
4040
"spiral/roadrunner-worker": "^3.5",
4141
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
42-
"symfony/http-client": "^5.4 || ^6.0 || ^7.0",
42+
"symfony/http-client": "^5.4.3 || ^6.0.3 || ^7.0",
4343
"symfony/process": "^5.4 || ^6.0 || ^7.0"
4444
},
4545
"autoload": {
@@ -61,7 +61,7 @@
6161
"phpunit/phpunit": "^10.5",
6262
"spiral/code-style": "~2.1.2",
6363
"spiral/core": "^3.13",
64-
"symfony/var-dumper": "^6.0 || ^7.0",
64+
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
6565
"vimeo/psalm": "^4.30 || ^5.4"
6666
},
6767
"autoload-dev": {
@@ -81,12 +81,14 @@
8181
},
8282
"scripts": {
8383
"post-update-cmd": "Temporal\\Worker\\Transport\\RoadRunnerVersionChecker::postUpdate",
84+
"get:binaries": "dload get --no-interaction -vv",
8485
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
8586
"cs:fix": "php-cs-fixer fix -v",
8687
"psalm": "psalm",
8788
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
8889
"test:unit": "phpunit --testsuite=Unit --color=always --testdox",
8990
"test:func": "phpunit --testsuite=Functional --color=always --testdox",
91+
"test:arch": "phpunit --testsuite=Arch --color=always --testdox",
9092
"test:accept": "phpunit --testsuite=Acceptance --color=always --testdox"
9193
},
9294
"extra": {

phpunit.xml.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@
99
stopOnFailure="false"
1010
stopOnError="false"
1111
stderr="true"
12+
displayDetailsOnIncompleteTests="true"
13+
displayDetailsOnSkippedTests="true"
14+
displayDetailsOnTestsThatTriggerDeprecations="true"
15+
displayDetailsOnTestsThatTriggerErrors="true"
16+
displayDetailsOnTestsThatTriggerNotices="true"
17+
displayDetailsOnTestsThatTriggerWarnings="true"
1218
>
1319
<testsuites>
1420
<testsuite name="Acceptance">
1521
<directory suffix="Test.php">tests/Acceptance/Harness</directory>
1622
</testsuite>
23+
<testsuite name="Arch">
24+
<directory suffix="Test.php">tests/Arch</directory>
25+
</testsuite>
1726
<testsuite name="Unit">
1827
<directory suffix="TestCase.php">tests/Unit</directory>
1928
</testsuite>

psalm-baseline.xml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@
109109
<code><![CDATA[$workflowType]]></code>
110110
</PropertyNotSetInConstructor>
111111
</file>
112+
<file src="src/Client/Schedule/Spec/ScheduleSpec.php">
113+
<DeprecatedProperty>
114+
<code><![CDATA[$this->excludeCalendarList]]></code>
115+
<code><![CDATA[$this->excludeCalendarList]]></code>
116+
</DeprecatedProperty>
117+
</file>
112118
<file src="src/Client/Update/UpdateHandle.php">
113119
<PossiblyNullArgument>
114120
<code><![CDATA[$result->getSuccess()]]></code>
@@ -508,7 +514,6 @@
508514
</file>
509515
<file src="src/Internal/Declaration/Reader/WorkflowReader.php">
510516
<ArgumentTypeCoercion>
511-
<code><![CDATA[$class]]></code>
512517
<code><![CDATA[$contextualRetry]]></code>
513518
<code><![CDATA[$method]]></code>
514519
<code><![CDATA[$name]]></code>
@@ -1218,10 +1223,6 @@
12181223
<InvalidOperand>
12191224
<code><![CDATA[$promisesOrValues]]></code>
12201225
</InvalidOperand>
1221-
<MissingParamType>
1222-
<code><![CDATA[$promiseOrValue]]></code>
1223-
<code><![CDATA[$promiseOrValue]]></code>
1224-
</MissingParamType>
12251226
<TooManyArguments>
12261227
<code><![CDATA[$reduce($c, $value, $i++, $total)]]></code>
12271228
</TooManyArguments>
@@ -1367,11 +1368,6 @@
13671368
<code><![CDATA[$method]]></code>
13681369
</ArgumentTypeCoercion>
13691370
</file>
1370-
<file src="src/Worker/Transport/RPCConnectionInterface.php">
1371-
<MissingParamType>
1372-
<code><![CDATA[$payload]]></code>
1373-
</MissingParamType>
1374-
</file>
13751371
<file src="src/Worker/Transport/RoadRunner.php">
13761372
<ArgumentTypeCoercion>
13771373
<code><![CDATA[$env->getRelayAddress()]]></code>

src/Activity.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ final class Activity extends Facade
2626
/**
2727
* Returns information about current activity execution.
2828
*
29-
* @return ActivityInfo
3029
* @throws OutOfContextException in the absence of the activity execution context.
3130
*/
3231
public static function getInfo(): ActivityInfo
@@ -53,7 +52,6 @@ public static function getInfo(): ActivityInfo
5352
* }
5453
* ```
5554
*
56-
* @return ValuesInterface
5755
* @throws OutOfContextException in the absence of the activity execution context.
5856
*/
5957
public static function getInput(): ValuesInterface
@@ -69,7 +67,6 @@ public static function getInput(): ValuesInterface
6967
*
7068
* This method returns **true** if the first argument has been passed to the {@see Activity::heartbeat()} method.
7169
*
72-
* @return bool
7370
* @throws OutOfContextException in the absence of the activity execution context.
7471
*/
7572
public static function hasHeartbeatDetails(): bool

src/Activity/ActivityContextInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ interface ActivityContextInterface
2222
*
2323
* @see Activity::getInfo()
2424
*
25-
* @return ActivityInfo
2625
*/
2726
public function getInfo(): ActivityInfo;
2827

@@ -31,7 +30,6 @@ public function getInfo(): ActivityInfo;
3130
*
3231
* @see Activity::getInput()
3332
*
34-
* @return ValuesInterface
3533
*/
3634
public function getInput(): ValuesInterface;
3735

@@ -40,7 +38,6 @@ public function getInput(): ValuesInterface;
4038
*
4139
* @see Activity::hasHeartbeatDetails()
4240
*
43-
* @return bool
4441
*/
4542
public function hasHeartbeatDetails(): bool;
4643

@@ -59,7 +56,6 @@ public function getHeartbeatDetails($type = null);
5956
*
6057
* @see Activity::doNotCompleteOnReturn()
6158
*
62-
* @return void
6359
*/
6460
public function doNotCompleteOnReturn(): void;
6561

src/Activity/ActivityInfo.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,16 @@ final class ActivityInfo
3838
*
3939
* @see ActivityCompletionClientInterface::complete()
4040
*
41-
* @var string
4241
*/
4342
#[Marshal(name: 'TaskToken')]
4443
public string $taskToken;
4544

46-
/**
47-
* @var WorkflowType|null
48-
*/
4945
#[Marshal(name: 'WorkflowType', type: NullableType::class, of: WorkflowType::class)]
5046
public ?WorkflowType $workflowType = null;
5147

52-
/**
53-
* @var string
54-
*/
5548
#[Marshal(name: 'WorkflowNamespace')]
5649
public string $workflowNamespace = 'default';
5750

58-
/**
59-
* @var WorkflowExecution|null
60-
*/
6151
#[Marshal(name: 'WorkflowExecution', type: NullableType::class, of: WorkflowExecution::class)]
6252
public ?WorkflowExecution $workflowExecution = null;
6353

@@ -67,53 +57,44 @@ final class ActivityInfo
6757
*
6858
* @see ActivityCompletionClientInterface::complete()
6959
*
70-
* @var string
7160
*/
7261
#[Marshal(name: 'ActivityID')]
7362
public string $id;
7463

7564
/**
7665
* Type (name) of the activity.
7766
*
78-
* @var ActivityType
7967
*/
8068
#[Marshal(name: 'ActivityType', type: ObjectType::class, of: ActivityType::class)]
8169
public ActivityType $type;
8270

83-
/**
84-
* @var string
85-
*/
8671
#[Marshal(name: 'TaskQueue')]
8772
public string $taskQueue = WorkerFactoryInterface::DEFAULT_TASK_QUEUE;
8873

8974
/**
9075
* Maximum time between heartbeats. 0 means no heartbeat needed.
9176
*
92-
* @var \DateInterval
9377
*/
9478
#[Marshal(name: 'HeartbeatTimeout', type: DateIntervalType::class)]
9579
public \DateInterval $heartbeatTimeout;
9680

9781
/**
9882
* Time of activity scheduled by a workflow
9983
*
100-
* @var \DateTimeInterface
10184
*/
10285
#[Marshal(name: 'ScheduledTime', type: DateTimeType::class)]
10386
public \DateTimeInterface $scheduledTime;
10487

10588
/**
10689
* Time of activity start
10790
*
108-
* @var \DateTimeInterface
10991
*/
11092
#[Marshal(name: 'StartedTime', type: DateTimeType::class)]
11193
public \DateTimeInterface $startedTime;
11294

11395
/**
11496
* Time of activity timeout
11597
*
116-
* @var \DateTimeInterface
11798
*/
11899
#[Marshal(name: 'Deadline', type: DateTimeType::class)]
119100
public \DateTimeInterface $deadline;
@@ -122,7 +103,6 @@ final class ActivityInfo
122103
* Attempt starts from 1, and increased by 1 for every retry if
123104
* retry policy is specified.
124105
*
125-
* @var int
126106
*/
127107
#[Marshal(name: 'Attempt')]
128108
public int $attempt = 1;

src/Activity/ActivityInterface.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ class ActivityInterface
4949
#[Immutable]
5050
public string $prefix = '';
5151

52-
/**
53-
* @param string $prefix
54-
*/
5552
public function __construct(string $prefix = '')
5653
{
5754
$this->prefix = $prefix;

src/Activity/ActivityMethod.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ final class ActivityMethod
3333
#[Immutable]
3434
public ?string $name = null;
3535

36-
/**
37-
* @param string|null $name
38-
*/
39-
public function __construct(string $name = null)
36+
public function __construct(?string $name = null)
4037
{
4138
$this->name = $name;
4239
}

0 commit comments

Comments
 (0)