Skip to content

Conversation

robholland
Copy link
Collaborator

What was changed

Removed Ramping version from the status.

Also adjusted code around the assumed presence of CurrentVersion and TargetVersion which was inverted in comments and code.

Why?

Seeing the Ramping Version in the status may confuse users.

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@robholland robholland marked this pull request as ready for review July 8, 2025 14:50
@robholland robholland requested a review from jlegrone as a code owner July 8, 2025 14:50
@jlegrone jlegrone requested a review from Copilot July 14, 2025 19:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the deprecated RampingVersion field from the status API and updates the planner and controller layers to drive all version transitions using the TargetVersion, CurrentVersion, and a new TemporalWorkerState. Key changes:

  • Eliminate the RampingVersion structure from CRDs, deepcopy code, and status mapping.
  • Change GeneratePlan and its helper functions to take explicit status, spec, and temporalState parameters rather than embedding much of that in Config.
  • Update all tests and controller generateStatus/generatePlan calls to the new signature and behavior.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/planner/planner.go Changed planner helpers to use status and spec instead of Config.* and removed ramping version logic
internal/planner/planner_test.go Updated every test to pass the new status, spec, and state into GeneratePlan, plus removed references to ramping
internal/controller/state_mapper.go Removed mapping of RampingVersion and updated mapping of CurrentVersion and TargetVersion
internal/controller/genstatus.go Pulled in temporalState earlier and passed it through to status generation
internal/controller/genplan.go Adapted controller’s plan-generation call to the new planner signature
helm/.../temporal.io_temporalworkerdeployments.yaml Removed the rampingVersion properties from the CRD schema
api/v1alpha1/zz_generated.deepcopy.go Removed deep-copy logic for RampingVersion
api/v1alpha1/worker_types.go Deleted the RampingVersion field on TemporalWorkerDeploymentStatus
Comments suppressed due to low confidence (2)

internal/controller/state_mapper.go:36

  • This unconditionally maps an empty CurrentVersionID to a non-nil status object. Restore the original if currentVersionID != "" guard so that CurrentVersion remains nil when there is no active version.
	status.CurrentVersion = m.mapCurrentWorkerDeploymentVersion(currentVersionID)

internal/controller/state_mapper.go:101

  • The function no longer returns nil for an empty versionID, which can cause a phantom target version in status. Reintroduce the if versionID == "" { return nil } check to preserve the original semantics.
func (m *stateMapper) mapTargetWorkerDeploymentVersion(versionID string) *v1alpha1.TargetWorkerDeploymentVersion {

@robholland
Copy link
Collaborator Author

Co-pilot's state_mapper comment about status.CurrentVersion = is wrong, the function handles producing a nil correctly. The mapTargetVersion comment doesn't apply, target version can be empty, the controller unconditionally sets it.

@robholland robholland requested a review from jlegrone July 15, 2025 13:18
Copy link
Collaborator

@jlegrone jlegrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just see last comment about not using a pointer value for TargetVersion -- no worries if there are other reasons to prefer a pointer though

This is clearer than leaving it as a pointer and validating.
@robholland robholland requested a review from a team as a code owner July 18, 2025 11:27
@robholland robholland merged commit 814d1f8 into temporalio:main Jul 18, 2025
4 checks passed
@robholland robholland deleted the rh-ramping-version-oob branch July 18, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants