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

Typed nil versioning ramp panics #1598

Open
antlai-temporal opened this issue Aug 17, 2024 · 0 comments
Open

Typed nil versioning ramp panics #1598

antlai-temporal opened this issue Aug 17, 2024 · 0 comments

Comments

@antlai-temporal
Copy link
Contributor

Expected Behavior

The interface Ramp is an optional field for VersioningAssignmentRule, we should be able to set
it to nil regardless of the type of the nil object

Actual Behavior

Currently we can set it to untyped nil, but with a typed nil it panics with a
bad memory reference.

Steps to Reproduce the Problem

func Test_WorkerVersioningRules_typed_nil(t *testing.T) {
	ramp := &VersioningRampByPercentage{
		Percentage: 45.0,
	}
	ramp = nil

	u := UpdateWorkerVersioningRulesOptions{
		TaskQueue: "myQueue",
		Operation: &VersioningOperationInsertAssignmentRule{
			RuleIndex: 0,
			Rule: VersioningAssignmentRule{
				TargetBuildID: "2.0",
				Ramp:          ramp,
			},
		},
	}
      /// This panics....!!
	_, err := u.validateAndConvertToProto("my_namespace")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant