Closed shanman190 closed 9 months ago
I'm guessing we already pick this up when we use flagType = null
due to com.launchdarkly.sdk.server.LDClient *Variation(..)
, but you want to add this as a valid option? That would make this a very quick one I suppose, or did I miss anything?
https://github.com/openrewrite/rewrite-launchdarkly/blob/d3136c86edbab65c967583a7264e55d072e0764e/src/main/java/org/openrewrite/launchdarkly/search/FindFeatureFlag.java#L43-L49
Absolutely correct! Just allowing the user to select the new variation type is all that is necessary here. When not selected, it just kinda works already like you mentioned. This is really just enabling the user to scope down, if they have that desire.
A question that comes to mind as another alternative here would be to go ahead with a breaking change to switch away from the option "prefix" style to just simply accepting the method pattern itself. That would mean that we would ultimately have less upkeep long term.
From a user perspective I think it would be easier to select from an enum dropdown than provide a methodPattern when you want to limit the results; we ought to be able to keep up with their SDK right? I imagine they're not churning out new feature flags often.
I agree with you there that there have not been new flag types added very quickly or often. As well as that using the option that accepts the prefix is definitely easier on the end user of the recipe as well.
What problem are you trying to solve?
Add support for the
migrationVariation
to theFindFeatureFlag
search recipe. https://launchdarkly.github.io/java-server-sdk/com/launchdarkly/sdk/server/LDClient.html#migrationVariation(java.lang.String,com.launchdarkly.sdk.LDContext,com.launchdarkly.sdk.server.MigrationStage)Describe the solution you'd like
Search recipe appropriately discovered the new variation type.
Additional context
This is a new variation method as of 7.x. more information on it can be found here: https://docs.launchdarkly.com/guides/flags/migrations
Are you interested in contributing this feature to OpenRewrite?
Always. :)