activities.go ×4

Frontier kind: Code frontier

unlabeled · c_e2c14f0ad9a7

2 tests · 2467 LOC · 112 files · introduces 0 tests · 27 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges27 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
427 ranges2467 lines · 112 files · Browse complete extent
All tests (intent)
2 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.

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

go.temporal.io/server/service/worker/batcher/activities.go 23 introduced LOC · 4 ranges

Open complete file

387 // must all agree with the worker's bound namespace. This prevents cross-namespace
388 // escalation via the privileged internal-frontend connection (NoopClaimMapper → RoleAdmin).
389 > func (a *activities) checkNamespace(batchParams *batchspb.BatchOperationInput) error { activities.go
390 > if batchParams.NamespaceId != a.namespaceID.String() {
391 return errNamespaceMismatch
392 }
393 > ns := a.namespace.String() activities.go
394 > if req := batchParams.GetRequest(); req != nil && req.GetNamespace() != ns {
395 return errNamespaceMismatch
396 }
403 // BatchActivityWithProtobuf is an activity for processing batch operations using protobuf as the input type.
404 // nolint:revive,cognitive-complexity
405 > func (a *activities) BatchActivityWithProtobuf(ctx context.Context, batchParams *batchspb.BatchOperationInput) (HeartBeatDetails, error) { activities.go
406 > logger := a.getActivityLogger(ctx)
407 > hbd := HeartBeatDetails{}
408 > metricsHandler := a.MetricsHandler.WithTags(metrics.OperationTag(metrics.BatcherScope), metrics.NamespaceIDTag(batchParams.NamespaceId))
409 >
410 > if err := a.checkNamespace(batchParams); err != nil {
411 > metrics.BatcherOperationFailures.With(metricsHandler).Record(1)
412 > logger.Error("Failed to run batch operation due to namespace mismatch", tag.Error(err))
413 > return hbd, err
414 > }
415 ns := a.namespace.String()
416
518 }
519
520 > func (a *activities) getActivityLogger(ctx context.Context) log.Logger { activities.go
521 > wfInfo := activity.GetInfo(ctx)
522 > return log.With(
523 > a.Logger,
524 > tag.WorkflowID(wfInfo.WorkflowExecution.ID),
525 > tag.WorkflowRunID(wfInfo.WorkflowExecution.RunID),
526 > tag.WorkflowNamespace(wfInfo.WorkflowNamespace),
527 > )
528 > }
529
530 func (a *activities) adjustQueryBatchTypeEnum(query string, batchType enumspb.BatchOperationType) string {
go.temporal.io/server/api/batch/v1/request_response.pb.go 4 introduced LOC · 1 range

Open complete file

118 }
119
120 > func (x *BatchOperationInput) GetRequest() *v11.StartBatchOperationRequest { request_response.pb.go
121 > if x != nil {
122 > return x.Request
123 > }
124 return nil
125 }