From 0f8ed8782f95136669c0ef6a9a4bda89ada53848 Mon Sep 17 00:00:00 2001 From: Chad Retz Date: Tue, 14 Nov 2023 17:26:16 -0600 Subject: [PATCH 1/4] Add workflow ID on not-found activity error message Fixes #416 --- .github/workflows/build-binaries.yml | 2 ++ temporalio/worker/_activity.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index b0ada459..49582ead 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,5 +1,7 @@ name: Build Binaries on: + # TODO(cretz): Remove + pull_request: push: branches: - main diff --git a/temporalio/worker/_activity.py b/temporalio/worker/_activity.py index 3bc0aac0..e8435fb1 100644 --- a/temporalio/worker/_activity.py +++ b/temporalio/worker/_activity.py @@ -286,7 +286,8 @@ async def _run_activity( if not activity_def: activity_names = ", ".join(sorted(self._activities.keys())) raise temporalio.exceptions.ApplicationError( - f"Activity function {start.activity_type} is not registered on this worker, available activities: {activity_names}", + f"Activity function {start.activity_type} for workflow {start.workflow_execution.workflow_id} " + f"is not registered on this worker, available activities: {activity_names}", type="NotFoundError", ) From 4b1d66b04f515ff10c9a860b3ff840c882d9a967 Mon Sep 17 00:00:00 2001 From: Chad Retz Date: Tue, 20 Feb 2024 12:23:38 -0600 Subject: [PATCH 2/4] Remove build binaries update --- .github/workflows/build-binaries.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 49582ead..b0ada459 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,7 +1,5 @@ name: Build Binaries on: - # TODO(cretz): Remove - pull_request: push: branches: - main From ef3d037cfda7d6dbf9967f09881dc33db0dddea3 Mon Sep 17 00:00:00 2001 From: Chad Retz Date: Tue, 20 Feb 2024 13:57:12 -0600 Subject: [PATCH 3/4] Test fix --- tests/worker/test_activity.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/worker/test_activity.py b/tests/worker/test_activity.py index 4e70e797..b4411c1e 100644 --- a/tests/worker/test_activity.py +++ b/tests/worker/test_activity.py @@ -544,9 +544,8 @@ async def say_hello(name: str) -> str: id=str(uuid.uuid4()), task_queue=worker.task_queue, ) - assert str(assert_activity_application_error(err.value)) == ( - "NotFoundError: Activity function wrong_activity is not registered on this worker, " - "available activities: say_hello" + assert "Activity function wrong_activity is not registered" in str( + assert_activity_application_error(err.value) ) From 2046a494306a71a99ac4e6a972951eedcc10995c Mon Sep 17 00:00:00 2001 From: Chad Retz Date: Tue, 20 Feb 2024 14:08:37 -0600 Subject: [PATCH 4/4] Test fix --- tests/worker/test_activity.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/worker/test_activity.py b/tests/worker/test_activity.py index b4411c1e..0ae05922 100644 --- a/tests/worker/test_activity.py +++ b/tests/worker/test_activity.py @@ -544,9 +544,7 @@ async def say_hello(name: str) -> str: id=str(uuid.uuid4()), task_queue=worker.task_queue, ) - assert "Activity function wrong_activity is not registered" in str( - assert_activity_application_error(err.value) - ) + assert "is not registered" in str(assert_activity_application_error(err.value)) async def test_max_concurrent_activities(client: Client, worker: ExternalWorker):