skipping deployments for wf metadata that doesnt pass validation#21201
skipping deployments for wf metadata that doesnt pass validation#21201patrickhuie19 wants to merge 2 commits intodevelopfrom
Conversation
|
👋 patrickhuie19, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
I see you updated files related to
|
|
| if len(owner) == 0 { | ||
| return true | ||
| } | ||
| for _, b := range owner { | ||
| if b != 0 { | ||
| return false | ||
| } | ||
| } | ||
| return true |
There was a problem hiding this comment.
I think you could omit the base case here since it happens naturally when the for loop is skipped:
| if len(owner) == 0 { | |
| return true | |
| } | |
| for _, b := range owner { | |
| if b != 0 { | |
| return false | |
| } | |
| } | |
| return true | |
| for _, b := range owner { | |
| if b != 0 { | |
| return false | |
| } | |
| } | |
| return true |
Alternatively:
| if len(owner) == 0 { | |
| return true | |
| } | |
| for _, b := range owner { | |
| if b != 0 { | |
| return false | |
| } | |
| } | |
| return true | |
| // does not contain non-zero bytes | |
| return !slices.ContainsFunc(owner, func(b byte) bool { return b != 0 }) |
| invalid := isEmptyWorkflowID(wfMeta.WorkflowId) || | ||
| isZeroOwner(wfMeta.Owner.Bytes()) | ||
| return !invalid |
There was a problem hiding this comment.
WDYT about avoiding the double negative?
| invalid := isEmptyWorkflowID(wfMeta.WorkflowId) || | |
| isZeroOwner(wfMeta.Owner.Bytes()) | |
| return !invalid | |
| return !isEmptyWorkflowID(wfMeta.WorkflowId) && !isZeroOwner(wfMeta.Owner.Bytes()) |




If you check workflow worker staging metrics, we're seeing a high volume of events with org ID missing in the staging env. A little log splunking shows its all from cases where the metadata is exhibiting a zero workflow owner address, a known bug that was fixed (and redeployed) for our prod wf registry contract.