context.go ×7

Frontier kind: Code frontier

unlabeled · c_1ece06d019db

3 tests · 8733 LOC · 251 files · introduces 0 tests · 43 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges43 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1852 ranges8733 lines · 251 files · Browse complete extent
All tests (intent)
3 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.

4 files ranked by introduced lines: 43 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/context.go 34 introduced LOC · 7 ranges

Open complete file

315 }
316
317 > func (c *ContextImpl) GetArchetypeID() chasm.ArchetypeID { context.go
318 > return c.archetypeID
319 > }
320
321 func (c *ContextImpl) GetWorkflowKey() definition.WorkflowKey {
692 newContext historyi.WorkflowContext,
693 newMutableState historyi.MutableState,
694 > ) error { context.go
695 >
696 > return c.UpdateWorkflowExecutionWithNew(
697 > ctx,
698 > shardContext,
699 > persistence.UpdateWorkflowModeUpdateCurrent,
700 > newContext,
701 > newMutableState,
702 > historyi.TransactionPolicyActive,
703 > historyi.TransactionPolicyActive.Ptr(),
704 > )
705 > }
706
707 func (c *ContextImpl) UpdateWorkflowExecutionAsPassive(
761
762 if newContext != nil && newMutableState != nil && newWorkflowTransactionPolicy != nil {
763 > if *newWorkflowTransactionPolicy == historyi.TransactionPolicyActive { context.go
764 > execInfo := newMutableState.GetExecutionInfo()
765 > newArchetypeID := newContext.GetArchetypeID()
766 > if rl := shardContext.BusinessIDReuseRateLimiter(
767 > namespace.ID(execInfo.NamespaceId),
768 > execInfo.WorkflowId,
769 > newArchetypeID,
770 > ); rl != nil && !rl.Allow() {
771 archetypeName, _ := shardContext.ChasmRegistry().ArchetypeDisplayName(newArchetypeID)
772 metrics.BusinessIDReuseRateLimited.With(shardContext.GetMetricsHandler()).Record(
779 }
780 }
781 > c.MutableState.SetSuccessorRunID(newMutableState.GetExecutionState().RunId) context.go
782 }
783
797 var newWorkflowEventsSeq []*persistence.WorkflowEvents
798 if newContext != nil && newMutableState != nil && newWorkflowTransactionPolicy != nil {
799 > defer func() { context.go
800 > if retError != nil {
801 newContext.Clear()
802 }
803 }()
804
805 > newWorkflow, newWorkflowEventsSeq, err = newMutableState.CloseTransactionAsSnapshot( context.go
806 > ctx,
807 > *newWorkflowTransactionPolicy,
808 > )
809 > if err != nil {
810 return err
811 }
987 newRunBranchToken = task.BranchToken
988 newRunID = task.RunID
989 > case *tasks.SyncVersionedTransitionTask: context.go
990 > // Handle SyncVersionedTransitionTask specifically
991 > newRunID = task.RunID
992 default:
993 // Handle unexpected types or log an error if this case is not expected
go.temporal.io/server/service/history/shard/context_impl.go 4 introduced LOC · 2 ranges

Open complete file

632 taskMaps = append(taskMaps, request.UpdateWorkflowMutation.Tasks)
633 if request.NewWorkflowSnapshot != nil {
634 > taskMaps = append(taskMaps, request.NewWorkflowSnapshot.Tasks) context_impl.go
635 > }
636 requestCompletionFn, err := s.taskKeyManager.setAndTrackTaskKeys(taskMaps...)
637 if err != nil {
641 s.updateCloseTaskIDs(request.UpdateWorkflowMutation.ExecutionInfo, request.UpdateWorkflowMutation.Tasks)
642 if request.NewWorkflowSnapshot != nil {
643 > s.updateCloseTaskIDs(request.NewWorkflowSnapshot.ExecutionInfo, request.NewWorkflowSnapshot.Tasks) context_impl.go
644 > }
645
646 request.RangeID = s.getRangeIDLocked()
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 3 introduced LOC · 1 range

Open complete file

9851 }
9852
9853 > func (ms *MutableStateImpl) SetSuccessorRunID(runID string) { mutable_state_impl.go
9854 > ms.executionInfo.SuccessorRunId = runID
9855 > }
9856
9857 // ActivityMatchWorkflowRules checks if the activity matches any of the workflow rules
go.temporal.io/server/service/history/shard/task_request_tracker.go 2 introduced LOC · 1 range

Open complete file

53 minKeyByCategory[category] = minKey
54 } else {
55 > minKeyByCategory[category] = tasks.MinKey(minKeyByCategory[category], minKey) task_request_tracker.go
56 > }
57 }
58 }