Skip to content

Conversation

@spkane31
Copy link
Contributor

@spkane31 spkane31 commented Jul 22, 2025

What changed?

Remove BatchParams to safely serialize proto -> json -> proto and add a BatchOperation proto definition

Why?

Remove custom serialization of proto for json safety.

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)

Potential risks

Could break batching backwards compatibility but tests should catch this

Copy link
Contributor

@dnr dnr left a comment

Choose a reason for hiding this comment

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

just a couple high-level comments

return &workflowservice.StartBatchOperationResponse{}, nil
}

func snakeCaseBatchType(batchType enumspb.BatchOperationType) string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To maintain consistency with how we do these now a few of the batch operation types needed special casing

@spkane31 spkane31 requested a review from bergundy August 4, 2025 16:41
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Please look at the remaining comments before merging.

@spkane31 spkane31 merged commit 356eeca into main Aug 4, 2025
58 checks passed
@spkane31 spkane31 deleted the spk/proto-serialization branch August 4, 2025 20:26
Query: fmt.Sprintf("%s = '%s' and %s = '%s'",
searchattribute.WorkflowType,
batcher.BatchWFTypeName,
batcher.BatchWFTypeProtobufName,
Copy link
Contributor

Choose a reason for hiding this comment

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

This may cause some confusion around the deployment transition. Is it worth listing both types temporarily?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I missed this in the review, in person I requested to keep both. Addressed in #8144. We should merge that change before cutting a new server release. I would consider reverting this one until this fix is in.

// nolint:revive,cognitive-complexity
func (a *activities) BatchActivityWithProtobuf(ctx context.Context, batchParams *batchspb.BatchOperationInput) (HeartBeatDetails, error) {
logger := a.getActivityLogger(ctx)
hbd := HeartBeatDetails{}
Copy link
Contributor

Choose a reason for hiding this comment

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

is it worth considering moving heartbeat details to proto too? if we don't do it now we never can :)

rateLimiter := rate.NewLimiter(rateLimit, burstLimit)
taskCh := make(chan taskDetail, pageSize)
respCh := make(chan error, pageSize)
for i := 0; i < a.getOperationConcurrency(int(batchParams.Concurrency)); i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for i := 0; i < a.getOperationConcurrency(int(batchParams.Concurrency)); i++ {
for range a.getOperationConcurrency(int(batchParams.Concurrency)) {

Comment on lines 423 to 426
WorkflowExecution: &commonpb.WorkflowExecution{
WorkflowId: workflowID,
RunId: runID,
WorkflowId: execution.WorkflowId,
RunId: execution.RunId,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
WorkflowExecution: &commonpb.WorkflowExecution{
WorkflowId: workflowID,
RunId: runID,
WorkflowId: execution.WorkflowId,
RunId: execution.RunId,
},
WorkflowExecution: execution,

Comment on lines 437 to 440
WorkflowExecution: &commonpb.WorkflowExecution{
WorkflowId: workflowID,
RunId: runID,
WorkflowId: execution.WorkflowId,
RunId: execution.RunId,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
WorkflowExecution: &commonpb.WorkflowExecution{
WorkflowId: workflowID,
RunId: runID,
WorkflowId: execution.WorkflowId,
RunId: execution.RunId,
},
WorkflowExecution: execution,

and same thing repeated several more times

Comment on lines +653 to +656
WorkflowExecution: &commonpb.WorkflowExecution{
WorkflowId: execution.WorkflowId,
RunId: execution.RunId,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
WorkflowExecution: &commonpb.WorkflowExecution{
WorkflowId: execution.WorkflowId,
RunId: execution.RunId,
},
WorkflowExecution: execution,

and more below

bergundy added a commit that referenced this pull request Aug 7, 2025
## What changed?

Change the backing query to avoid filtering on a specific workflow type
since we now have two types for the transition period.

## Why?

Fix for a bug introduced in #8081
rodrigozhou added a commit that referenced this pull request Aug 11, 2025
spkane31 added a commit that referenced this pull request Aug 12, 2025
This reverts the batch operation changes from PR 8081 (#8081) but only
for files in the service/frontend directory, restoring the original
BatchParams-based implementation.
spkane31 added a commit that referenced this pull request Aug 12, 2025
This reverts the batch operation changes from PR 8081 (#8081) but only
for files in the service/frontend directory, restoring the original
BatchParams-based implementation.
rodrigozhou pushed a commit that referenced this pull request Aug 12, 2025
This reverts the batch operation changes from PR 8081 (#8081) but only
for files in the service/frontend directory, restoring the original
BatchParams-based implementation.

## What changed?
Revert #8081 frontend changes.

## Why?
This change is not backwards compatible, in the future we can turn on
the protobuf workflow

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
Minimal, we're reverting the breaking change w/ this PR

---------

Co-authored-by: Roey Berman <[email protected]>
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.

4 participants