frontend.go ×12

Frontier kind: Code frontier

unlabeled · c_50313b9c0a70

3 tests · 2539 LOC · 125 files · introduces 0 tests · 56 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges56 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
432 ranges2539 lines · 125 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.

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

go.temporal.io/server/chasm/lib/activity/frontend.go 56 introduced LOC · 12 ranges

Open complete file

365 req *workflowservice.StartActivityExecutionRequest,
366 namespaceID namespace.ID,
367 > ) (*workflowservice.StartActivityExecutionRequest, error) { frontend.go
368 > // Since validation mutates the request, clone it first so that retries use the original
369 > // request. However if the client did not set a request ID then set that before cloning so that
370 > // retries use the same request ID.
371 > if req.GetRequestId() == "" {
372 req.RequestId = uuid.NewString()
373 }
374 > req = common.CloneProto(req) frontend.go
375 > activityType := req.ActivityType.GetName()
376 >
377 > if req.RetryPolicy == nil {
378 req.RetryPolicy = &commonpb.RetryPolicy{}
379 }
380
381 > if err := validateStartDelay(req.GetStartDelay()); err != nil { frontend.go
382 return nil, err
383 }
384 > if req.GetStartDelay().AsDuration() > 0 && !h.config.StartDelayEnabled(req.GetNamespace()) { frontend.go
385 return nil, serviceerror.NewInvalidArgument("start_delay is not enabled for this namespace")
386 }
387 // TODO(saa): when eager start is supported, deny it if start delay > 0 (same as workflow behavior).
388
389 > opts := activityOptionsFromStartRequest(req) frontend.go
390 > err := ValidateAndNormalizeStandaloneActivity(
391 > req.ActivityId,
392 > activityType,
393 > h.config.DefaultActivityRetryPolicy,
394 > h.config.MaxIDLengthLimit(),
395 > namespace.Name(req.GetNamespace()),
396 > opts,
397 > req.Priority,
398 > )
399 > if err != nil {
400 return nil, err
401 }
402 > applyActivityOptionsToStartRequest(opts, req) frontend.go
403 >
404 > err = validateAndNormalizeStartRequest(
405 > req,
406 > h.config.MaxIDLengthLimit(),
407 > h.config.BlobSizeLimitError,
408 > h.config.BlobSizeLimitWarn,
409 > h.logger,
410 > h.saMapperProvider,
411 > h.saValidator,
412 > )
413 > if err != nil {
414 return nil, err
415 }
416
417 > if cbs := req.GetCompletionCallbacks(); len(cbs) > 0 { frontend.go
418 if !h.config.EnableCallbacks(req.GetNamespace()) {
419 return nil, serviceerror.NewInvalidArgument("completion callbacks are not enabled for this namespace")
424 }
425
426 > if err := h.linkValidator.ValidateRequest(req.GetNamespace(), req.GetLinks()); err != nil { frontend.go
427 return nil, err
428 }
429
430 > if err := validateOnConflictOptions(req); err != nil { frontend.go
431 return nil, err
432 }
433
434 > return req, nil frontend.go
435 }
436
437 // activityOptionsFromStartRequest builds an ActivityOptions from the inlined fields
438 // of a StartActivityExecutionRequest for use with shared validation logic.
439 > func activityOptionsFromStartRequest(req *workflowservice.StartActivityExecutionRequest) *apiactivitypb.ActivityOptions { frontend.go
440 > return &apiactivitypb.ActivityOptions{
441 > TaskQueue: req.TaskQueue,
442 > ScheduleToCloseTimeout: req.ScheduleToCloseTimeout,
443 > ScheduleToStartTimeout: req.ScheduleToStartTimeout,
444 > StartToCloseTimeout: req.StartToCloseTimeout,
445 > HeartbeatTimeout: req.HeartbeatTimeout,
446 > RetryPolicy: req.RetryPolicy,
447 > }
448 > }
449
450 func (h *frontendHandler) PauseActivityExecution(
570
571 // applyActivityOptionsToStartRequest copies normalized values from ActivityOptions back to the StartActivityExecutionRequest.
572 > func applyActivityOptionsToStartRequest(opts *apiactivitypb.ActivityOptions, req *workflowservice.StartActivityExecutionRequest) { frontend.go
573 > req.TaskQueue = opts.TaskQueue
574 > req.ScheduleToCloseTimeout = opts.ScheduleToCloseTimeout
575 > req.ScheduleToStartTimeout = opts.ScheduleToStartTimeout
576 > req.StartToCloseTimeout = opts.StartToCloseTimeout
577 > req.HeartbeatTimeout = opts.HeartbeatTimeout
578 > req.RetryPolicy = opts.RetryPolicy
579 > }