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-commerce
source code folder. Make sure you are in yourmain
branch, and have retrieved the latest source code.Install the SMC Upgrader tool using the installation instructions.
Follow the setup instructions for the SMC Upgrader tool.
Create a branch by running the following (replace
[FIX_BRANCH]
with a unique branch name):git checkout -b [FIX_BRANCH]
Run the upgrade process in the SMC Upgrader tool by running the following (replace the version number with your current Self Managed Commerce version):
smc-upgrader 8.6.x
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
Address any compilation issues until you are able to successfully compile. Complete the merge by running:
git merge --continue
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.
In the base folder of your customized
ep-commerce
source code, switch tomaster
and pull the latest code.git checkout master git pull origin master
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.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
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 commitSHA
of the fix that you want to consume.Address any merge conflicts, run all regression tests, and then push the changes back to your repository.
git push origin [FIX_BRANCH]
Use your source code control interface, such as GitHub, to create a pull request from the fix branch to
master
.Merge the pull request.
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.
Download the patch from
code.elasticpath.com
by browsing to the commit and adding.diff
into the end of the URL.In the base folder of your customized
ep-commerce
source code, switch tomaster
and pull the latest code.git checkout master git pull origin master
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.Apply the patch.
patch -p1 < [PATCH_PATH]
note
Ensure that you replace
[PATCH_PATH]
with the local path of your downloaded patch.
Address any merge conflicts, run all regression tests, and then push the changes back to your repository.
git push origin [FIX_BRANCH]
Use your source code control interface, such as GitHub, to create a pull request from the fix branch to
master
.Merge the pull request.
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.
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.