Skip to main content

New CLI command to upgrade Meroxa dependencies in a Turbine Application

· 2 min read

Our latest Meroxa CLI version v2.7.1 includes a new command apps upgrade that will assist Turbine developers in upgrading Meroxa dependencies in their streaming applications developed with Turbine.

This command wraps around the package management tool associated with the language of the Turbine Application and takes the extra step of running the workflow to see if the upgrade was successful. If apps run doesn't pass before running apps upgrade, the upgrade command will report a failure.

A successful example:

# Get the latest Meroxa dependencies
$ meroxa apps upgrade
✔ Determined the details of the "my-app" Application
✔ Downloaded latest turbine-go and turbine-go/running dependencies successfully!
✔ Finished tidying up Golang modules successfully!
✔ Tested upgrades locally successfully!
Your Turbine Application aug16 has been upgraded successfully! To finish, add and commit the upgrades.

If there is a breaking change between your version of the Turbine Application and the latest, the output should indicate where the incompatibility is. You have the choice of updating the code or recreating your Turbine Application from a newly initialized Application.

An example of an upgrade there requires manual intervention:

$ meroxa apps upgrade
✔ Determined the details of the "my-app" Application
✔ Downloaded latest turbine-go and turbine-go/running dependencies successfully!
✔ Finished tidying up Golang modules successfully!
✔ Checked your application name is "my-app"
x # github.com/my-org/my-app
./app.go:49:12: assignment mismatch: 2 variables but v.Process returns 1 value
./app.go:49:26: cannot use Anonymize{} (value of type Anonymize) as type turbine.Function in argument to v.Process:
Anonymize does not implement turbine.Function (wrong type for Process method)
have Process(stream []turbine.Record) ([]turbine.Record, []turbine.RecordWithError)
want Process(r []turbine.Record) []turbine.Record
x Upgrades were not entirely successful. Fix any issues before adding and committing all upgrades.
Error: build failed

In this case, removing []turbine.RecordWithError from the output of the Process() function will update it to conform to the latest interface definition.

Language Flag on the Run Command

An additional change in this release was the removal of the --lang flag in the apps run command. This flag was redundant, as the source of truth for the language of a Turbine Application had already been established in app.json.

To get started with the CLI, check out the Installation Guide.

For any questions or comments: