Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.26] Backport Extractor Regex Replace Functionality #315

Merged

Conversation

ben-taussig-solo
Copy link
Contributor

Description

Changes unique to this backport

  • Updated changelog location
  • Updated line 58 of inja_transformer.cc, as eitanya/bump-release-1.27 #263 created a Solo definition of Regex::Utility::parseStdRegex in 1.27 and 1.28, which does not exist in 1.26 and earlier
    - extract_regex_(Solo::Regex::Utility::parseStdRegex(extractor.regex())),
    + extract_regex_(Regex::Utility::parseStdRegex(extractor.regex())),

ben-taussig-solo and others added 2 commits March 11, 2024 13:50
…Revised] (#309)

* Add regex replace functionality to transformation filter extractors (#301)

* initial extractor implementation of replace functionality

* minor changes, testing against mergeExtractorsToBody and extraction callback

* add changelog entry

* update API to use new mode selector

update transformation_filter proto

* minor updates to comments in transformation_filter.proto

* remove existing references to no-longer-existing replace_all setting

* update replacement_text_ to a std::optional<std::string>

* remove duplicate mode enum

* update comment indicating that subgroup should never exceed regex_result size

* add AttemptReplaceFromNoMatchNonNilSubgroup test

* prevent string reallocation

* remove unnecessary if block + variable in replaceAllValues

* clean up new tests

* inline replacement_text in inja_transformer_test.cc

* more test cleanup

* update function signatures, remove replaced_value_

* support dynamic metadata as extractor input

* update changelog location

* add API changes to go with 3175ca9

* revert support for dynamic metadata as an extractor input 3175ca9 and e2668be

* refactor calls to extract/replace

* rename replace to extractDestructive, add breaks to switch statement

* update data types to match updated function signatures in inja_transformer_test.cc

* respond to review comments

* update changelog location

* update changelog location

* separate destructive extractors and non-destructive extractors

* fix match_not_null edge case

* update inline documentation for new proto field

* add test demonstrating use of format specifiers

* update REPLACE_ALL mode to return input on no match

* return input on no match in single replace case
@solo-changelog-bot
Copy link

Issues linked to changelog:
solo-io/gloo#8706

@soloio-bulldozer soloio-bulldozer bot merged commit 52b93ad into release-v1.26 Mar 13, 2024
3 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the extractor_regex_replace_one_twenty_six branch March 13, 2024 14:16
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