Git And Github Support - savvato-software/all_docs GitHub Wiki

We use Git and GitHub for version control. This page talks about our workflow and how we use GitHub. For detailed instructions about using Git and GitHub, here are some helpful links for learning more:

Our Git Setup

Our Git structure has several branches. For example, here are some of the branches on the Tribe App project:

  • develop
  • feature/attributes-page
  • feature/notifications-page
  • feature/connect-page

The develop branch is the default branch. Our tickets are all based off feature branches. For example, in the Tribe App project, if you are working on a ticket related to attributes, you will checkout the feature/attributes-page branch. From there, you will checkout a new branch and name it according to the following naming convention: [project abbreviation]-[ticket number].

Example: TRIB-102.

How to Contribute to the Project

To contribute to the project, you will be working on "issues" (GitHub's version of tickets). An admin will assign a ticket to you, or you can assign yourself to something in our backlog. Issues are located directly on the repository on the "issues" tab. We also have project views set up in GitHub where you can see all the issues of a project in a visual Kanban-like board. Find the project you want in our project views.

Pick up an Issue

  • To pick up a ticket, you click on the issue. Click and assign yourself where it says "assign to self" in the right column. Admins can also assign you a ticket.
  • Select "in progress" for the status under project in the right column.

image

If an issue does not exist for what you are working on, you can create one.

  • Go to "issues" on the repository.
  • Select "New Issue"
  • Enter a meaningful title and description
  • Assign to yourself in the right column
  • Select "Submit new issue"
  • Once the issue is created, Select the appropriate project in the right column and set the status appropriately.

Steps to start your work:

  • Before starting, update your local git by syncing your fork on GitHub and pulling all those changes to your local. This ensures you are starting with the latest version of our code. You will need to do this for each branch.

image

  • Checkout the relevant feature branch on your local. Example: git checkout feature/attributes-page
  • From that branch, checkout a new branch for your work with the above naming convention: git checkout -b TRIB-102
  • Do your work on this branch. (Tip: commit early and commit often. If you commit small changes often, you will have good documentation notes for yourself and other developers, you'll have small commits that you can more easily undo if needed, and you won't lose your all your work if something happens to your environment)
  • Push your changes to your fork on GitHub (origin). You can do this often as well.
  • When you are finished, be sure you have pushed all your work to your fork on GitHub. On GitHub, submit a pull request (see below)

Submit a pull request

A pull request is how you submit your code to the project. A reviewer will be notified of your request and will either request changes or merge your code into the project. It is good practice to keep your reviewer, other developers and your future self in mind when submitting commit messages and pull requests. Explain what your ticket accomplishes (changes, fixes, etc.). Explain any issues or noteworthy code. Make your comments meaningful for the next person that needs to understand them.

  • After you have pushed from your local to Github, go to your Github branch that you wish to submit
  • Github should recognize you made changes and put a "Compare & pull request" button at the top of your screen. If you do not see this, first check that you did push your changes from your local to github. Then select "Contribute" and select "open pull request".

image

  • Important: Check the base branch to make sure it is correct. By default, it will be "Develop", but if you branched off a feature branch, change it to that feature branch.
  • Enter a title that begins with [project abbreviation]-[ticket number]. The rest of the title should briefly state the main goal of the ticket. Example: TRIB-102: updates create attribute endpoint
  • Enter a description that further explains you work. Summarize what you did. List any problems. List anything noteworthy.
  • When ready, select the "Create pull request" button.

image

  • Immediately add a comment with a link to the issue ticket you were working on.
  • In your issue ticket, update the status (right column under project) to "In Q/A"

What happens next

  • Automated CI/CD scripts will check your code for build issues and testing coverage. If these checks fail, address the issues in your local and push your changes on the same branch you submitted, and they will automatically be added to your pull request.
  • An admin will link your pull request to the issue ticket. You will then see it on your issue ticket when viewing issues or the project view.
  • A reviewer will go over you code. They will either request changes in the comments or merge your pull request into the base branch you selected above.
  • If you need to address any change requests, work on the same branch and push your changes to your Github.
  • Once your pull request has been accepted and merged into the project, you can delete your ticket branch and create a new one for your next ticket.