worker_versioning.go ×6

Frontier kind: Joint frontier

unlabeled · c_7e02f89d813d

1 test · 2675 LOC · 139 files · introduces 1 test · 19 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges19 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
404 ranges2675 lines · 139 files · Browse complete extent
All tests (intent)
1 testBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 19 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/worker_versioning/worker_versioning.go 16 introduced LOC · 6 ranges

Open complete file

609 // ValidateDeploymentVersionFields is a helper that verifies if the fields within a
610 // Worker Deployment Version are valid
611 > func ValidateDeploymentVersionFields(fieldName string, field string, maxIDLengthLimit int) error { worker_versioning.go
612 > // Length checks
613 > if field == "" {
614 > return serviceerror.NewInvalidArgumentf("%v cannot be empty", fieldName)
615 > }
616
617 // Length of each field should be: (MaxIDLengthLimit - (prefix + delimeter length)) / 2
618 // Note: Using the same initial size for both the fields since they are used together to generate the version workflow's ID
619 > if len(field) > (maxIDLengthLimit-WorkerDeploymentVersionWorkflowIDInitialSize)/2 { worker_versioning.go
620 > return serviceerror.NewInvalidArgumentf("size of %v larger than the maximum allowed", fieldName)
621 > }
622
623 // deploymentName cannot have "."
624 // TODO: remove this restriction once the old version strings are completely cleaned from external and internal API
625 > if fieldName == WorkerDeploymentNameFieldName && strings.Contains(field, WorkerDeploymentVersionIDDelimiterV31) { worker_versioning.go
626 > return serviceerror.NewInvalidArgumentf("worker deployment name cannot contain '%s'", WorkerDeploymentVersionIDDelimiterV31)
627 > }
628 // deploymentName cannot have ":"
629 > if fieldName == WorkerDeploymentNameFieldName && strings.Contains(field, WorkerDeploymentVersionDelimiter) { worker_versioning.go
630 return serviceerror.NewInvalidArgumentf("worker deployment name cannot contain '%s'", WorkerDeploymentVersionDelimiter)
631 }
632
633 // buildID or deployment name cannot start with "__"
634 > if strings.HasPrefix(field, "__") { worker_versioning.go
635 > return serviceerror.NewInvalidArgumentf("%v cannot start with '__'", fieldName)
636 > }
637
638 > return nil worker_versioning.go
639 }
640
go.temporal.io/server/service/worker/workerdeployment/util.go 3 introduced LOC · 1 range

Open complete file

141 // validateVersionWfParams is a helper that verifies if the fields used for generating
142 // Worker Deployment Version related workflowID's are valid
143 > func validateVersionWfParams(fieldName string, field string, maxIDLengthLimit int) error { util.go
144 > return worker_versioning.ValidateDeploymentVersionFields(fieldName, field, maxIDLengthLimit)
145 > }
146
147 func GetDeploymentNameFromWorkflowID(workflowID string) string {