How Spryker Code Upgrader works

Edit on GitHub

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

1. Identify the available updates for the Spryker modules

  1. To identify the modules to be updated, the Upgrader compares the information present in the composer.json and composer.lock files with Spryker’s latest released code.
  2. It creates a list of modules and third-party libraries to be updated and groups the modules according to how they are released.
Module groups

Because modules depend on other modules, we tend to release them in groups. When the 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. Update the modules and libraries

Using composer, the Upgrader updates the modules in groups.

Firstly, it applies the security releases: the releases with security updates. For these releases, only minor and patch versions are applied. The major releases are applied after the module is updated to the major version.

After updating the modules, the Upgrader returns the list of updated modules and proceeds to the next step.

If the Upgrader can’t update a module, it skips the module and the remaining groups. If all the groups fail to update, the Upgrader 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 updates only minor and patch versions. When the Upgrader finds a group with a major release, it doesn’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
Major security releases

Major security releases are skipped silently.

To continue running the Upgrader, install the major version manually, and rerun the Upgrader.

Composer dependency conflict

The Upgrader uses Composer for updating modules and libraries. If Composer detects a conflict, it stops the update process and generates an error message. To resolve the conflict, you need to manually update the conflicting module and rerun the Upgrader pipeline.

3. Create a Git branch

The Upgrader 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. Commit the changes

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

5. Push the changes

The Upgrader pushes the changes to your source code provider.

6. Create a PR

The Upgrader 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 step

Developing with Spryker Code Upgrader