Skip to content

Commit 118af2a

Browse files
authored
Merge pull request #643: Update Temporal API and protobuf integration
2 parents eb956d6 + 5a50313 commit 118af2a

File tree

9 files changed

+10
-43
lines changed

9 files changed

+10
-43
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
"php": ">=8.1",
2525
"ext-curl": "*",
2626
"ext-json": "*",
27-
"google/common-protos": "^1.4 || ^2.2 || ^3.2 || ^4.9",
28-
"google/protobuf": "^3.25.5 || ^4.29.3",
27+
"google/common-protos": "^4.9",
28+
"google/protobuf": "^4.31.1",
2929
"grpc/grpc": "^1.57",
3030
"nesbot/carbon": "^2.72.6 || ^3.8.4",
3131
"psr/log": "^2.0 || ^3.0.2",
3232
"ramsey/uuid": "^4.7.6",
3333
"react/promise": "^2.11",
34-
"roadrunner-php/roadrunner-api-dto": "^1.12.0",
34+
"roadrunner-php/roadrunner-api-dto": "^1.13.0",
3535
"roadrunner-php/version-checker": "^1.0.1",
3636
"spiral/attributes": "^3.1.8",
3737
"spiral/roadrunner": "^2025.1.2",

psalm-baseline.xml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="6.13.0@70cdf647255a1362b426bb0f522a85817b8c791c">
2+
<files psalm-version="6.13.1@1e3b7f0a8ab32b23197b91107adc0a7ed8a05b51">
33
<file src="src/Activity.php">
44
<ImplicitToStringCast>
55
<code><![CDATA[$type]]></code>
@@ -115,11 +115,6 @@
115115
<code><![CDATA[$workflowType]]></code>
116116
</PropertyNotSetInConstructor>
117117
</file>
118-
<file src="src/Client/Schedule/ScheduleHandle.php">
119-
<RawObjectIteration>
120-
<code><![CDATA[$response->getStartTime()]]></code>
121-
</RawObjectIteration>
122-
</file>
123118
<file src="src/Client/Schedule/ScheduleOptions.php">
124119
<DeprecatedProperty>
125120
<code><![CDATA[$this->namespace]]></code>
@@ -139,14 +134,6 @@
139134
<code><![CDATA[$options->namespace]]></code>
140135
<code><![CDATA[$options->namespace]]></code>
141136
</DeprecatedProperty>
142-
<RawObjectIteration>
143-
<code><![CDATA[$response->getSchedules()]]></code>
144-
</RawObjectIteration>
145-
</file>
146-
<file src="src/Client/Workflow/WorkflowExecutionHistory.php">
147-
<RawObjectIteration>
148-
<code><![CDATA[$history->getEvents()]]></code>
149-
</RawObjectIteration>
150137
</file>
151138
<file src="src/Client/WorkflowClient.php">
152139
<ArgumentTypeCoercion>
@@ -184,9 +171,6 @@
184171
<MoreSpecificReturnType>
185172
<code><![CDATA[static]]></code>
186173
</MoreSpecificReturnType>
187-
<RawObjectIteration>
188-
<code><![CDATA[$response->getExecutions()]]></code>
189-
</RawObjectIteration>
190174
<RedundantFunctionCall>
191175
<code><![CDATA[\sprintf]]></code>
192176
<code><![CDATA[\sprintf]]></code>
@@ -302,10 +286,6 @@
302286
</MoreSpecificImplementedParamType>
303287
</file>
304288
<file src="src/DataConverter/EncodedValues.php">
305-
<InvalidArgument>
306-
<code><![CDATA[$payloads->getPayloads()]]></code>
307-
<code><![CDATA[$payloads->getPayloads()]]></code>
308-
</InvalidArgument>
309289
<PossiblyNullIterator>
310290
<code><![CDATA[$this->values]]></code>
311291
</PossiblyNullIterator>
@@ -742,16 +722,17 @@
742722
<code><![CDATA[(int) $message->getHistorySizeBytes()]]></code>
743723
<code><![CDATA[(int) $message->getStateTransitionCount()]]></code>
744724
</ArgumentTypeCoercion>
725+
<DeprecatedMethod>
726+
<code><![CDATA[getBinaryChecksum]]></code>
727+
<code><![CDATA[getMostRecentWorkerVersionStamp]]></code>
728+
</DeprecatedMethod>
745729
<DocblockTypeContradiction>
746730
<code><![CDATA[parse]]></code>
747731
<code><![CDATA[parse]]></code>
748732
<code><![CDATA[parse]]></code>
749733
<code><![CDATA[parse]]></code>
750734
<code><![CDATA[parse]]></code>
751735
</DocblockTypeContradiction>
752-
<RawObjectIteration>
753-
<code><![CDATA[$getAutoResetPoints->getPoints()]]></code>
754-
</RawObjectIteration>
755736
<RedundantConditionGivenDocblockType>
756737
<code><![CDATA[parse]]></code>
757738
</RedundantConditionGivenDocblockType>
@@ -821,9 +802,6 @@
821802
\sprintf('%d.%d', $input->getSeconds(), $input->getNanos() / 1000),
822803
)]]></code>
823804
</FalsableReturnStatement>
824-
<InvalidArgument>
825-
<code><![CDATA[$input->getPayloads()]]></code>
826-
</InvalidArgument>
827805
<InvalidFalsableReturnType>
828806
<code><![CDATA[\DateTimeImmutable]]></code>
829807
</InvalidFalsableReturnType>
@@ -1373,9 +1351,6 @@
13731351
<code><![CDATA[$e->getCode()]]></code>
13741352
<code><![CDATA[$e->getCode()]]></code>
13751353
</PossiblyInvalidArgument>
1376-
<RawObjectIteration>
1377-
<code><![CDATA[$frame->getMessages()]]></code>
1378-
</RawObjectIteration>
13791354
<TooManyArguments>
13801355
<code><![CDATA[decode]]></code>
13811356
</TooManyArguments>

src/Client/GRPC/BaseClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ private function call(string $method, object $arg, ContextInterface $ctx): objec
284284
throw new ServiceClientException($status);
285285
}
286286

287+
\assert($result !== null);
288+
287289
return $result;
288290
} catch (ServiceClientException $e) {
289291
if (!\in_array($e->getCode(), self::RETRYABLE_ERRORS, true)) {

src/Client/Schedule/ScheduleHandle.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ public function listScheduleMatchingTimes(
161161
/** @var list<\DateTimeInterface> $list */
162162
$list = [];
163163
foreach ($response->getStartTime() as $timestamp) {
164-
\assert($timestamp instanceof Timestamp);
165-
166164
$list[] = new \DateTimeImmutable("@{$timestamp->getSeconds()}");
167165
}
168166

src/Client/ScheduleClient.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ public function listSchedules(
166166

167167
$page = [];
168168
foreach ($response->getSchedules() as $message) {
169-
\assert($message instanceof \Temporal\Api\Schedule\V1\ScheduleListEntry);
170169
$values = $this->protoConverter->convert($message);
171170
$dto = new ScheduleListEntry();
172171

src/Client/Workflow/WorkflowExecutionHistory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function getEvents(): \Generator
4040
if ($history === null) {
4141
return;
4242
}
43-
/** @var HistoryEvent $event */
4443
foreach ($history->getEvents() as $event) {
4544
yield $event;
4645
}

src/Client/WorkflowClient.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Spiral\Attributes\Composite\SelectiveReader;
1919
use Spiral\Attributes\ReaderInterface;
2020
use Temporal\Api\Enums\V1\HistoryEventFilterType;
21-
use Temporal\Api\Workflow\V1\WorkflowExecutionInfo;
2221
use Temporal\Api\Workflowservice\V1\CountWorkflowExecutionsRequest;
2322
use Temporal\Api\Workflowservice\V1\GetWorkflowExecutionHistoryRequest;
2423
use Temporal\Api\Workflowservice\V1\ListWorkflowExecutionsRequest;
@@ -335,7 +334,6 @@ public function listWorkflowExecutions(
335334

336335
$page = [];
337336
foreach ($response->getExecutions() as $message) {
338-
\assert($message instanceof WorkflowExecutionInfo);
339337
$page[] = $mapper->fromMessage($message);
340338
}
341339
yield $page;

src/Internal/Mapper/WorkflowExecutionInfoMapper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Temporal\Api\Common\V1\SearchAttributes;
99
use Temporal\Api\Common\V1\WorkerVersionStamp;
1010
use Temporal\Api\Common\V1\WorkflowExecution;
11-
use Temporal\Api\Workflow\V1\ResetPointInfo;
1211
use Temporal\Api\Workflow\V1\ResetPoints;
1312
use Temporal\Api\Workflow\V1\WorkflowExecutionInfo;
1413
use Temporal\Common\WorkerVersionStamp as WorkerVersionStampDto;
@@ -118,7 +117,6 @@ private function prepareAutoResetPoints(?ResetPoints $getAutoResetPoints): array
118117

119118
$resetPoints = [];
120119
foreach ($getAutoResetPoints->getPoints() as $point) {
121-
\assert($point instanceof ResetPointInfo);
122120
$resetPoints[] = new ResetPointInfoDto(
123121
binaryChecksum: $point->getBinaryChecksum(),
124122
runId: $point->getRunId(),

src/Worker/Transport/Codec/ProtoCodec.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Temporal\DataConverter\DataConverterInterface;
1515
use Temporal\Exception\ProtocolException;
1616
use RoadRunner\Temporal\DTO\V1\Frame;
17-
use RoadRunner\Temporal\DTO\V1\Message;
1817
use Temporal\Worker\Transport\Codec\ProtoCodec\Decoder;
1918
use Temporal\Worker\Transport\Codec\ProtoCodec\Encoder;
2019
use Temporal\Worker\Transport\Command\CommandInterface;
@@ -61,7 +60,6 @@ public function decode(string $batch, array $headers = []): iterable
6160
$frame = new Frame();
6261
$frame->mergeFromString($batch);
6362

64-
/** @var Message $msg */
6563
foreach ($frame->getMessages() as $msg) {
6664
/** @psalm-suppress ArgumentTypeCoercion */
6765
$info = new TickInfo(

0 commit comments

Comments
 (0)