history_event_util.go ×3

Frontier kind: Code frontier

unlabeled · c_7beb654277b5

5 tests · 2994 LOC · 112 files · introduces 0 tests · 52 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges52 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
431 ranges2994 lines · 112 files · Browse complete extent
All tests (intent)
5 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: 52 introduced LOC across 3 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/testing/history_event_util.go 52 introduced LOC · 3 ranges

Open complete file

437 activityTimedOut := NewHistoryEventVertex(enumspb.EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT.String())
438 activityTimedOut.SetDataFunc(func(input ...any) any {
439 > lastEvent := input[0].(*historypb.HistoryEvent) history_event_util.go
440 > lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
441 > eventID := lastGeneratedEvent.GetEventId() + 1
442 > version := input[2].(int64)
443 > historyEvent := getDefaultHistoryEvent(eventID, version)
444 > historyEvent.EventType = enumspb.EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT
445 > historyEvent.Attributes = &historypb.HistoryEvent_ActivityTaskTimedOutEventAttributes{ActivityTaskTimedOutEventAttributes: &historypb.ActivityTaskTimedOutEventAttributes{
446 > ScheduledEventId: lastEvent.GetActivityTaskStartedEventAttributes().ScheduledEventId,
447 > StartedEventId: lastEvent.EventId,
448 > Failure: &failurepb.Failure{
449 > FailureInfo: &failurepb.Failure_TimeoutFailureInfo{TimeoutFailureInfo: &failurepb.TimeoutFailureInfo{
450 > TimeoutType: enumspb.TIMEOUT_TYPE_SCHEDULE_TO_CLOSE,
451 > }},
452 > },
453 > }}
454 > return historyEvent
455 > })
456 activityCancelRequest := NewHistoryEventVertex(enumspb.EVENT_TYPE_ACTIVITY_TASK_CANCEL_REQUESTED.String())
457 activityCancelRequest.SetDataFunc(func(input ...any) any {
623 childWorkflowStart := NewHistoryEventVertex(enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED.String())
624 childWorkflowStart.SetDataFunc(func(input ...any) any {
625 > lastEvent := input[0].(*historypb.HistoryEvent) history_event_util.go
626 > lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
627 > eventID := lastGeneratedEvent.GetEventId() + 1
628 > version := input[2].(int64)
629 > historyEvent := getDefaultHistoryEvent(eventID, version)
630 > historyEvent.EventType = enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED
631 > historyEvent.Attributes = &historypb.HistoryEvent_ChildWorkflowExecutionStartedEventAttributes{ChildWorkflowExecutionStartedEventAttributes: &historypb.ChildWorkflowExecutionStartedEventAttributes{
632 > Namespace: nsName.String(),
633 > NamespaceId: nsID.String(),
634 > WorkflowType: &commonpb.WorkflowType{Name: childWorkflowPrefix + workflowType},
635 > InitiatedEventId: lastEvent.EventId,
636 > WorkflowExecution: &commonpb.WorkflowExecution{
637 > WorkflowId: childWorkflowID,
638 > RunId: uuid.NewString(),
639 > },
640 > }}
641 > return historyEvent
642 > })
643 childWorkflowCancel := NewHistoryEventVertex(enumspb.EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_CANCELED.String())
644 childWorkflowCancel.SetDataFunc(func(input ...any) any {
880 externalWorkflowCanceled := NewHistoryEventVertex(enumspb.EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED.String())
881 externalWorkflowCanceled.SetDataFunc(func(input ...any) any {
882 > lastEvent := input[0].(*historypb.HistoryEvent) history_event_util.go
883 > lastGeneratedEvent := input[1].(*historypb.HistoryEvent)
884 > eventID := lastGeneratedEvent.GetEventId() + 1
885 > version := input[2].(int64)
886 > historyEvent := getDefaultHistoryEvent(eventID, version)
887 > historyEvent.EventType = enumspb.EVENT_TYPE_EXTERNAL_WORKFLOW_EXECUTION_CANCEL_REQUESTED
888 > historyEvent.Attributes = &historypb.HistoryEvent_ExternalWorkflowExecutionCancelRequestedEventAttributes{ExternalWorkflowExecutionCancelRequestedEventAttributes: &historypb.ExternalWorkflowExecutionCancelRequestedEventAttributes{
889 > InitiatedEventId: lastEvent.EventId,
890 > Namespace: nsName.String(),
891 > NamespaceId: nsID.String(),
892 > WorkflowExecution: &commonpb.WorkflowExecution{
893 > WorkflowId: lastEvent.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes().GetWorkflowExecution().WorkflowId,
894 > RunId: lastEvent.GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes().GetWorkflowExecution().RunId,
895 > },
896 > }}
897 > return historyEvent
898 > })
899 workflowTaskCompleteToExternalWorkflowSignal := NewHistoryEventEdge(workflowTaskComplete, externalWorkflowSignal)
900 workflowTaskCompleteToExternalWorkflowCancel := NewHistoryEventEdge(workflowTaskComplete, externalWorkflowCancel)