Skip to content

Conversation

sdangol
Copy link
Contributor

@sdangol sdangol commented Sep 16, 2025

Summary

This PR fixes the build issue with the Batch Processor due to missing dependencies with Standard Schema.

Changes

Please provide a summary of what's being changed

  • Added @standard-schema/spec as a dependency of the Batch processor package
  • Removed the optional on DynamoDB extended schemas to enforce the same schema to be used for both OldImage and NewImage and added a note in the docs about it
  • Removed ZodType imports and replaced type representing Zod schema

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #4496

Screenshot

Screenshot 2025-09-16 at 4 00 40 pm

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added batch This item relates to the Batch Processing Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation tests PRs that add or change tests labels Sep 16, 2025
@pull-request-size pull-request-size bot added the size/XL PRs between 500-999 LOC, often PRs that grown with feedback label Sep 16, 2025
@sdangol sdangol self-assigned this Sep 16, 2025
@sdangol sdangol requested a review from dreamorosi September 16, 2025 16:27
@sdangol sdangol requested a review from svozza September 16, 2025 18:31
@sdangol
Copy link
Contributor Author

sdangol commented Sep 16, 2025

@dreamorosi This is ready for review now

@dreamorosi dreamorosi requested a review from Copilot September 16, 2025 22:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a build issue with the Batch processor by adding missing dependencies for Standard Schema validation support and refactoring DynamoDB stream schema validation to use consistent schemas for both OldImage and NewImage fields.

  • Added @standard-schema/spec as a runtime dependency to properly support Standard Schema validation
  • Refactored test suite to use parameterized tests instead of deeply nested describe blocks for better maintainability
  • Updated DynamoDB extended schemas to enforce the same schema for both OldImage and NewImage fields instead of making them optional

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/batch/package.json Added @standard-schema/spec dependency and reorganized dev dependencies
packages/batch/src/types.ts Renamed type and updated to use StandardSchemaV1 instead of ZodType imports
packages/batch/src/parser.ts Updated schema extension logic and made DynamoDB OldImage/NewImage validation consistent
packages/batch/src/BatchProcessor.ts Added documentation example for inner schema validation
packages/batch/src/BasePartialBatchProcessor.ts Updated type references to use new BatchProcessorConfig
packages/batch/tests/unit/parsing.test.ts Completely refactored tests to use parameterized approach and added new test cases
packages/batch/tests/helpers/factories.ts Updated DynamoDB record factory to include OldImage field
docs/features/batch.md Added documentation note about DynamoDB schema behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Andrea Amorosi <dreamorosi@gmail.com>
Copy link

@dreamorosi dreamorosi merged commit ef67b43 into main Sep 17, 2025
37 checks passed
@dreamorosi dreamorosi deleted the fix/batch_deps branch September 17, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
batch This item relates to the Batch Processing Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation size/XL PRs between 500-999 LOC, often PRs that grown with feedback tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: Declare @standard-schema/spec as a dependency
3 participants