Skip to main content

Quickstart: Running your first recipe

To help orient you to Moderne, let's walk through how to run a recipe on some open-source projects that we have imported into Moderne.

In this guide, we will:

Step 1: Sign in

If you're an enterprise user, you'll need to navigate to and sign in with the link your company has provided you. Please do that and skip to step 3.

If you're not an enterprise user, go to https://app.moderne.io and sign in:

Moderne Login Button

Step 2: Configure GitHub permissions

The first time you sign in to Moderne through GitHub, you will be presented with an authorization prompt for a few permissions to help enhance your experience.

info

For a better understanding of the permissions requested, please see GitHub Permissions.

GitHub login permissions
GitHub permission request

Step 3: (Optionally) select an organization

After you've logged in and granted the appropriate permissions, you'll arrive at the Moderne home page.

If you went to run a recipe right now, you would find that some repositories are already selected to run against. In public Moderne, the Default organization is selected (a diverse selection of open-source repositories). In an enterprise instance of Moderne, the All organization is selected if you haven't set up an organizations service (meaning all recipes will run against every repository in the tenant). If the organizations service has been set up, it will be whatever that service returns for your user.

If you'd prefer to run against a different group of repositories so that you can get relevant results more quickly, you can: select the organization that matches your needs, set up the Organization service (for enterprise users), or follow our instructions for defining user configured organizations.

Selecting an organization

Step 4: Navigate to the recipe marketplace

Once you've decided what repositories you want to run recipes against, click on Marketplace on the left side of the screen (If you aren't already there):

Moderne Home Page
Moderne home page

This will take you to a page that lists all of the recipe categories. This is the default page you see when you log in.

Step 5: Select a recipe

Let's find a good recipe to start from to help illustrate how to search across multiple repositories.

  1. From the Marketplace, click on Static analysis and remediation and then Core.
  2. Click on the Common static analysis issues recipe.

Step 6: Run the recipe

Click Dry Run to start the recipe. You might be asked for additional GitHub permissions after you click this button.

Dry run selection
Dry run selection

On the results page, you will see a summary of your recipe criteria and an indication of progress.

Example results
Example results

Each result shows the number of files searched and how many changes were detected.

To see the proposed changes, click on either the button under Actions or the name of the repository (e.g. openrewrite/rewrite).

Step 7: View the results

The resulting diff allows you to preview the changes from the recipe before you decide what you want to do.

Recipe diff
Recipe diff

If you're unsure why something changed, you can click on the three dots (...) at the top right of any file and select Why did this change?

For instance, in the above example, the identifiers were reordered due to the modifier order rule.

Step 8: Commit your changes

Once you've confirmed you want to make the changes, the next course of action is to commit everything.

In the results view, select the repositories you want to commit and then click Commit Selected.

Repositories selected to commit changes on
Repositories selected to commit changes on

This will open a prompt that allows you to select different actions such as committing directly, opening a pull request, etc.

Commit change dialogue box
Commit change dialogue box

From this prompt, you can customize either the Branch Name or the Commit Message to match the contributing guidelines of a particular repository.

info

You will need to have specific permissions depending on the commit strategy you decide to go with.

Step 9: 🎉 Profit

You've now run and committed your first recipe. Way to go!!