Remove infinite version existence check#98
Merged
carlydf merged 1 commit intotemporalio:mainfrom Aug 1, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes the infinite version existence check that was performed before registering versions with Temporal, replacing it with a condition to check if the version status is NotRegistered in the planning phase. This improves abstraction by avoiding redundant server calls when status information is already available.
Key changes:
- Replace version existence checks with
NotRegisteredstatus conditions in planning phase - Reorganize test helper functions into separate files for better maintainability
- Add new Gate workflow tests for both successful and failed scenarios
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/util.go | Remove awaitVersionRegistration and related functions |
| internal/controller/execplan.go | Remove version existence checks before registering versions |
| internal/planner/planner.go | Add NotRegistered status checks to prevent actions on unregistered versions |
| internal/k8s/deployments.go | Add NewDeploymentWithControllerRef helper function |
| internal/controller/genplan.go | Simplify deployment creation using new helper |
| internal/testhelpers/workers.go | Move worker functions to testhelpers package and add Gate workflow types |
| internal/tests/internal/deployment_controller.go | Extract deployment controller functions from env_helpers |
| internal/tests/internal/env_helpers.go | Remove deployment functions, add testEnv struct |
| internal/tests/internal/integration_test.go | Add Gate workflow tests and reorganize test structure |
| internal/tests/internal/validation_helpers.go | Add nil check and fix error message terminology |
| internal/testhelpers/test_builder.go | Add Gate configuration and wait time support |
Shivs11
approved these changes
Aug 1, 2025
shashwatsuri
pushed a commit
to shashwatsuri/temporal-worker-controller
that referenced
this pull request
Apr 28, 2026
<!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> ## What was changed What it says in the title. Replaced with Version Status == NotRegistered condition in planning phase. Also reorganized test helper functions, ensured that Deployments created by test helpers can be found by the controller, and added a failed and successful Gate workflow test. ## Why? Because checking for version existence in execplan.go breaks the abstraction of only reading server status in gen status. And we have the information to not do another describe, so we should use it. Changes to test files are so that helper functions and test functions are separated and easier to read and work on. ## Checklist <!--- add/delete as needed ---> 1. Closes temporalio#57 2. How was this tested: New tests specific to Gate workflows ensure that we are not starting those workflows on a non-existent version, and old tests also show that SetCurrent and SetRamping calls are not erroring due to nonexistent version. 3. Any docs updates needed? no
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
What it says in the title.
Replaced with Version Status == NotRegistered condition in planning phase.
Also reorganized test helper functions, ensured that Deployments created by test helpers can be found by the controller, and added a failed and successful Gate workflow test.
Why?
Because checking for version existence in execplan.go breaks the abstraction of only reading server status in gen status. And we have the information to not do another describe, so we should use it.
Changes to test files are so that helper functions and test functions are separated and easier to read and work on.
Checklist
Closes Remove infinite loop from Version Registration check #57
How was this tested:
New tests specific to Gate workflows ensure that we are not starting those workflows on a non-existent version, and old tests also show that SetCurrent and SetRamping calls are not erroring due to nonexistent version.
Any docs updates needed?
no