workflow.go ×7

Frontier kind: Code frontier

unlabeled · c_cd1b5ff85e42

208 tests · 2797 LOC · 132 files · introduces 0 tests · 48 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges48 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
415 ranges2797 lines · 132 files · Browse complete extent
All tests (intent)
208 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.

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

go.temporal.io/server/service/worker/workerdeployment/workflow.go 42 introduced LOC · 7 ranges

Open complete file

1730 }
1731
1732 > func (d *WorkflowRunner) updateMemo(ctx workflow.Context) error { workflow.go
1733 > // TODO(carlydf): remove verbose logging
1734 > d.logger.Info("Updating workflow memo",
1735 > "routing_config", d.State.GetRoutingConfig(),
1736 > //nolint:staticcheck // SA1019: worker versioning v0.31
1737 > "current_version", d.State.GetRoutingConfig().GetCurrentVersion(),
1738 > //nolint:staticcheck // SA1019: worker versioning v0.31
1739 > "ramping_version", d.State.GetRoutingConfig().GetRampingVersion())
1740 >
1741 > return workflow.UpsertMemo(ctx, map[string]any{
1742 > WorkerDeploymentMemoField: &deploymentspb.WorkerDeploymentWorkflowMemo{
1743 > DeploymentName: d.DeploymentName,
1744 > CreateTime: d.State.CreateTime,
1745 > RoutingConfig: d.State.RoutingConfig,
1746 > LatestVersionSummary: d.getLatestVersionSummary(),
1747 > CurrentVersionSummary: d.getCurrentVersionSummary(),
1748 > RampingVersionSummary: d.getRampingVersionSummary(),
1749 > },
1750 > })
1751 > }
1752
1753 func (d *WorkflowRunner) setStateChanged() {
1755 }
1756
1757 > func (d *WorkflowRunner) sortedSummaries() []*deploymentspb.WorkerDeploymentVersionSummary { workflow.go
1758 > var sortedSummaries []*deploymentspb.WorkerDeploymentVersionSummary
1759 > for _, k := range workflow.DeterministicKeys(d.State.Versions) {
1760 s := d.State.Versions[k]
1761 sortedSummaries = append(sortedSummaries, s)
1762 }
1763
1764 > slices.SortFunc(sortedSummaries, func(a, b *deploymentspb.WorkerDeploymentVersionSummary) int { workflow.go
1765 // sorts in ascending order.
1766 // cmp(a, b) should return a negative number when a < b, a positive number when a > b,
1773 return 0
1774 })
1775 > return sortedSummaries workflow.go
1776 }
1777
1778 > func (d *WorkflowRunner) getLatestVersionSummary() *deploymentpb.WorkerDeploymentInfo_WorkerDeploymentVersionSummary { workflow.go
1779 > sortedSummaries := d.sortedSummaries()
1780 > if len(sortedSummaries) == 0 {
1781 return nil
1782 }
1785 }
1786
1787 > func (d *WorkflowRunner) getCurrentVersionSummary() *deploymentpb.WorkerDeploymentInfo_WorkerDeploymentVersionSummary { workflow.go
1788 > // The deployment workflow still uses the deprecated fields from v0.31. Hence, the current version is read from
1789 > // CurrentVersion and not CurrentDeploymentVersion. This shall change before GA.
1790 > currentVersion := d.GetState().GetRoutingConfig().GetCurrentVersion() //nolint:staticcheck
1791 > currentVersionSummary := d.GetState().GetVersions()[currentVersion]
1792 >
1793 > if currentVersionSummary == nil {
1794 return nil
1795 }
1797 }
1798
1799 > func (d *WorkflowRunner) getRampingVersionSummary() *deploymentpb.WorkerDeploymentInfo_WorkerDeploymentVersionSummary { workflow.go
1800 > // The deployment workflow still uses the deprecated fields from v0.31. Hence, the ramping version is read from
1801 > // RampingVersion and not RampingDeploymentVersion. This shall change before GA.
1802 > rampingVersion := d.GetState().GetRoutingConfig().GetRampingVersion() //nolint:staticcheck
1803 > rampingVersionSummary := d.GetState().GetVersions()[rampingVersion]
1804 >
1805 > if rampingVersionSummary == nil {
1806 return nil
1807 }
go.temporal.io/server/api/deployment/v1/message.pb.go 6 introduced LOC · 2 ranges

Open complete file

736 }
737
738 > func (x *WorkerDeploymentLocalState) GetVersions() map[string]*WorkerDeploymentVersionSummary { message.pb.go
739 > if x != nil {
740 > return x.Versions
741 > }
742 return nil
743 }
3380 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
3381 if ms.LoadMessageInfo() == nil {
3382 > ms.StoreMessageInfo(mi) message.pb.go
3383 > }
3384 return ms
3385 }