api.go ×5

Frontier kind: Code frontier

unlabeled · c_aa48a37d2092

7 tests · 7755 LOC · 249 files · introduces 0 tests · 85 LOC · 5 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges85 lines · 5 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1553 ranges7755 lines · 249 files · Browse complete extent
All tests (intent)
7 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.

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

go.temporal.io/server/service/history/api/signalwithstartworkflow/api.go 43 introduced LOC · 5 ranges

Open complete file

25 versionCache worker_versioning.VersionMembershipAndReactivationStatusCache,
26 reactivationSignaler api.VersionReactivationSignalerFn,
27 > ) (_ *historyservice.SignalWithStartWorkflowExecutionResponse, retError error) { api.go
28 > namespaceEntry, err := api.GetActiveNamespace(shard, namespace.ID(signalWithStartRequest.GetNamespaceId()), signalWithStartRequest.SignalWithStartRequest.WorkflowId)
29 > if err != nil {
30 return nil, err
31 }
32 > namespaceID := namespaceEntry.ID() api.go
33 >
34 > var currentWorkflowLease api.WorkflowLease
35 > currentWorkflowLease, err = workflowConsistencyChecker.GetWorkflowLease(
36 > ctx,
37 > nil,
38 > definition.NewWorkflowKey(
39 > string(namespaceID),
40 > signalWithStartRequest.SignalWithStartRequest.WorkflowId,
41 > "",
42 > ),
43 > locks.PriorityHigh,
44 > )
45 > switch err.(type) {
46 case nil:
47 defer func() { currentWorkflowLease.GetReleaseFn()(retError) }()
52 }
53
54 > startRequest := ConvertToStartRequest( api.go
55 > namespaceID,
56 > signalWithStartRequest.SignalWithStartRequest,
57 > shard.GetTimeSource().Now(),
58 > )
59 > request := startRequest.StartRequest
60 >
61 > api.MigrateWorkflowIDReusePolicyForRunningWorkflow(
62 > &signalWithStartRequest.SignalWithStartRequest.WorkflowIdReusePolicy,
63 > &signalWithStartRequest.SignalWithStartRequest.WorkflowIdConflictPolicy)
64 >
65 > api.OverrideStartWorkflowExecutionRequest(request, metrics.HistorySignalWithStartWorkflowExecutionScope, shard, shard.GetMetricsHandler())
66 >
67 > err = api.ValidateStartWorkflowExecutionRequest(ctx, request, shard, namespaceEntry, "SignalWithStartWorkflowExecution")
68 > if err != nil {
69 return nil, err
70 }
71
72 // Validation for versioning override, if any.
73 > shouldSkipReactivation, revisionNumber, err := worker_versioning.ValidateVersioningOverrideAndGetReactivationEligibility(ctx, request.GetVersioningOverride(), matchingClient, versionCache, request.GetTaskQueue().GetName(), enumspb.TASK_QUEUE_TYPE_WORKFLOW, namespaceID.String()) api.go
74 > if err != nil {
75 return nil, err
76 }
77
78 > outcome, err := SignalWithStartWorkflow( api.go
79 > ctx,
80 > shard,
81 > namespaceEntry,
82 > currentWorkflowLease,
83 > startRequest,
84 > signalWithStartRequest.SignalWithStartRequest,
85 > )
86 > if err != nil {
87 return nil, err
88 }
go.temporal.io/server/service/history/api/signalwithstartworkflow/convert.go 29 introduced LOC · 1 range

Open complete file

14 request *workflowservice.SignalWithStartWorkflowExecutionRequest,
15 now time.Time,
16 > ) *historyservice.StartWorkflowExecutionRequest { convert.go
17 > req := &workflowservice.StartWorkflowExecutionRequest{
18 > Namespace: request.GetNamespace(),
19 > WorkflowId: request.GetWorkflowId(),
20 > WorkflowType: request.GetWorkflowType(),
21 > TaskQueue: request.GetTaskQueue(),
22 > Input: request.GetInput(),
23 > WorkflowExecutionTimeout: request.GetWorkflowExecutionTimeout(),
24 > WorkflowRunTimeout: request.GetWorkflowRunTimeout(),
25 > WorkflowTaskTimeout: request.GetWorkflowTaskTimeout(),
26 > Identity: request.GetIdentity(),
27 > RequestId: request.GetRequestId(),
28 > WorkflowIdReusePolicy: request.GetWorkflowIdReusePolicy(),
29 > WorkflowIdConflictPolicy: request.GetWorkflowIdConflictPolicy(),
30 > RetryPolicy: request.GetRetryPolicy(),
31 > CronSchedule: request.GetCronSchedule(),
32 > Memo: request.GetMemo(),
33 > SearchAttributes: request.GetSearchAttributes(),
34 > Header: request.GetHeader(),
35 > WorkflowStartDelay: request.GetWorkflowStartDelay(),
36 > UserMetadata: request.UserMetadata,
37 > Links: request.GetLinks(),
38 > VersioningOverride: request.GetVersioningOverride(),
39 > Priority: request.GetPriority(),
40 > TimeSkippingConfig: request.GetTimeSkippingConfig(),
41 > }
42 >
43 > return common.CreateHistoryStartWorkflowRequest(namespaceID.String(), req, nil, nil, now)
44 > }
go.temporal.io/server/service/history/api/signalwithstartworkflow/signal_with_start_workflow.go 6 introduced LOC · 1 range

Open complete file

38 startRequest *historyservice.StartWorkflowExecutionRequest,
39 signalWithStartRequest *workflowservice.SignalWithStartWorkflowExecutionRequest,
40 > ) (startOutcome, error) { signal_with_start_workflow.go
41 > // workflow is running and restart was not requested, and conflict policy is to use existing
42 > if currentWorkflowLease != nil &&
43 > currentWorkflowLease.GetMutableState().IsWorkflowExecutionRunning() &&
44 > signalWithStartRequest.WorkflowIdConflictPolicy != enumspb.WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING &&
45 > signalWithStartRequest.WorkflowIdConflictPolicy != enumspb.WORKFLOW_ID_CONFLICT_POLICY_FAIL {
46
47 // current workflow exists & running
go.temporal.io/server/api/historyservice/v1/request_response.pb.go 4 introduced LOC · 1 range

Open complete file

3013 }
3014
3015 > func (x *SignalWithStartWorkflowExecutionRequest) GetNamespaceId() string { request_response.pb.go
3016 > if x != nil {
3017 > return x.NamespaceId
3018 > }
3019 return ""
3020 }
go.temporal.io/server/service/history/history_engine.go 3 introduced LOC · 1 range

Open complete file

658 ctx context.Context,
659 req *historyservice.SignalWithStartWorkflowExecutionRequest,
660 > ) (_ *historyservice.SignalWithStartWorkflowExecutionResponse, retError error) { history_engine.go
661 > return signalwithstartworkflow.Invoke(ctx, req, e.shardContext, e.workflowConsistencyChecker, e.matchingClient, e.versionCache, e.workerDeploymentClient.SignalVersionReactivation)
662 > }
663
664 func (e *historyEngineImpl) UpdateWorkflowExecution(