You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve versioning error messages, return NotFound gRPC error for all not found errors (#8641)
## What changed?
Improve versioning error messages, return NotFound gRPC error for all
not found errors
## Why?
So that users can see if they mispelled a deployment name or build id,
and generally know which versions are involved when there is an error
## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
## Potential risks
Changing the error returned only affected replay if the type of error
changes, not the string. I am keeping the type the same in the few
places where I had to change the error string, so it won't affect
workflow replay.
Error messages are not compared when checking order of commands in
workflow replay check in Go SDK here:
https://github.com/temporalio/sdk-go/blob/ad990a3bfe17560c82cf84c80dfdf6c41eb43580/internal/internal_task_handlers.go#L1616
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Standardizes NotFound errors and makes worker deployment/version
errors more informative (include deployment/build IDs), with
corresponding workflow validations and test updates.
>
> - **Worker Deployment (server)**:
> - **Error Semantics**: Use `NotFound` for missing deployments/versions
(e.g., `ErrWorkerDeploymentNotFound`,
`ErrWorkerDeploymentVersionNotFound`), replacing prior
`FailedPrecondition` in those cases.
> - **Richer Messages**: Parameterize errors with deployment/version
info (`build_id`, deployment name); add formatted messages for
draining/has-pollers/current-or-ramping; introduce suffix constants and
string matching to map workflow failures to precise non-retryable
errors.
> - **APIs Affected**: `SetCurrentVersion`, `SetRampingVersion`,
`DescribeVersion`, `DeleteVersionFromWorkerDeployment`, and update
handling (`handleUpdateVersionFailures`).
> - **Validation Updates (workflow)**: Return `FailedPreconditionf` with
version details for missing task queues, manager identity mismatch, and
current/ramping delete checks.
> - **Tests**:
> - Adjust expectations to new `NotFound` usage and formatted messages;
update assertions to use `FailedPreconditionf` message strings.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5bb0b22. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Shivam Saraf <[email protected]>
Co-authored-by: ShahabT <[email protected]>
ErrVersionIsDraining="Version cannot be deleted since it is draining."
77
-
ErrVersionHasPollers="Version cannot be deleted since it has active pollers."
78
-
ErrVersionIsCurrentOrRamping="Version cannot be deleted since it is current or ramping."
79
-
80
-
ErrRampingVersionDoesNotHaveAllTaskQueues="proposed ramping version is missing active task queues from the current version; these would become unversioned if it is set as the ramping version"
81
-
ErrCurrentVersionDoesNotHaveAllTaskQueues="proposed current version is missing active task queues from the current version; these would become unversioned if it is set as the current version"
76
+
errVersionIsDrainingSuffix="cannot be deleted since it is draining"
ErrVersionIsCurrentOrRamping="version '%s' cannot be deleted since it is current or ramping"
81
+
82
+
ErrRampingVersionDoesNotHaveAllTaskQueues="proposed ramping version '%s' is missing active task queues from the current version; these would become unversioned if it is set as the ramping version"
83
+
ErrCurrentVersionDoesNotHaveAllTaskQueues="proposed current version '%s' is missing active task queues from the current version; these would become unversioned if it is set as the current version"
82
84
ErrManagerIdentityMismatch="ManagerIdentity '%s' is set and does not match user identity '%s'; to proceed, set your own identity as the ManagerIdentity, remove the ManagerIdentity, or wait for the other client to do so"
83
-
ErrWorkerDeploymentNotFound="no Worker Deployment found with name %s; does your Worker Deployment have pollers?"
84
-
ErrWorkerDeploymentVersionNotFound="build ID %s not fount in Worker Deployment %s"
85
+
ErrWorkerDeploymentNotFound="no Worker Deployment found with name '%s'; does your Worker Deployment have pollers?"
86
+
ErrWorkerDeploymentVersionNotFound="build ID '%s' not found in Worker Deployment '%s'"
0 commit comments