Skip to content

Commit

Permalink
Add launchdarkly
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-solomon committed Nov 20, 2023
1 parent e210796 commit 87e70cc
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,9 @@
* [Find OWASP suppressions.xml](reference/recipes/xml/security/isowaspsuppressionsfile.md)
* [Remove out-of-date OWASP suppressions](reference/recipes/xml/security/removeowaspsuppressions.md)
* [Update OWASP suppression date bounds](reference/recipes/xml/security/updateowaspsuppressiondate.md)
* [LaunchDarkly](reference/recipes/launchdarkly/README.md)
* [Migrate LaunchDarkly dependencies to 6.x](reference/recipes/launchdarkly/upgradelaunchdarkly6dependencies.md)
* [Migrate to LaunchDarkly 6.x](reference/recipes/launchdarkly/upgradelaunchdarkly6.md)
* [Micrometer](reference/recipes/micrometer/README.md)
* [Convert Micrometer Timer to Observations](reference/recipes/micrometer/timertoobservation.md)
* [Upgrade Micrometer](reference/recipes/micrometer/upgrademicrometer.md)
Expand Down
10 changes: 10 additions & 0 deletions reference/recipes/launchdarkly/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LaunchDarkly

_Recipes to perform [LaunchDarkly](https://launchdarkly.com/) migration tasks._

## Recipes

* [Migrate LaunchDarkly dependencies to 6.x](./upgradelaunchdarkly6dependencies.md)
* [Migrate to LaunchDarkly 6.x](./upgradelaunchdarkly6.md)


156 changes: 156 additions & 0 deletions reference/recipes/launchdarkly/upgradelaunchdarkly6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Migrate to LaunchDarkly 6.x

**org.openrewrite.launchdarkly.UpgradeLaunchDarkly6**

_This recipe will apply changes commonly needed when migrating to LaunchDarkly 6.x._

## Recipe source

[GitHub](https://github.com/openrewrite/rewrite-launchdarkly/blob/main/src/main/resources/META-INF/rewrite/launchdarkly-6.yml), [Issue Tracker](https://github.com/openrewrite/rewrite-launchdarkly/issues), [Maven Central](https://central.sonatype.com/artifact/org.openrewrite.recipe/rewrite-launchdarkly/0.0.1/jar)

* groupId: org.openrewrite.recipe
* artifactId: rewrite-launchdarkly
* version: 0.0.1


## Usage

This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite.recipe:rewrite-launchdarkly:0.0.1` in your build file or by running a shell command (in which case no build changes are needed):
{% tabs %}
{% tab title="Gradle" %}
1. Add the following to your `build.gradle` file:
{% code title="build.gradle" %}
```groovy
plugins {
id("org.openrewrite.rewrite") version("6.5.4")
}
rewrite {
activeRecipe("org.openrewrite.launchdarkly.UpgradeLaunchDarkly6")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-launchdarkly:0.0.1")
}
```
{% endcode %}
2. Run `gradle rewriteRun` to run the recipe.
{% endtab %}

{% tab title="Gradle init script" %}
1. Create a file named `init.gradle` in the root of your project.
{% code title="init.gradle" %}
```groovy
initscript {
repositories {
maven { url "https://plugins.gradle.org/m2" }
}
dependencies { classpath("org.openrewrite:plugin:6.5.4") }
}
rootProject {
plugins.apply(org.openrewrite.gradle.RewritePlugin)
dependencies {
rewrite("org.openrewrite.recipe:rewrite-launchdarkly:0.0.1")
}
rewrite {
activeRecipe("org.openrewrite.launchdarkly.UpgradeLaunchDarkly6")
}
afterEvaluate {
if (repositories.isEmpty()) {
repositories {
mavenCentral()
}
}
}
}
```
{% endcode %}
2. Run `gradle --init-script init.gradle rewriteRun` to run the recipe.
{% endtab %}
{% tab title="Maven POM" %}
1. Add the following to your `pom.xml` file:
{% code title="pom.xml" %}
```xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.13.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.launchdarkly.UpgradeLaunchDarkly6</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-launchdarkly</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
```
{% endcode %}
2. Run `mvn rewrite:run` to run the recipe.
{% endtab %}

{% tab title="Maven Command Line" %}
{% code title="shell" %}
You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command.

```shell
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-launchdarkly:RELEASE \
-Drewrite.activeRecipes=org.openrewrite.launchdarkly.UpgradeLaunchDarkly6
```
{% endcode %}
{% endtab %}
{% tab title="Moderne CLI" %}
You will need to have configured the [Moderne CLI](https://docs.moderne.io/moderne-cli/cli-intro) on your machine before you can run the following command.

{% code title="shell" %}
```shell
mod run . --recipe UpgradeLaunchDarkly6
```
{% endcode %}
{% endtab %}
{% endtabs %}

## Definition

{% tabs %}
{% tab title="Recipe List" %}
* [Migrate LaunchDarkly dependencies to 6.x](../launchdarkly/upgradelaunchdarkly6dependencies.md)

{% endtab %}

{% tab title="Yaml Recipe List" %}
```yaml
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.launchdarkly.UpgradeLaunchDarkly6
displayName: Migrate to LaunchDarkly 6.x
description: This recipe will apply changes commonly needed when migrating to LaunchDarkly 6.x.
recipeList:
- org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies

```
{% endtab %}
{% endtabs %}

## See how this recipe works across multiple open-source repositories

[![Moderne Link Image](/.gitbook/assets/ModerneRecipeButton.png)](https://app.moderne.io/recipes/org.openrewrite.launchdarkly.UpgradeLaunchDarkly6)

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS.
162 changes: 162 additions & 0 deletions reference/recipes/launchdarkly/upgradelaunchdarkly6dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Migrate LaunchDarkly dependencies to 6.x

**org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies**

_Migrate LaunchDarkly dependencies to 6.x._

## Recipe source

[GitHub](https://github.com/openrewrite/rewrite-launchdarkly/blob/main/src/main/resources/META-INF/rewrite/launchdarkly-6.yml), [Issue Tracker](https://github.com/openrewrite/rewrite-launchdarkly/issues), [Maven Central](https://central.sonatype.com/artifact/org.openrewrite.recipe/rewrite-launchdarkly/0.0.1/jar)

* groupId: org.openrewrite.recipe
* artifactId: rewrite-launchdarkly
* version: 0.0.1


## Usage

This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite.recipe:rewrite-launchdarkly:0.0.1` in your build file or by running a shell command (in which case no build changes are needed):
{% tabs %}
{% tab title="Gradle" %}
1. Add the following to your `build.gradle` file:
{% code title="build.gradle" %}
```groovy
plugins {
id("org.openrewrite.rewrite") version("6.5.4")
}
rewrite {
activeRecipe("org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-launchdarkly:0.0.1")
}
```
{% endcode %}
2. Run `gradle rewriteRun` to run the recipe.
{% endtab %}

{% tab title="Gradle init script" %}
1. Create a file named `init.gradle` in the root of your project.
{% code title="init.gradle" %}
```groovy
initscript {
repositories {
maven { url "https://plugins.gradle.org/m2" }
}
dependencies { classpath("org.openrewrite:plugin:6.5.4") }
}
rootProject {
plugins.apply(org.openrewrite.gradle.RewritePlugin)
dependencies {
rewrite("org.openrewrite.recipe:rewrite-launchdarkly:0.0.1")
}
rewrite {
activeRecipe("org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies")
}
afterEvaluate {
if (repositories.isEmpty()) {
repositories {
mavenCentral()
}
}
}
}
```
{% endcode %}
2. Run `gradle --init-script init.gradle rewriteRun` to run the recipe.
{% endtab %}
{% tab title="Maven POM" %}
1. Add the following to your `pom.xml` file:
{% code title="pom.xml" %}
```xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.13.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-launchdarkly</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
```
{% endcode %}
2. Run `mvn rewrite:run` to run the recipe.
{% endtab %}

{% tab title="Maven Command Line" %}
{% code title="shell" %}
You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command.

```shell
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-launchdarkly:RELEASE \
-Drewrite.activeRecipes=org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies
```
{% endcode %}
{% endtab %}
{% tab title="Moderne CLI" %}
You will need to have configured the [Moderne CLI](https://docs.moderne.io/moderne-cli/cli-intro) on your machine before you can run the following command.

{% code title="shell" %}
```shell
mod run . --recipe UpgradeLaunchDarkly6Dependencies
```
{% endcode %}
{% endtab %}
{% endtabs %}

## Definition

{% tabs %}
{% tab title="Recipe List" %}
* [Change Gradle or Maven dependency](../java/dependencies/changedependency.md)
* oldGroupId: `com.launchdarkly`
* oldArtifactId: `launchdarkly-java-server-sdk`
* newVersion: `6.x`

{% endtab %}

{% tab title="Yaml Recipe List" %}
```yaml
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies
displayName: Migrate LaunchDarkly dependencies to 6.x
description: Migrate LaunchDarkly dependencies to 6.x.
recipeList:
- org.openrewrite.java.dependencies.ChangeDependency:
oldGroupId: com.launchdarkly
oldArtifactId: launchdarkly-java-server-sdk
newVersion: 6.x

```
{% endtab %}
{% endtabs %}

## See how this recipe works across multiple open-source repositories

[![Moderne Link Image](/.gitbook/assets/ModerneRecipeButton.png)](https://app.moderne.io/recipes/org.openrewrite.launchdarkly.UpgradeLaunchDarkly6Dependencies)

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS.

0 comments on commit 87e70cc

Please sign in to comment.