We want to enforce the following flow for SLA tasks, which requires the Shopify/Github integration:

SLA Tasks

Starting work on an SLA task:

Link to a page del

  1. If you don’t already have it locally, clone the GitHub repo of the site. Do not use bitbucket repos, ask a senior dev to move them over to github.
  2. Ensure your local develop branch is up to date e.g. git checkout develop && git pull.
  3. Use git flow to create a new feature branch, and include a Teamwork task ID in the branch name eg. git flow feature start TW1234567-description-of-task. Where TW###### is the Teamwork task ID (found in the tasks URL)
  4. Commit your changes at least daily, preferably more often. Try to use short but informative commit messages eg. “Fixed known issue with ajax cart” is much more helpful than “Javascript fix”. Where it makes sense prefix a commit message with TW##### where ### is the Teamwork task ID which can be found in the task URL.
  5. One branch per task. Do not put multiple tasks into a single branch, they might not be required for deployment at the same time.
  6. If using Themekit: Duplicate the current production theme, rename your duplicated theme to something similar to the branch name (include the Teamwork ID at a bare minimum). If using Shopify CLI, a hidden theme is automatically created for you.

After task completion:

  • NOTE: This stage of the process may changes slightly. Ideally testing would occur against the develop theme, however code review must come before merging, but after any QA snags.
    1. Add a short summary of what you have changed, added or removed in docs/CHANGELOG.txt.
    2. QA. Put the task through Quality Assurance (QA) process. Request it here: http://metrics.studioforty9dns.com/qa/new If using Shopify CLI: Link your branch to a new theme in Shopify.. As QA team does not have access to Shopify backend, provide them with a direct link your development theme (from Shopify admin, themes -> preview -> once open, bar at the bottom ‘share preview’ and copy the link).
    3. Code Review. Open a Pull Request, ensure it merges into develop (github usually merges into main by default) and add fellow developers as reviewers.
    4. Only senior developers can merge to develop, you are not expected to do this. If merge conflicts arise, do fix them so that a merge can go ahead, or request help.
    5. Deployment. When code review passes your feature branch is ready for deployment. The date of deployment depends on the client, so only the PM / CSM will know what this date is - leave a comment in Teamwork that Code Review has completed and ask for deployment go-ahead and date. You must then explicitly request deployment here: http://metrics.studioforty9dns.com/deployment/new
    6. Once deployment is requested, develop will be merged into main. The main branch is linked as the published theme, so merging into main deploys the task.
    7. If deployment involves changes to checkout, you need to contact the Marketing team so that they can check that nothing unexpected has broken. This is very important as for example if the Facebook Pixel integration breaks, clients can and will lose revenue.

New Projects

For projects this should be much the same:

  1. Each Teamwork task has its own branch which is linked to a Shopify theme.
  2. Commit changes at least daily. Try to use short but informative commit messages eg. “Fixed known issue with ajax cart” is much more helpful than “Javascript fix”. Where it makes sense prefix a commit message with TW##### where ### is the Teamwork task ID which can be found in the task URL.
  3. Raise a pull request for each task as it completes, assigning at least two reviewers. Ensure the pull request is set to merge into develop.
  4. The develop branch should have its own linked theme in the Shopify store - for a new build this can also be the published theme.
  5. If deployment involves changes to checkout, you need to contact the Marketing team so that they can check that nothing unexpected has broken. This is very important as, for example, if the Facebook Pixel integration breaks, clients can and will lose revenue.

On themes that are linked to a branch, every change saved in the customiser creates a new commit in GitHub on the respective branch. On projects, this should help with storing customiser settings.

CAUTION: If you are working on a theme preview generated through npm run dev or shopify theme serve, all customiser changes will not be saved on your local files, nor will they commit to Github. You will have to pull them in from your theme preview. See the ‘Theme Settings’ section on the ‘Working on a project’ page of this documentation.

Revision Control

All developers

All feature branch Pull Requests must be targeted to merge into develop, never into main. If you are reviewing a Pull Request please double-check it is set to merge into the correct branch before approving.

After raising a Pull Request, GitHub may notify you of merge conflicts between your branch and the develop branch. These need to be resolved before any code reviews can be made and the branch can be successfully merged. Resolving merge conflicts is the responsibility of the developer raising the Pull Request.

Only the develop branch or changes pushed from Shopify can be merged into the main branch.

Senior developers

To avoid losing customiser changes on a live site, before merging a feature branch into develop, create a test PR that merges main into develop. If this shows no differences then no changes have been received from Shopify and there is no need to proceed with the PR.

If there are differences, then these need to be merged into develop before the feature branch is merged. Proceed with the PR and merge main into develop.

It is now safe to proceed with the PR for the feature branch. If there are any conflicts they need to be fixed at this stage in the feature branch.

Successful merges of feature branches into develop need to be followed up with a merge of develop into main (this is essentially a deployment to live). Note that if there is a significant time delay between merging main into develop and merging the feature branch into develop the above step of testing for changes between the main and develop branches will need to be repeated.

Developer access to stores

Whether its for interns, non-EU developers (where GDPR rules can make things complicated), or one of myriad other reasons - not all developers have or require the same access levels to individual stores.

Senior developers / staff

  • Sign in to the info@ Shopify Partners account
  • Go to Team and select the team member you need to grant access to a store
  • Double check the Sensitive Permissions at the top (Manage apps and Manage themes should be enough for most developers)
  • Under Store Access and Actions > Managed Store Access, set to Specific Stores and then choose the store(s) to grant access to. Note that the search filter is very poor so try different combinations, eg. neither “Mc” or “Kenna” would display McKenna Man but “man” worked.
  • Click Save.

Changelog

Please update a repository’s changelog to reflect the changes that have been made for each task/pull request.

Changelog format

# STORENAME Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [TW<TASKID>] - <DATE:YYYY-MM-DD>