Complete Pipeline Redesign for GoBatch v0.2.0#9
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a major redesign of GoBatch to support a chained processor design that improves flexibility, error handling, and context cancellation. Key changes include a complete overhaul of processor interfaces (now handling slices of items), the introduction of new built-in processors (Filter, Transform, Error, Nil), and significant updates to source implementations and documentation.
Reviewed Changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| processor/transform.go | Added a Transform processor for applying custom transformations on item data. |
| processor/processor.go | Updated processor package comments to reflect all available processor implementations. |
| processor/nil.go & nil_test.go | Redesigned Nil processor to properly handle sleep duration and context cancellation with tests. |
| processor/filter.go & filter_test.go | Introduced Filter processor with predicate/inversion logic and its accompanying tests. |
| processor/error.go & error_test.go | Updated Error processor to support configurable failure fractions and improved error propagation. |
| Batch package files (pipeline_stage, item, helpers, example, errors, config, README, CHANGELOG) | Removed deprecated PipelineStage and Item mocks, updated configuration, examples, and documentation to support the new design. |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
processor/error.go:51
- [nitpick] The variable name 'failEvery' could be more descriptive; consider renaming it to 'errorInterval' to better convey that it determines the interval at which errors are applied.
failEvery := int(1.0 / failFraction)
MasterOfBinary
added a commit
that referenced
this pull request
May 29, 2026
Fix #8: the Nil processor was described as "passes items through unchanged (for benchmarking)", which is wrong. Per processor/nil.go it sleeps for a configurable Duration (and can mark items cancelled via MarkCancelled). Corrected in CLAUDE.md, AGENTS.md, and README.md to match processor/doc.go. Fix #9: the engine emits wrapped errors as pointers (&SourceError{}, &ProcessorError{} in batch/batch.go), so errors.As must target the pointer type. Made the CLAUDE.md/AGENTS.md guidance explicit with a concrete example; README already used the pointer form. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Complete Redesign for Chained Processor Architecture in GoBatch v0.2.0
This pull request implements a major redesign of the GoBatch architecture to enable a chained processor design. The changes provide a more flexible, robust batch processing experience with improved error handling and better context cancellation support.
Key Improvements
Chained Processor Design:
Processorinterface to use slices of items instead of individual itemsSourceinterface for simpler usage and clearer ownership of channelsPipelineStagein favor of explicit slice and channel-based interfacesNew Processors:
Filterprocessor for filtering items based on custom predicatesTransformprocessor for applying transformations to item dataErrorandNilprocessors for testing and simulationEnhanced Source Implementations:
Channelsource with configurable buffer sizesErrorsource with nil error filteringNilsource for more accurate timing testsError Handling Improvements:
Errorfield in theItemstructComprehensive Documentation:
Technical Changes
These changes significantly improve GoBatch's usability, reliability, and flexibility while maintaining backward compatibility where possible.