Skip to content

Validate merged SAA retry policy updates#10921

Open
fretz12 wants to merge 1 commit into
fredtzeng/saa-preserve-next-retry-on-updatefrom
fredtzeng/saa-validate-merged
Open

Validate merged SAA retry policy updates#10921
fretz12 wants to merge 1 commit into
fredtzeng/saa-preserve-next-retry-on-updatefrom
fredtzeng/saa-validate-merged

Conversation

@fretz12

@fretz12 fretz12 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What changed?

Fixed SAA update-options handling to clone proto option state before merging updates, reject nil top-level retry policy replacements, and validate retry policy subfield updates after merging with existing state. Added shared field-mask helpers.

Why?

A subfield update could previously mutate aliased original options or produce an invalid merged retry policy, such as initial_interval > maximum_interval. A top-level retry_policy update with no policy could also slip through validation as nil, leading to inconsistent retry behavior or nil-deref risk.

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)

Clone SAA option protos before merging updates to avoid mutating original state.

Reject nil top-level retry policy replacements and validate merged retry policy subfield updates across standalone and workflow activity update paths.
Add shared field-mask helpers and regression coverage.
@fretz12 fretz12 marked this pull request as ready for review July 6, 2026 03:44
@fretz12 fretz12 requested review from a team as code owners July 6, 2026 03:44
@fretz12 fretz12 requested review from dandavison and spkane31 July 6, 2026 03:44

@spkane31 spkane31 left a comment

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.

Would be great to have functional tests too.

Comment thread common/util/proto.go
}

func FieldMaskHasSubPath(fieldMaskPaths map[string]struct{}, path string) bool {
prefix := path + "."

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: should only add the . if it's not already there. Could do string.TrimSuffix(path, ".") + "."

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