api.go ×6

Frontier kind: Joint frontier

unlabeled · c_1fac5978dc7d

1 test · 7665 LOC · 250 files · introduces 1 test · 44 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges44 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1561 ranges7665 lines · 250 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.

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

go.temporal.io/server/service/history/api/reapplyevents/api.go 44 introduced LOC · 6 ranges

Open complete file

82
83 if !mutableState.IsWorkflowExecutionRunning() {
84 > // need to reset target workflow (which is also the current workflow) api.go
85 > // to accept events to be reapplied
86 > baseRunID := mutableState.GetExecutionState().GetRunId()
87 > resetRunID := uuid.New()
88 > baseRebuildLastEventID := mutableState.GetLastCompletedWorkflowTaskStartedEventId()
89 > if baseRebuildLastEventID == common.EmptyEventID {
90 // No completed workflow task. Pick the reset anchor by scenario:
91 // - real pending workflow task: anchor at its ScheduledEventID. The resetter
106 }
107
108 > baseVersionHistories := mutableState.GetExecutionInfo().GetVersionHistories() api.go
109 > baseCurrentVersionHistory, err := versionhistory.GetCurrentVersionHistory(baseVersionHistories)
110 > if err != nil {
111 return nil, err
112 }
113 > baseRebuildLastEventVersion, err := versionhistory.GetVersionHistoryEventVersion(baseCurrentVersionHistory, baseRebuildLastEventID) api.go
114 > if err != nil {
115 return nil, err
116 }
117 > baseCurrentBranchToken := baseCurrentVersionHistory.GetBranchToken() api.go
118 > baseNextEventID := mutableState.GetNextEventID()
119 > baseWorkflow := ndc.NewWorkflow(
120 > shardContext.GetClusterMetadata(),
121 > context,
122 > mutableState,
123 > wcache.NoopReleaseFn,
124 > )
125 >
126 > err = workflowResetter.ResetWorkflow(
127 > ctx,
128 > namespaceID,
129 > workflowID,
130 > baseRunID,
131 > baseCurrentBranchToken,
132 > baseRebuildLastEventID,
133 > baseRebuildLastEventVersion,
134 > baseNextEventID,
135 > resetRunID.String(),
136 > baseWorkflow,
137 > baseWorkflow,
138 > ndc.EventsReapplicationResetWorkflowReason,
139 > toReapplyEvents,
140 > nil,
141 > false, // allowResetWithPendingChildren
142 > nil,
143 > )
144 > switch err.(type) {
145 case *serviceerror.InvalidArgument:
146 // no-op. Usually this is due to reset workflow with pending child workflows
147 shardContext.GetLogger().Warn("Cannot reset workflow. Ignoring reapply events.", tag.Error(err))
148 > case nil: api.go
149 // no-op
150 default:
151 return nil, err
152 }
153 > return &api.UpdateWorkflowAction{ api.go
154 > Noop: true,
155 > CreateWorkflowTask: false,
156 > }, nil
157 }
158