From 2d6d92e432bde61f2ac0e400807f418e4858f177 Mon Sep 17 00:00:00 2001 From: DanliaQwerty20 Date: Sat, 3 Oct 2026 13:55:48 +0300 Subject: [PATCH 1/2] feat: register Temporal action search attributes --- README.md | 4 ++++ compose/temporal/scripts/create-namespace.sh | 25 ++++++++++++++++++++ scripts/check-compose.ps1 | 11 +++++++++ 3 files changed, 40 insertions(+) diff --git a/README.md b/README.md index 25a216c..5b0b98f 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,10 @@ Worker, Temporal UI и Linux Compose используют внутренний потому что Docker Desktop иногда не проводит этот gRPC по имени сервиса. Адрес можно переопределить переменной `TEMPORAL_ADMIN_ADDRESS`. +Тот же bootstrap идемпотентно создаёт Keyword Search Attributes `ActionKind`, `ActionConnector`, +`ActionTenantId`, `ActionActorId`, `ActionStatus`. Поэтому Action Service может добавлять понятные +фильтры в Temporal UI как при первом запуске, так и поверх уже существующего локального volume. + Все быстрые проверки: ```powershell diff --git a/compose/temporal/scripts/create-namespace.sh b/compose/temporal/scripts/create-namespace.sh index ea703e3..6eb80c4 100644 --- a/compose/temporal/scripts/create-namespace.sh +++ b/compose/temporal/scripts/create-namespace.sh @@ -18,3 +18,28 @@ done temporal operator namespace describe --address "$TEMPORAL_ADDRESS" --namespace "$TEMPORAL_NAMESPACE" \ >/dev/null 2>&1 || temporal operator namespace create --address "$TEMPORAL_ADDRESS" \ --namespace "$TEMPORAL_NAMESPACE" --retention 24h + +attempt=1 +until search_attributes="$(temporal operator search-attribute list --address "$TEMPORAL_ADDRESS" \ + --namespace "$TEMPORAL_NAMESPACE" 2>/dev/null)"; do + if [ "$attempt" -ge "$max_attempts" ]; then + echo "Temporal search attributes did not become ready after $max_attempts attempts" >&2 + exit 1 + fi + attempt=$((attempt + 1)) + sleep 1 +done + +for attribute in ActionKind ActionConnector ActionTenantId ActionActorId ActionStatus; do + if printf '%s\n' "$search_attributes" \ + | grep -Eq "^[[:space:]]*$attribute[[:space:]]+Keyword([[:space:]]|$)"; then + continue + fi + if printf '%s\n' "$search_attributes" \ + | grep -Eq "^[[:space:]]*$attribute[[:space:]]+"; then + echo "Temporal search attribute $attribute exists with a non-Keyword type" >&2 + exit 1 + fi + temporal operator search-attribute create --address "$TEMPORAL_ADDRESS" \ + --namespace "$TEMPORAL_NAMESPACE" --name "$attribute" --type Keyword +done diff --git a/scripts/check-compose.ps1 b/scripts/check-compose.ps1 index fc3f25a..b2a5de8 100644 --- a/scripts/check-compose.ps1 +++ b/scripts/check-compose.ps1 @@ -160,6 +160,17 @@ if ($composeText -notmatch '(?ms)^ channel-gateway:.*?OIDC_AUDIENCE: channel-ga if ($composeText -notmatch 'TEMPORAL_ADMIN_ADDRESS:-temporal:7233') { throw "Portable Compose должен обращаться к Temporal по имени сервиса." } +$temporalNamespaceScript = Get-Content -Raw -LiteralPath "compose/temporal/scripts/create-namespace.sh" +foreach ($attribute in @("ActionKind", "ActionConnector", "ActionTenantId", "ActionActorId", "ActionStatus")) { + if ($temporalNamespaceScript -notmatch [regex]::Escape($attribute)) { + throw "Temporal bootstrap не регистрирует Search Attribute $attribute." + } +} +if ($temporalNamespaceScript -notmatch 'operator search-attribute list' ` + -or $temporalNamespaceScript -notmatch 'operator search-attribute create' ` + -or $temporalNamespaceScript -notmatch '\-\-type Keyword') { + throw "Temporal bootstrap должен идемпотентно регистрировать Keyword Search Attributes." +} $windowsOverride = Get-Content -Raw -LiteralPath "compose/windows.local.yaml" if ($windowsOverride -notmatch 'host.docker.internal:\$\{TEMPORAL_PORT:-7233\}' ` -or $windowsOverride -notmatch 'host.docker.internal:host-gateway') { From e6eadfb78de5fbb9ac7ceb61f1887c8db82e11a3 Mon Sep 17 00:00:00 2001 From: DanliaQwerty20 Date: Sat, 3 Oct 2026 14:05:27 +0300 Subject: [PATCH 2/2] docs: explain Temporal workflow reset --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5b0b98f..8ded89a 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,10 @@ Worker, Temporal UI и Linux Compose используют внутренний `ActionTenantId`, `ActionActorId`, `ActionStatus`. Поэтому Action Service может добавлять понятные фильтры в Temporal UI как при первом запуске, так и поверх уже существующего локального volume. +Текущий Action Workflow заменил pre-production-каркас без слоя обратной совместимости. Если volume +Temporal уже содержит workflow старого формата, один раз выполни `task reset`, а затем снова запусти +окружение. Команда удаляет локальные данные и требует подтверждения. + Все быстрые проверки: ```powershell