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

fix(pii): Ignore replacement_chunks when they aren't used [INGEST-109] #1180

Merged
merged 3 commits into from
Feb 15, 2022

Conversation

iker-barriocanal
Copy link
Contributor

@iker-barriocanal iker-barriocanal commented Feb 11, 2022

With ReplaceBehavior::Value, we only want to replace a string value.
This means we don't need the replacement chunks since
insert_replacement_chunks correctly adds the replacement and the
process_text function is useless because we don't need it (besides,
processing an empty string doesn't perform any action).

Now that the replacement_chunks are only needed in
ReplaceBehavior::Groups, we can move the processing and assertion we do
on them to that branch of the match. This solves the issue of
asserting on them when we don't use them.

Fixes #1095.

With ReplaceBehavior::Value, we only want to replace a string value.
This means we don't need the replacement chunks since
`insert_replacement_chunks` correctly adds the replacement and the
`process_text` function is useless because we don't need it (besides,
processing an empty string doesn't perform any action).

Now that the `replacement_chunks` are only needed in
ReplaceBehavior::Groups, we can move the processing and assertion we do
on them to that branch of the `match`. This solves the issue of
asserting on them when we don't use them.
@iker-barriocanal iker-barriocanal force-pushed the iker/fix/pii-proc-replchunks branch from a52a44d to 729be4d Compare February 14, 2022 08:57
@iker-barriocanal iker-barriocanal self-assigned this Feb 14, 2022
@iker-barriocanal iker-barriocanal marked this pull request as ready for review February 14, 2022 09:19
Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

lgtm assuming the test fails if the fix is not applied. ship it!

@iker-barriocanal iker-barriocanal merged commit 760c683 into master Feb 15, 2022
@iker-barriocanal iker-barriocanal deleted the iker/fix/pii-proc-replchunks branch February 15, 2022 13:29
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.

error processing envelope: could not schedule project fetch caused by: Mailbox has closed
3 participants