Skip to content

feat(transform): Add Multi-Transform Support to Meta Transforms#213

Merged
jshlbrd merged 4 commits intomainfrom
jshlbrd/feat/meta-transforms
Jul 24, 2024
Merged

feat(transform): Add Multi-Transform Support to Meta Transforms#213
jshlbrd merged 4 commits intomainfrom
jshlbrd/feat/meta-transforms

Conversation

@jshlbrd
Copy link
Contributor

@jshlbrd jshlbrd commented Jul 23, 2024

Description

  • Adds Transforms field to all meta transform functions
  • Deprecates Transform field in all meta transform functions
  • Deprecates the MetaPipeline transform function

Motivation and Context

This simplifies the project's use of transform functions by making it so that every meta transform function accepts a list of transform functions (instead of only a single transform function). In v2.0 the existing transform support and the MetaPipeline transform will be removed.

For the existing transforms both transform and transforms fields have to be supported simultaneously to not introduce a breaking change, like this:

if len(tf.tfs) > 0 {
	msgs, err = Apply(ctx, tf.tfs, msg)
} else {
	msgs, err = tf.tf.Transform(ctx, msg)
}

Any new meta transform functions should only have a transforms field.

How Has This Been Tested?

  • Added unit tests.
  • Tested each updated example.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jshlbrd jshlbrd marked this pull request as ready for review July 23, 2024 15:07
@jshlbrd jshlbrd requested a review from a team as a code owner July 23, 2024 15:07
Copy link
Contributor

@shellcromancer shellcromancer left a comment

Choose a reason for hiding this comment

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

Code changes look good, on

@jshlbrd jshlbrd requested a review from shellcromancer July 24, 2024 15:09
@jshlbrd jshlbrd merged commit af44e66 into main Jul 24, 2024
@jshlbrd jshlbrd deleted the jshlbrd/feat/meta-transforms branch July 24, 2024 15:25
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