command_attr_validator.go ×4

Frontier kind: Code frontier

unlabeled · c_debb9661a20d

2 tests · 8888 LOC · 230 files · introduces 0 tests · 34 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges34 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1925 ranges8888 lines · 230 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.

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

go.temporal.io/server/service/history/api/respondworkflowtaskcompleted/workflow_task_completed_handler.go 15 introduced LOC · 4 ranges

Open complete file

309 historyEvent, err = handler.handleCommandCancelTimer(ctx, command.GetCancelTimerCommandAttributes())
310
311 > case enumspb.COMMAND_TYPE_RECORD_MARKER: workflow_task_completed_handler.go
312 > historyEvent, err = handler.handleCommandRecordMarker(ctx, command.GetRecordMarkerCommandAttributes())
313
314 case enumspb.COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION:
1012 _ context.Context,
1013 attr *commandpb.RecordMarkerCommandAttributes,
1014 > ) (*historypb.HistoryEvent, error) { workflow_task_completed_handler.go
1015 > if err := handler.validateCommandAttr(
1016 > func() (enumspb.WorkflowTaskFailedCause, error) {
1017 > return handler.attrValidator.ValidateRecordMarkerAttributes(attr)
1018 > },
1019 ); err != nil || handler.stopProcessing {
1020 return nil, err
1021 }
1022
1023 > metricsHandler := handler.metricsHandler.WithTags(metrics.HeaderCallsiteTag("RecordMarkerCommand")) workflow_task_completed_handler.go
1024 > metrics.HeaderSize.With(metricsHandler).Record(int64(attr.GetHeader().Size()))
1025 > if err := handler.sizeLimitChecker.checkIfPayloadSizeExceedsLimit(
1026 > metrics.CommandTypeTag(enumspb.COMMAND_TYPE_RECORD_MARKER.String()),
1027 > common.GetPayloadsMapSize(attr.GetDetails()),
1028 > "RecordMarkerCommandAttributes.Details exceeds size limit.",
1029 > ); err != nil {
1030 return nil, handler.terminateWorkflow(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES, err)
1031 }
1032
1033 > return handler.mutableState.AddRecordMarkerEvent(handler.workflowTaskCompletedID, attr) workflow_task_completed_handler.go
1034 }
1035
go.temporal.io/server/service/history/api/command_attr_validator.go 8 introduced LOC · 4 ranges

Open complete file

199 func (v *CommandAttrValidator) ValidateRecordMarkerAttributes(
200 attributes *commandpb.RecordMarkerCommandAttributes,
201 > ) (enumspb.WorkflowTaskFailedCause, error) { command_attr_validator.go
202 >
203 > const failedCause = enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES
204 > if attributes == nil {
205 return failedCause, serviceerror.NewInvalidArgument("RecordMarkerCommandAttributes is not set on RecordMarkerCommand.")
206 }
207
208 > markerName := attributes.GetMarkerName() command_attr_validator.go
209 > if markerName == "" {
210 return failedCause, serviceerror.NewInvalidArgument("MarkerName is not set on RecordMarkerCommand.")
211 }
212 > if len(markerName) > v.maxIDLengthLimit { command_attr_validator.go
213 return failedCause, serviceerror.NewInvalidArgumentf("MarkerName on RecordMarkerCommand exceeds length limit. MarkerName=%s Length=%d Limit=%d", markerName, len(markerName), v.maxIDLengthLimit)
214 }
215
216 > return enumspb.WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED, nil command_attr_validator.go
217 }
218
go.temporal.io/server/common/util.go 7 introduced LOC · 2 ranges

Open complete file

677 }
678
679 > func GetPayloadsMapSize(data map[string]*commonpb.Payloads) int { util.go
680 > size := 0
681 > for key, payloads := range data {
682 > size += len(key)
683 > size += payloads.Size()
684 > }
685
686 > return size util.go
687 }
688
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 4 introduced LOC · 2 ranges

Open complete file

5524 workflowTaskCompletedEventID int64,
5525 command *commandpb.RecordMarkerCommandAttributes,
5526 > ) (*historypb.HistoryEvent, error) { mutable_state_impl.go
5527 > opTag := tag.WorkflowActionWorkflowRecordMarker
5528 > if err := ms.checkMutability(opTag); err != nil {
5529 return nil, err
5530 }
5531
5532 > return ms.hBuilder.AddMarkerRecordedEvent(workflowTaskCompletedEventID, command), nil mutable_state_impl.go
5533 }
5534