MCPcopy Create free account
hub / github.com/temporalio/temporal / replaceAssignmentRule

Method replaceAssignmentRule

tests/versioning_test.go:4453–4480  ·  view source on GitHub ↗

replaceAssignmentRule replaces a new versioning assignment rule to the task queue user data. It checks the response and returns the conflict token.

(
	env *testcore.TestEnv,
	tq, newBuildID string,
	idx int32, conflictToken []byte, expectSuccess bool)

Source from the content-addressed store, hash-verified

4451// replaceAssignmentRule replaces a new versioning assignment rule to the task queue user data.
4452// It checks the response and returns the conflict token.
4453func (s *VersioningIntegSuite) replaceAssignmentRule(
4454 env *testcore.TestEnv,
4455 tq, newBuildID string,
4456 idx int32, conflictToken []byte, expectSuccess bool) []byte {
4457 res, err := env.FrontendClient().UpdateWorkerVersioningRules(s.Context(), &workflowservice.UpdateWorkerVersioningRulesRequest{
4458 Namespace: env.Namespace().String(),
4459 TaskQueue: tq,
4460 ConflictToken: conflictToken,
4461 Operation: &workflowservice.UpdateWorkerVersioningRulesRequest_ReplaceAssignmentRule{
4462 ReplaceAssignmentRule: &workflowservice.UpdateWorkerVersioningRulesRequest_ReplaceBuildIdAssignmentRule{
4463 RuleIndex: idx,
4464 Rule: &taskqueuepb.BuildIdAssignmentRule{
4465 TargetBuildId: newBuildID,
4466 },
4467 },
4468 },
4469 })
4470 if expectSuccess {
4471 s.NoError(err)
4472 s.NotNil(res)
4473 s.Equal(newBuildID, res.GetAssignmentRules()[idx].GetRule().GetTargetBuildId())
4474 return res.GetConflictToken()
4475 } else {
4476 s.Error(err)
4477 s.Nil(res)
4478 return nil
4479 }
4480}
4481
4482// deleteAssignmentRule deletes the versioning assignment rule at a given index.
4483// It checks the response and returns the conflict token.

Callers 2

Calls 11

NoErrorMethod · 0.80
GetAssignmentRulesMethod · 0.80
FrontendClientMethod · 0.65
ContextMethod · 0.65
StringMethod · 0.65
NamespaceMethod · 0.65
EqualMethod · 0.65
ErrorMethod · 0.65
GetRuleMethod · 0.45
GetConflictTokenMethod · 0.45

Tested by

no test coverage detected