Skip to content

Conversation

@leth
Copy link

@leth leth commented Nov 4, 2025

This PR

  • Adds a new regex_match jsonlogic string comparison

Notes

I don't code in golang regularly so any feedback appreciated!
Also, completely new to the project, so please let me know if there are any more areas I need to update!

How to test

Use regex_match in a flag targeting rule, similar to how you would starts_with etc

@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for polite-licorice-3db33c canceled.

Name Link
🔨 Latest commit a478bc6
🔍 Latest deploy log https://app.netlify.com/projects/polite-licorice-3db33c/deploys/690a8619edd90d0008d84001

self.RegexCache = &map[string]*regexp.Regexp{}
}
}()
selector := store.NewSelector("")
Copy link
Author

Choose a reason for hiding this comment

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

I couldn't figure out what the correct selector value should be here!

@leth leth changed the title feature: Add custom regex_match string comparison feat: Add custom regex_match string comparison Nov 4, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
13.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@aepfli
Copy link
Member

aepfli commented Nov 5, 2025

Hey thanks for the contribution. As this is adding this logic to flagd itself, a lot of providers also support in-process evaluation. Hence i think we should create an issue, to track all those changes needed for the providers and mostly to have one place for discussions etc. Can you maybe create an issue, or if there is already an issue link it please?

@leth
Copy link
Author

leth commented Nov 5, 2025

Hey thanks for the contribution. As this is adding this logic to flagd itself, a lot of providers also support in-process evaluation. Hence i think we should create an issue, to track all those changes needed for the providers and mostly to have one place for discussions etc. Can you maybe create an issue, or if there is already an issue link it please?

Thanks @aepfli, I had a quick look before but didn't find one; I'll raise one later!

Do providers have the ability to identify when they don't support a particular targeting rule and need to fall-back to the server for evaluation?

@leth
Copy link
Author

leth commented Nov 5, 2025

Can anyone advise on the SQ code duplication problem: Would you prefer the string comparison tests refactored for less duplication, or would it be better to keep it as-is to keep it simple?

If it's the latter, do we need to put that file on the sonar cpd exclusion list?

@aepfli
Copy link
Member

aepfli commented Nov 5, 2025

Hey thanks for the contribution. As this is adding this logic to flagd itself, a lot of providers also support in-process evaluation. Hence i think we should create an issue, to track all those changes needed for the providers and mostly to have one place for discussions etc. Can you maybe create an issue, or if there is already an issue link it please?

Thanks @aepfli, I had a quick look before but didn't find one; I'll raise one later!

Do providers have the ability to identify when they don't support a particular targeting rule and need to fall-back to the server for evaluation?

We do one or the other, and we do not fallback to server communication if we do in-process. Hence i recommended to create a ticket. As this is a bigger change throughout the ecosystem, which we need to discuss and evaluate.

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