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.
Open a terminal window and change the current directory to your existing
ep-commercesource code folder. Make sure you are in yourmainbranch, and have retrieved the latest source code.Install the Self-Managed Commerce Upgrader tool using the installation instructions.
Follow the setup instructions for the Self-Managed Commerce Upgrader tool.
Create a branch by running the following (replace
[FIX_BRANCH]with a unique branch name):git checkout -b [FIX_BRANCH]Start 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 --ai:start 8.6.xContinue the upgrade process in the Self-Managed Commerce Upgrader tool until all steps are completed:
smc-upgrader --ai:continuePush your branch to your Git repository, create a merge request, and merge into your
mainbranch once your pipeline confirms that all tests are passing.
Cherry-Picking a Single Fix
You can select a specific fix with the COMMIT_SHA number to consume in your development branch.
In the base folder of your customized
ep-commercesource code, switch tomasterand pull the latest code.git checkout master git pull origin masterCreate 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.Check to see if you have a Git remote named
upstreampointing 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.gitFetch 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 commitSHAof the fix that you want to consume.If there are merge conflicts, address them, run all regression tests, and then complete the cherry-pick process.
git cherry-pick --continuePush your branch to your Git repository, create a merge request, and merge into your
mainbranch once your pipeline confirms that all tests are passing.
Applying a Single Fix as a Patch
You can apply specific fix as a patch into your development branch.
Download the patch from
code.elasticpath.comby browsing to the commit and adding.diffinto the end of the URL.In the base folder of your customized
ep-commercesource code, switch tomasterand pull the latest code.git checkout master git pull origin masterCreate 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.Apply the patch.
patch -p1 < [PATCH_PATH]note
Ensure that you replace
[PATCH_PATH]with the local path of your downloaded patch.
If there are merge conflicts, address them, run all regression tests, and then commit the changes.
git commit -m "Consumed all latest platform patches"Push your branch to your Git repository, create a merge request, and merge into your
mainbranch once your pipeline confirms that all tests are passing.
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.
In the base folder of your customized
ep-commercesource code, run the following command in your terminal:git log | grep 0ad7d866de02fd8f580a564845b8498d069a1706If the command returns the following result, follow the Cherry-pick instructions:
commit 0ad7d866de02fd8f580a564845b8498d069a1706If the command returns no results, follow the Patch instructions.