Skip to content

Github Workflow for RFA Web Dev Team

Arvind Ganeshkumar edited this page Oct 12, 2024 · 7 revisions

Github Workflow

This document outlines the github workflow we use in Robotics For All Web Dev Team

Overview

Github Flow is a streamlined workflow for CD. It allows for quick development, and enhances our productivity. The process is a simplified version of Git Flow, which is primarily used to handle software that requires releases.

Our Git Strategy

Our default branch will be the main branch. This is the production branch, and the live channel for the website on Firebase Hosting.

Issues will be split between features (prototypes), bugs, and content/design. Feature issues are new pieces of logic or UI that enhance the functionality of our website. Bug issues are issues that impede user experience or usability: an error, flaw or fault in the design. Content/Design issues are tasks that require developing new content models for Prismic, or refactoring designs on the Figma.

Fetching the Codebase

In order to fetch the codebase, you need to do the following.

  1. Create a folder to store the repository. For example, rfa-website
  2. Navigate to this folder through Terminal/Command Line. Type the command, git clone https://github.com/roboticsforall/website-v2.git
  3. Wait until the command is finished. You should now see all the folders and files related to the website populate
  4. cd into the website folder. Then run npm install. This will install all the dependencies necessary to run the website

Running the Codebase

  1. npm install will install all dependencies for the NextJS app, and the Prismic Slice Machine
  2. To run the app, run npm run dev
  3. To run the slice machine, run npm run slicemachine

General Developer Workflow

I will manage the assignment and creation of issues. However, these are the general steps to take. When assigned a new issue, modify the following settings in the side bar on the right side

  1. Assign your name, the correct tag, and project on the right hand bar
  2. Create a development branch.
  3. Copy the code provided to setup the branch locally

As you develop your issue make sure to commit frequently:

  1. git add .
  2. git commit -m “add your commit message”
  3. git push origin

Once you are ready to submit a pr, do the following things:

  1. Switch to main and get latest
  • git switch main
  • git pull origin
  1. Go back to your branch
  • git switch <your_branch_name>
  1. Merge main into your branch. NOTE: DO NOT merge your branch into main. Remember, main into your branch.
  • git merge main
  1. Commit again if necessary
  2. Push your changes to github

Once you are done with the steps above, submit a pr for the branch:

  1. Add your manager as a reviewer
  2. Link your issue to the pr
  3. Add the project if not already done

Wait for my approval. I will either accept the pr or provide some comments for feedback.

That’s it!

Automation w/ Firebase

When you submit a pr, an automation task should run, creating a preview link to view your changes on the website.

The preview link will expire in at most 7 days.

Helpful Tips

  • While working on the issue, commit frequently. This will make returning to previous code easier.
  • Get latest from main often, this will ensure your code is always up to date
  • Ensure you merge main into your branch before submitting a pr. This will make merge conflicts less likely (nobody likes merge conflicts :)

Git Resources

https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/GitHub

Clone this wiki locally