Consuming Support Fixes
The following guide describes how you can consume official support fixes for your current version of Elastic Path Commerce.
We recommend making regular patch consumption a part of your Elastic Path 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 Elastic Path Commerce, view the Changelog section of the Release Notes.
note
The following instructions assume that your Git repository was created by cloning from the Elastic Path 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 of the latest fixes from your current Elastic Path Commerce version into 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.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 upstream repository and merge.
git fetch upstream git merge upstream/release/[EP_VERSION].x
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.
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.