Skip to content

Add system search attribute registration option for CHASM library#11080

Open
awln-temporal wants to merge 3 commits into
mainfrom
awln-chasm-sa-system-override
Open

Add system search attribute registration option for CHASM library#11080
awln-temporal wants to merge 3 commits into
mainfrom
awln-chasm-sa-system-override

Conversation

@awln-temporal

Copy link
Copy Markdown
Contributor

What changed?

Support setting CHASM system search attribute overrides. Requires an additional field in CHASM search attribute mapper. On write, loop through any system search attributes and overwrite the visibility request base. An additional switch case must be added per system search attribute to support, since these values overwrite the visibility request base.

Why?

Allows users to reuse existing system columns for their CHASM search attributes.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@awln-temporal
awln-temporal marked this pull request as ready for review July 15, 2026 15:11
@awln-temporal
awln-temporal requested review from a team as code owners July 15, 2026 15:11
Comment thread chasm/registrable_component.go Outdated
Comment thread chasm/visibility.go Outdated
Comment thread chasm/registrable_component.go Outdated
Comment thread chasm/registrable_component.go Outdated
Comment thread chasm/registrable_component.go
Comment thread common/persistence/visibility/visibility_manager_impl.go Outdated
Comment thread common/persistence/visibility/visibility_manager_impl.go Outdated
Comment thread service/history/visibility_queue_task_executor.go Outdated
Comment thread common/persistence/visibility/visibility_manager_impl.go Outdated
Comment thread service/history/visibility_queue_task_executor.go Outdated
@awln-temporal
awln-temporal force-pushed the awln-chasm-sa-system-override branch from c8e4b5b to 29a0445 Compare July 17, 2026 17:15
Comment on lines +255 to +276
case sadefs.WorkflowID:
return exec.WorkflowID, true
case sadefs.RunID:
return exec.RunID, true
case sadefs.WorkflowType:
return exec.TypeName, true
case sadefs.StartTime:
return exec.StartTime, true
case sadefs.ExecutionTime:
return exec.ExecutionTime, true
case sadefs.TaskQueue:
return exec.TaskQueue, true
case sadefs.ParentWorkflowID:
return exec.ParentWorkflowID, true
case sadefs.ParentRunID:
return exec.ParentRunID, true
case sadefs.RootWorkflowID:
return exec.RootWorkflowID, true
case sadefs.RootRunID:
return exec.RootRunID, true
default:
return nil, false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I don't think we want to add the CHASM system search attributes here. I don't think it make sense for archetypes to override those.
Basically, we should add here those system search attributes that are not chasm system search attribute.

@awln-temporal awln-temporal Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, ok

Comment on lines +230 to +239
WorkflowID: {},
RunID: {},
WorkflowType: {},
StartTime: {},
ExecutionTime: {},
TaskQueue: {},
ParentWorkflowID: {},
ParentRunID: {},
RootWorkflowID: {},
RootRunID: {},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

// attribute overrides onto the visibility request base, preserving the system column name.
// The set of supported fields must match sadefs.IsChasmOverridableSystem (enforced at
// registration and by TestChasmSystemOverrideWriteBridgeCoversOverridableFields).
func applyChasmSystemOverrides(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/applyChasmSystemOverrides/applyChasmOverridenSystemFields

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah in general, renamed and moved this option to only apply to non-CHASM system search attributes, good callout.

if chasmTaskQueue != "" {
requestBase.TaskQueue = chasmTaskQueue
}
// Apply registered CHASM system search attribute overrides (e.g. TaskQueue, ExecutionTime).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment: these are not Chasm system search attributes.

@awln-temporal
awln-temporal force-pushed the awln-chasm-sa-system-override branch from 5b09670 to 86b86ec Compare July 17, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants