Skip to main content
Version: 8.3.x

Consuming Support Fixes

The following guide describes how you can consume official support fixes for your current version of Self-Managed Commerce.

We recommend making regular patch consumption a part of your Self-Managed Commerce development process. Schedule a story to be created every 2-4 sprints to consume all latest patches for your version. It is important to stay up-to-date with patches for several reasons:

  • It reduces the likelihood of an outage or other issue that is already addressed by recent patches.
  • You can more quickly consume new, urgent patches. There can be dependencies between patches so cherry-picking is not always possible if earlier patches are not consumed.

To view the latest fixes for your version of Self-Managed Commerce, view the Changelog section of the Release Notes.

note

The following instructions assume that your Git repository was created by cloning from the Self-Managed Commerce code repository. If your repository was created from a downloaded zip copy of the source, or if you are not sure if your team repository was cloned from the Elastic Path repository, see the Troubleshooting section.

Consuming all Fixes​

You can consume all the latest fixes from your current Self-Managed Commerce version into your development branch.

  1. Open a terminal window and change the current directory to your existing ep-commerce source code folder. Make sure you are in your main branch, and have retrieved the latest source code.

  2. Install the Self-Managed Commerce Upgrader tool using the installation instructions.

  3. Follow the setup instructions for the Self-Managed Commerce Upgrader tool.

  4. Create a branch by running the following (replace [FIX_BRANCH] with a unique branch name):

    git checkout -b [FIX_BRANCH]
  5. Run the upgrade process in the Self-Managed Commerce Upgrader tool by running the following (replace the version number with your current Self-Managed Commerce version):

    smc-upgrader 8.5.x
  6. Most conflicts should be resolved, but there may still be a few if changes were made to platform source code. Address all conflicts and then confirm that the source compiles by running:

    mvn clean install -DskipAllTests -Djacoco.skip=true
  7. Address any compilation issues until you are able to successfully compile. Complete the merge by running:

    git merge --continue
  8. Commit your changes and push your branch to your Git repository so other team members can access it.

Cherry-Picking a Single Fix​

You can select a specific fix with the COMMIT_SHA number to consume in your development branch.

  1. In the base folder of your customized ep-commerce source code, switch to master and pull the latest code.

    git checkout master
    git pull origin master
  2. Create a feature branch.

    git checkout -b [FIX_BRANCH]
    note

    Ensure that you replace [FIX_BRANCH] with a name that makes sense for the fix you are consuming.

  3. Check to see if you have a Git remote named upstream pointing to the Elastic Path release repository. If you do not have this remote, run the following command:

    git remote add upstream git@code.elasticpath.com:ep-commerce/ep-commerce.git
  4. Fetch the latest release repository. Cherry-pick the fix into your feature branch.

    git fetch upstream
    git cherry-pick [COMMIT_SHA]
    note

    Ensure that you replace [COMMIT_SHA] with the commit SHA of the fix that you want to consume.

  5. Address any merge conflicts, run all regression tests, and then push the changes back to your repository.

    git push origin [FIX_BRANCH]
  6. Use your source code control interface, such as GitHub, to create a pull request from the fix branch to master.

  7. Merge the pull request.

  8. Build and deploy the updated source code to your environments.

Applying a Single Fix as a Patch​

You can apply specific fix as a patch into your development branch.

  1. Download the patch from code.elasticpath.com by browsing to the commit and adding .diff into the end of the URL.

  2. In the base folder of your customized ep-commerce source code, switch to master and pull the latest code.

    git checkout master
    git pull origin master
  3. Create a feature branch.

    git checkout -b [FIX_BRANCH]
    note

    Ensure that you replace [FIX_BRANCH] with a name that makes sense for the fix you are consuming.

  4. Apply the patch.

    patch -p1 < [PATCH_PATH]
    note

    Ensure that you replace [PATCH_PATH] with the local path of your downloaded patch.

  5. Address any merge conflicts, run all regression tests, and then push the changes back to your repository.

    git push origin [FIX_BRANCH]
  6. Use your source code control interface, such as GitHub, to create a pull request from the fix branch to master.

  7. Merge the pull request.

  8. Build and deploy the updated source code to your environments.

Troubleshooting​

If you are unsure if your team repository was cloned from code.elasticpath.com, use the following steps to help determine the origins. The steps guide you through an exercise to find a common Git ancestor with the official Elastic Path source repository. Based on the results, you an decide to follow the cherry-pick or consuming all patches approach.

  1. In the base folder of your customized ep-commerce source code, run the following command in your terminal:

    git log | grep 0ad7d866de02fd8f580a564845b8498d069a1706

    If the command returns the following result, follow the Cherry-pick instructions:

    commit 0ad7d866de02fd8f580a564845b8498d069a1706

    If the command returns no results, follow the Patch instructions.