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

Execute OpenRewrite from Catalog #160

Open
fabapp2 opened this issue Feb 5, 2024 · 0 comments · May be fixed by #161
Open

Execute OpenRewrite from Catalog #160

fabapp2 opened this issue Feb 5, 2024 · 0 comments · May be fixed by #161

Comments

@fabapp2
Copy link
Collaborator

fabapp2 commented Feb 5, 2024

Spike on a solution that allows users to execute recipes by name.
A new "Recipe Catalog" has mappings from the Recipe name to the recipe's artifact.
The Recipe Catalog also provides information about required and optional Recipe parameters.

Recipe Catalog

recipeCatalog:
  - recipeId: AddLicenseHeader
    artifactGav: org.openrewrite:rewrite-java:8.13.4
    recipeName: org.openrewrite.java.AddLicenseHeader
    description: Adds the provided licenseText as license header to all Java files.
    repositoryUrl: https://github.com/openrewrite/rewrite
    parameters:
      - name: licenseText
        type: String
        required: true

Providing Recipe Parameters

The mapping from command line arguments to Recipe parameters becomes quickly very complex.
For simple recipes with just String parameters like AddLicenseHeader that's not an issue.
But for more complex parameters, I'd change the API to expect parameters to be provided as JSON?

recipe byName <recipe-name> --parameters="{\"stringProperty\"=\"some string\", \"aList\"=[\"of\", \"strings\"]}"
@fabapp2 fabapp2 linked a pull request Feb 5, 2024 that will close this issue
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 a pull request may close this issue.

1 participant