version_workflow.go ×6

Frontier kind: Code frontier

unlabeled · c_e94fc948e112

20 tests · 2957 LOC · 136 files · introduces 0 tests · 49 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges49 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
478 ranges2957 lines · 136 files · Browse complete extent
All tests (intent)
20 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: 49 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/api/deployment/v1/message.pb.go 26 introduced LOC · 4 ranges

Open complete file

2163 }
2164
2165 > func (x *UpdateVersionMetadataArgs) Reset() { message.pb.go
2166 > *x = UpdateVersionMetadataArgs{}
2167 > mi := &file_temporal_server_api_deployment_v1_message_proto_msgTypes[30]
2168 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
2169 > ms.StoreMessageInfo(mi)
2170 > }
2171
2172 func (x *UpdateVersionMetadataArgs) String() string {
2176 func (*UpdateVersionMetadataArgs) ProtoMessage() {}
2177
2178 > func (x *UpdateVersionMetadataArgs) ProtoReflect() protoreflect.Message { message.pb.go
2179 > mi := &file_temporal_server_api_deployment_v1_message_proto_msgTypes[30]
2180 > if x != nil {
2181 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
2182 > if ms.LoadMessageInfo() == nil {
2183 > ms.StoreMessageInfo(mi)
2184 > }
2185 > return ms
2186 }
2187 return mi.MessageOf(x)
2207 }
2208
2209 > func (x *UpdateVersionMetadataArgs) GetIdentity() string { message.pb.go
2210 > if x != nil {
2211 > return x.Identity
2212 > }
2213 return ""
2214 }
2235 func (*UpdateVersionMetadataResponse) ProtoMessage() {}
2236
2237 > func (x *UpdateVersionMetadataResponse) ProtoReflect() protoreflect.Message { message.pb.go
2238 > mi := &file_temporal_server_api_deployment_v1_message_proto_msgTypes[31]
2239 > if x != nil {
2240 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
2241 > if ms.LoadMessageInfo() == nil {
2242 > ms.StoreMessageInfo(mi)
2243 > }
2244 > return ms
2245 }
2246 return mi.MessageOf(x)
go.temporal.io/server/service/worker/workerdeployment/version_workflow.go 23 introduced LOC · 6 ranges

Open complete file

393 }
394
395 > func (d *VersionWorkflowRunner) handleUpdateVersionMetadata(ctx workflow.Context, args *deploymentspb.UpdateVersionMetadataArgs) (*deploymentspb.UpdateVersionMetadataResponse, error) { version_workflow.go
396 > if err := d.preUpdateChecks(ctx); err != nil {
397 return nil, err
398 }
399
400 > if args.UpsertEntries != nil { version_workflow.go
401 > if d.VersionState.Metadata == nil {
402 > d.VersionState.Metadata = &deploymentpb.VersionMetadata{}
403 > }
404 > if d.VersionState.Metadata.Entries == nil {
405 > d.VersionState.Metadata.Entries = make(map[string]*commonpb.Payload)
406 > }
407 }
408
409 > for _, key := range workflow.DeterministicKeys(args.UpsertEntries) { version_workflow.go
410 > if key == metadataKeyController && d.VersionState.Metadata.Entries[key] == nil {
411 // adding the controller identifier key-value for the first time, counting as a controller-managed version
412 // TODO: also check and potentially emit the controller id
414 }
415
416 > payload := args.UpsertEntries[key] version_workflow.go
417 > d.VersionState.Metadata.Entries[key] = payload
418 }
419
420 > for _, key := range args.RemoveEntries { version_workflow.go
421 delete(d.VersionState.Metadata.GetEntries(), key) // if m is nil, delete is a no-op
422 }
423
424 > d.VersionState.LastModifierIdentity = args.GetIdentity() version_workflow.go
425 >
426 > // although the handler might have not changed the metadata at all, still
427 > // it's better to CaN because some history events are built now.
428 > d.setStateChanged()
429 >
430 > return &deploymentspb.UpdateVersionMetadataResponse{
431 > Metadata: d.VersionState.Metadata,
432 > }, nil
433 }
434