Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new versioning fields #7119

Merged
merged 5 commits into from
Jan 21, 2025
Merged

Use new versioning fields #7119

merged 5 commits into from
Jan 21, 2025

Conversation

ShahabT
Copy link
Collaborator

@ShahabT ShahabT commented Jan 19, 2025

What changed?

Using new Deployment Options fields sent by SDK in Versioning 3 functionality. Old fields are still used when new fields are absent.
Implementation did not change, both new and old fields sent in polls and task responses are still converted to old Deployment object and used as before. Later, code will be refactored to change the Deployment usages to DeploymentVersion.
Also added new fields to replace Deployment with DeploymentVersion fields in internal protos where needed. Matching<->History communication happens via these new fields, only new internal fields are written but both new and old fields are read.

Why?

Incorporating latest renames in Versioning APIs.

How did you test it?

Existing tests changed to use new fields (or both old and new depending on the test).

Potential risks

None.

Documentation

None yet.

Is hotfix candidate?

No.

@ShahabT ShahabT requested review from carlydf and Shivs11 January 19, 2025 20:34
@ShahabT ShahabT requested a review from a team as a code owner January 19, 2025 20:34
…ctive-3.1

# Conflicts:
#	common/testing/testvars/test_vars.go
#	go.mod
#	go.sum
#	service/matching/matching_engine.go
Copy link
Member

@Shivs11 Shivs11 left a comment

Choose a reason for hiding this comment

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

just a few comments since i'm unsure about one/two things - for the most part though, this is good

@@ -100,7 +100,7 @@ func NewResult(

func (s *workerComponent) DedicatedWorkerOptions(ns *namespace.Namespace) *workercommon.PerNSDedicatedWorkerOptions {
Copy link
Member

Choose a reason for hiding this comment

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

I just opened a PR to fix this actually: #7123
No worries though, the changes seem to be the same

Comment on lines +428 to +429
Version: tv.BuildID(),
Name: tv.DeploymentSeries(),
Copy link
Member

Choose a reason for hiding this comment

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

we can now use: tv.DeploymentName() and tv.DeploymentVersion

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm... I'm actually removing them in https://github.com/temporalio/temporal/pull/7126/files#diff-969e474fa5d1098f4d0735292efd98defd6af7cc7cf4506613dc5e07991f4c46R263. The idea is we just use old BuildID and DeploymentSeries testvars in all places. Until we refactor the code and get rid of old names altogether. The problem with having two testvars (say DeploymentSeries and DeploymentName) is that test helper functions don't know to use which one and that defeats the purpose of testvars.

Copy link
Member

@Shivs11 Shivs11 Jan 21, 2025

Choose a reason for hiding this comment

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

test helper functions don't know to use which one and that defeats the purpose of testvars

can we not just write newer tests with the updated test-vars names and then when removing the old versioning names altogether, remove the old test-vars objects too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can do that, but that would require creating a clone of versioning_3_tests.go (which is not a bad idea, but not what I did, I just repurposed the tests to use new proto fields.)

if ms.GetExecutionInfo().GetVersioningInfo() == nil {
ms.GetExecutionInfo().VersioningInfo = &workflowpb.WorkflowExecutionVersioningInfo{}
if override != nil {
if ms.GetExecutionInfo().GetVersioningInfo() == nil {
Copy link
Member

Choose a reason for hiding this comment

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

do we wanna set ms.GetExecutionInfo().VersioningInfo = &workflowpb.WorkflowExecutionVersioningInfo{} regardless of override being nil or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, the idea was if override is nil it means we have an override already and want to unset it, hence ms.GetExecutionInfo().VersioningInfo has already a value. But I don't think it's wise to make that assumption. I improved the else block in line 4423.

Copy link
Member

Choose a reason for hiding this comment

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

nice, this looks much better - thanks for addressing

@ShahabT ShahabT merged commit 6fbdc7b into versioning-3.1 Jan 21, 2025
47 of 49 checks passed
@ShahabT ShahabT deleted the shahab/directive-3.1 branch January 21, 2025 21:00
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