version_workflow.go ×6

Frontier kind: Code frontier

unlabeled · c_a477232af135

43 tests · 3014 LOC · 135 files · introduces 0 tests · 41 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges41 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
484 ranges3014 lines · 135 files · Browse complete extent
All tests (intent)
43 testsBrowse 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.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

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

1 file ranked by introduced lines: 41 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/worker/workerdeployment/version_workflow.go 41 introduced LOC · 6 ranges

Open complete file

913 // Determine propagation mode based on routing config presence
914 if rg := args.GetRoutingConfig(); rg != nil {
915 > // ASYNC MODE: propagate full routing config version_workflow.go
916 > newStatus = d.findNewVersionStatusFromRoutingConfig(rg)
917 > versionDataChanged := d.updateStateFromRoutingConfig(newStatus, state, rg)
918 > d.syncTaskQueuesAsync(ctx, args.RoutingConfig, versionDataChanged)
919 } else {
920 // SYNC MODE: propagate only version data (existing behavior)
996 state *deploymentspb.VersionLocalState,
997 rg *deploymentpb.RoutingConfig,
998 > ) bool { version_workflow.go
999 > versionDataChanged := false
1000 > // apply changes to state based on routing config
1001 > if newStatus != enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED {
1002 > // In UNSPECIFIED case the routing info doesn't affect the status of this version. It just needs to propagate to
1003 > // task queues (not sure if it happens in practice though.)
1004 >
1005 > // As of now, the only thing that affects version data is the status
1006 > versionDataChanged = state.Status != newStatus
1007 > state.Status = newStatus
1008 > state.CurrentSinceTime = nil
1009 > state.RampingSinceTime = nil
1010 > state.RampPercentage = 0
1011 > switch newStatus {
1012 case enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT:
1013 state.CurrentSinceTime = rg.GetCurrentVersionChangedTime()
1161 }
1162
1163 > func (d *VersionWorkflowRunner) findNewVersionStatusFromRoutingConfig(rg *deploymentpb.RoutingConfig) enumspb.WorkerDeploymentVersionStatus { version_workflow.go
1164 > state := d.GetVersionState()
1165 >
1166 > wasActive := state.GetCurrentSinceTime() != nil || state.GetRampingSinceTime() != nil
1167 > isCurrent := rg.GetCurrentDeploymentVersion().GetBuildId() == state.GetVersion().GetBuildId() && rg.GetCurrentDeploymentVersion().GetDeploymentName() == state.GetVersion().GetDeploymentName()
1168 > isRamping := rg.GetRampingDeploymentVersion().GetBuildId() == state.GetVersion().GetBuildId() && rg.GetRampingDeploymentVersion().GetDeploymentName() == state.GetVersion().GetDeploymentName()
1169 >
1170 > if wasActive && !isCurrent && !isRamping {
1171 return enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING
1172 > } else if isCurrent { version_workflow.go
1173 return enumspb.WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT
1174 } else if isRamping {
1492
1493 // signalPropagationComplete sends a signal to the deployment workflow when async propagation completes
1494 > func (d *VersionWorkflowRunner) signalPropagationComplete(ctx workflow.Context, revisionNumber int64) { version_workflow.go
1495 > err := workflow.SignalExternalWorkflow(
1496 > ctx,
1497 > GenerateDeploymentWorkflowID(d.VersionState.Version.DeploymentName),
1498 > "",
1499 > PropagationCompleteSignal,
1500 > &deploymentspb.PropagationCompletionInfo{
1501 > RevisionNumber: revisionNumber,
1502 > BuildId: d.VersionState.GetVersion().GetBuildId(),
1503 > },
1504 > ).Get(ctx, nil)
1505 >
1506 > if err != nil {
1507 d.logger.Error("could not signal propagation completion", "error", err)
1508 }