How the Spryker Code Upgrader works

Edit on GitHub

To update a project, the Spryker Code Upgrader runs the following steps.

1. Identifies the available updates for the Spryker modules

The Upgrader tool performs the following sub-steps:

  1. To identify the modules to be updated, it compares the information present in the composer.json and composer.lock files with our latest released code.

  2. It creates a list of modules and third-party libraries to be updated. Groups the modules according to how we released them.

Module groups

As modules depend on other modules, we tend to release them in groups. When the Spryker Code Upgrader identifies a module to be updated, apart from the identified module, it also adds all the other related modules from its group to the list.

2. Updates the modules and libraries

Using composer, the Upgrader tool updates the modules in groups. After updating the modules, the Upgrader tool returns the list of updated modules and proceeds to the next step.

If the Upgrader tool can’t update a module, it skips the module and the remaining groups. If all the groups failed to update, the Upgrader tool returns the errors causing this and stops. With at least one group updated, it returns the list of updated modules and proceeds to the next step.

By default, the Upgrader tool updates only minor and patch versions. When the Upgrader tool finds a group with a major release, it won’t update it and informs you about that:

There is a major release available for module spryker/merchant-product-approval. 
Please follow the link below to find all documentation needed to help you upgrade to the latest release 
https://api.release.spryker.com/release-group/XXXX

To continue running the Upgrader tool, install the major version manually, and re-run the Upgrader tool.

3. Creates a Git branch

The Upgrader tool creates a separate Git branch to commit the changes to. The branch name follows the pattern: upgradebot/upgrade-for-{base-branch-name}-{last-commit-hash-in-the-base-branch}.

4. Commits the changes

Upgrader tool commits the changes in the composer.json and composer.lock files to the branch.

5. Pushes the changes

The Upgrader tool pushes the changes to your source code provider using the authentication details provided in SprykerCI.

6. Creates a PR

The Upgrader tool creates a PR using your source code provider API. After the PR is created, you can review and merge it to apply the updates.

Next steps

Spryker Code Upgrader in a development workflow