Skip to content

Add doc comments to new struct fields for serialization context#2324

Merged
yuandrew merged 4 commits into
temporalio:mainfrom
yuandrew:update-struct-comments
May 21, 2026
Merged

Add doc comments to new struct fields for serialization context#2324
yuandrew merged 4 commits into
temporalio:mainfrom
yuandrew:update-struct-comments

Conversation

@yuandrew
Copy link
Copy Markdown
Contributor

@yuandrew yuandrew commented May 5, 2026

What was changed

Add comments for each field in the new structs I added in #2225.

Why?

New changes from the PR mentioned above is causing CI in #2232 to fail, it's probably easiest if I just create this PR instead of suggesting changes, as these are all with new structs I added recently


Note

Low Risk
Documentation-only updates to exported option structs; no functional or behavioral changes expected.

Overview
Adds detailed godoc to the activity completion/heartbeat option structs used by CompleteActivity*WithOptions and RecordActivityHeartbeat*WithOptions, documenting required vs optional fields and how each field affects serialization/external-storage context.

Also adds prominent warnings in the public client type aliases that serialization-context values (e.g., ActivityType, WorkflowType, TaskQueue, WorkflowID) are not validated by the SDK and incorrect values may break codecs that depend on them.

Reviewed by Cursor Bugbot for commit a3a86f9. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread internal/client.go Outdated
Comment thread internal/client.go
Comment thread internal/client.go
Err error
// Namespace is the Temporal Namespace containing the Workflow Execution.
// This field is required.
Namespace string
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.

Why do we allow setting the namespace different from the one to which the client is bound?

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.

Good question, had to dig into this

It looks like only for CompleteActivityOptions should the namespace match the client namespace, since that is task-token based, which always uses the client namespace, whereas all of the others can target other namespaces.

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.

whereas all of the others can target other namespaces.

I recall that server deprecated cross-namespace workflow commands (see #2267). I know that this is change is on the client, so it's different. Does enable some hypothetical client that is not attached to a specific namespace to send async completions? If a client is always attached to one namespace, I don't think we should add these namespace fields.

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.

Updated comments to not encourage cross-namespace things

Comment thread internal/client.go Outdated
Comment thread internal/client.go
@yuandrew yuandrew merged commit ad514ad into temporalio:main May 21, 2026
55 of 59 checks passed
@yuandrew yuandrew deleted the update-struct-comments branch May 21, 2026 13:57
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