Skip to content

Commit

Permalink
Merge pull request #553: Expose Typed Search Attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk authored Feb 4, 2025
2 parents fc67190 + 8ca1c3f commit 3a61fca
Show file tree
Hide file tree
Showing 46 changed files with 2,202 additions and 224 deletions.
13 changes: 3 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
* text=auto

.github/ export-ignore
/.* export-ignore
config/ export-ignore
resources/scripts/ export-ignore
runtime/ export-ignore
tests/ export-ignore

.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php-cs-fixer.dist.php export-ignore
dload.xml export-ignore
/*.xml export-ignore
/*.xml.dist export-ignore
Makefile export-ignore
phpunit.xml.dist export-ignore
psalm.xml export-ignore
psalm-baseline.xml export-ignore
phpdoc.dist.xml export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Thumbs.db
*.exe
rr
temporal-test-server
.ai
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
->include(__DIR__ . '/src')
->include(__DIR__ . '/testing/src')
->include(__FILE__)
->exclude(__DIR__ . '/src/Client/GRPC/ServiceClientInterface.php')
->allowRisky(true)
->build();
49 changes: 25 additions & 24 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@
"php": ">=8.1",
"ext-curl": "*",
"ext-json": "*",
"google/common-protos": "^1.3 || ^2.0 || ^3.0 || ^4.0",
"google/protobuf": "^3.22 || ^4.0",
"grpc/grpc": "^1.42",
"nesbot/carbon": "^2.72 || ^3.0.2",
"psr/log": "^2.0 || ^3.0",
"ramsey/uuid": "^4.7",
"react/promise": "^2.9",
"roadrunner-php/roadrunner-api-dto": "^1.9.0",
"roadrunner-php/version-checker": "^1.0",
"spiral/attributes": "^3.1.6",
"spiral/roadrunner": "^2024.3",
"spiral/roadrunner-cli": "^2.5",
"spiral/roadrunner-kv": "^4.2",
"spiral/roadrunner-worker": "^3.5",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
"symfony/http-client": "^5.4.3 || ^6.0.3 || ^7.0",
"symfony/process": "^5.4 || ^6.0 || ^7.0"
"google/common-protos": "^1.4 || ^2.2 || ^3.2 || ^4.9",
"google/protobuf": "^3.25.5 || ^4.29.3",
"grpc/grpc": "^1.57",
"nesbot/carbon": "^2.72.6 || ^3.8.4",
"psr/log": "^2.0 || ^3.0.2",
"ramsey/uuid": "^4.7.6",
"react/promise": "^2.11",
"roadrunner-php/roadrunner-api-dto": "^1.10.0",
"roadrunner-php/version-checker": "^1.0.1",
"spiral/attributes": "^3.1.8",
"spiral/roadrunner": "^2024.3.2",
"spiral/roadrunner-cli": "^2.6",
"spiral/roadrunner-kv": "^4.3",
"spiral/roadrunner-worker": "^3.6.1",
"symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0",
"symfony/http-client": "^5.4.49 || ^6.4.17 || ^7.0",
"symfony/polyfill-php83": "^1.31.0",
"symfony/process": "^5.4.47 || ^6.4.15 || ^7.0"
},
"autoload": {
"psr-4": {
Expand All @@ -51,18 +52,18 @@
}
},
"require-dev": {
"buggregator/trap": "^1.10.1",
"composer/composer": "^2.0",
"buggregator/trap": "^1.13.0",
"composer/composer": "^2.8.4",
"dereuromark/composer-prefer-lowest": "^0.1.10",
"doctrine/annotations": "^1.14|^2.0.0",
"doctrine/annotations": "^1.14.4 || ^2.0.2",
"internal/dload": "^1.0",
"jetbrains/phpstorm-attributes": "dev-master@dev",
"laminas/laminas-code": "^4.0",
"phpunit/phpunit": "^10.5",
"laminas/laminas-code": "^4.16",
"phpunit/phpunit": "^10.5.41",
"spiral/code-style": "~2.1.2",
"spiral/core": "^3.13",
"spiral/core": "^3.14.9",
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
"vimeo/psalm": "^4.30 || ^5.4"
"vimeo/psalm": "^5.26.1 || ^6.2"
},
"autoload-dev": {
"psr-4": {
Expand Down
66 changes: 60 additions & 6 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<files psalm-version="6.2.0@814dfde37b43a1fe6d9b0996e08b19661af53bc5">
<file src="src/Activity.php">
<ImplicitToStringCast>
<code><![CDATA[$type]]></code>
Expand Down Expand Up @@ -40,6 +40,11 @@
<code><![CDATA[recordHeartbeatByToken]]></code>
</MissingReturnType>
</file>
<file src="src/Client/Common/Paginator.php">
<PossiblyNullPropertyAssignmentValue>
<code><![CDATA[$loader->current()]]></code>
</PossiblyNullPropertyAssignmentValue>
</file>
<file src="src/Client/GRPC/Context.php">
<ArgumentTypeCoercion>
<code><![CDATA[$format]]></code>
Expand Down Expand Up @@ -181,14 +186,20 @@
</file>
<file src="src/Client/WorkflowOptions.php">
<ImpureMethodCall>
<code><![CDATA[$this->typedSearchAttributes]]></code>
<code><![CDATA[setFields]]></code>
<code><![CDATA[setIndexedFields]]></code>
<code><![CDATA[setIndexedFields]]></code>
<code><![CDATA[toPayload]]></code>
<code><![CDATA[toPayload]]></code>
<code><![CDATA[toPayload]]></code>
</ImpureMethodCall>
<PossiblyNullReference>
<code><![CDATA[mergeWith]]></code>
</PossiblyNullReference>
<UnnecessaryVarAnnotation>
<code><![CDATA[SearchAttributeKey]]></code>
</UnnecessaryVarAnnotation>
</file>
<file src="src/Common/CronSchedule.php">
<DeprecatedClass>
Expand All @@ -214,6 +225,37 @@
<code><![CDATA[DateInterval::toDuration($this->maximumInterval)]]></code>
</PossiblyNullArgument>
</file>
<file src="src/Common/SearchAttributes/SearchAttributeKey.php">
<ImpureMethodCall>
<code><![CDATA[valueSet]]></code>
<code><![CDATA[valueUnset]]></code>
</ImpureMethodCall>
</file>
<file src="src/Common/SearchAttributes/SearchAttributeKey/KeywordListValue.php">
<MismatchingDocblockParamType>
<code><![CDATA[iterable<string|\Stringable>]]></code>
</MismatchingDocblockParamType>
</file>
<file src="src/Common/TypedSearchAttributes.php">
<InvalidArgument>
<code><![CDATA[$key]]></code>
<code><![CDATA[$key]]></code>
</InvalidArgument>
<PossiblyInvalidClone>
<code><![CDATA[clone $this->collection]]></code>
</PossiblyInvalidClone>
<PossiblyNullArrayAccess>
<code><![CDATA[$this->collection[$found]]]></code>
<code><![CDATA[$this->collection[$key]]]></code>
</PossiblyNullArrayAccess>
<PossiblyNullReference>
<code><![CDATA[$this->collection]]></code>
<code><![CDATA[$this->collection]]></code>
</PossiblyNullReference>
<UndefinedMethod>
<code><![CDATA[valueSet]]></code>
</UndefinedMethod>
</file>
<file src="src/Common/Uuid.php">
<LessSpecificReturnStatement>
<code><![CDATA[\vsprintf('%s-%s-%s-%s-%s', [
Expand Down Expand Up @@ -422,6 +464,8 @@
</PossiblyNullArgument>
<PossiblyNullReference>
<code><![CDATA[getName]]></code>
<code><![CDATA[getStartWorkflow]]></code>
<code><![CDATA[getUpdateWorkflow]]></code>
</PossiblyNullReference>
<RedundantConditionGivenDocblockType>
<code><![CDATA[$delay !== null]]></code>
Expand Down Expand Up @@ -715,11 +759,6 @@
<MoreSpecificReturnType>
<code><![CDATA[null|\Closure(Message): mixed]]></code>
</MoreSpecificReturnType>
<PossiblyFalseArgument>
<code><![CDATA[$now->modify(
\sprintf('+%d seconds +%d microseconds', $input->getSeconds(), $input->getNanos() / 1000),
)]]></code>
</PossiblyFalseArgument>
</file>
<file src="src/Internal/Marshaller/Type/ArrayType.php">
<MoreSpecificImplementedParamType>
Expand Down Expand Up @@ -1017,6 +1056,11 @@
<code><![CDATA[UpsertSearchAttributes]]></code>
</MissingImmutableAnnotation>
</file>
<file src="src/Internal/Transport/Request/UpsertTypedSearchAttributes.php">
<MissingImmutableAnnotation>
<code><![CDATA[UpsertTypedSearchAttributes]]></code>
</MissingImmutableAnnotation>
</file>
<file src="src/Internal/Transport/Router/CancelWorkflow.php">
<DocblockTypeContradiction>
<code><![CDATA[$process === null]]></code>
Expand Down Expand Up @@ -1075,6 +1119,9 @@
</ArgumentTypeCoercion>
</file>
<file src="src/Internal/Transport/Router/StartWorkflow.php">
<PossiblyFalseArgument>
<code><![CDATA[\json_encode($param)]]></code>
</PossiblyFalseArgument>
<UnnecessaryVarAnnotation>
<code><![CDATA[Input]]></code>
</UnnecessaryVarAnnotation>
Expand Down Expand Up @@ -1194,6 +1241,9 @@
</PossiblyNullReference>
</file>
<file src="src/Internal/Workflow/ScopeContext.php">
<InaccessibleProperty>
<code><![CDATA[$this->input->info->typedSearchAttributes]]></code>
</InaccessibleProperty>
<MissingImmutableAnnotation>
<code><![CDATA[ScopeContext]]></code>
</MissingImmutableAnnotation>
Expand Down Expand Up @@ -1355,6 +1405,10 @@
</PossiblyNullReference>
</file>
<file src="src/Worker/Transport/Codec/ProtoCodec/Encoder.php">
<PossiblyFalseArgument>
<code><![CDATA[\json_encode($cmd->getOptions(), JSON_INVALID_UTF8_IGNORE | JSON_UNESCAPED_UNICODE)]]></code>
<code><![CDATA[\json_encode($options)]]></code>
</PossiblyFalseArgument>
<PossiblyNullArgument>
<code><![CDATA[$cmd->getFailure()]]></code>
</PossiblyNullArgument>
Expand Down
13 changes: 0 additions & 13 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,4 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<UndefinedDocblockClass>
<errorLevel type="suppress">
<referencedClass name="UnitEnum" />
</errorLevel>
</UndefinedDocblockClass>
<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="BackedEnum" />
<referencedClass name="UnitEnum" />
</errorLevel>
</UndefinedClass>
</issueHandlers>
</psalm>
15 changes: 0 additions & 15 deletions resources/scripts/generate-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,10 @@
$interface->addMethodFromGenerator($m);

echo "[OK]\n";

$docBlock = new Generator\DocBlockGenerator(
join(
"\n",
[
'This file is part of Temporal package.',
'',
'For the full copyright and license information, please view the LICENSE',
'file that was distributed with this source code.'
]
)
);

echo "writing interface: ";

$file = new Generator\FileGenerator();
$file->setNamespace('Temporal\\Client\\GRPC');
$file->setDocBlock($docBlock);
$file->setClass($interface);
$file->setUses(
[
Expand Down Expand Up @@ -223,7 +209,6 @@

$file = new Generator\FileGenerator();
$file->setNamespace('Temporal\\Client\\GRPC');
$file->setDocBlock($docBlock);
$file->setClass($impl);
$file->setUses(
[
Expand Down
2 changes: 1 addition & 1 deletion src/Client/ClientOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ClientOptions
*/
public function __construct()
{
$this->identity = \sprintf('%d@%s', \getmypid(), \gethostname());
$this->identity = \sprintf('%d@%s', (string) \getmypid(), (string) \gethostname());
}

/**
Expand Down
Loading

0 comments on commit 3a61fca

Please sign in to comment.