BDB650

Github

Summary

Introduction

Repositories

Issues and Milestones

Github Workflow

Pull Requests

Automation

Introduction

What is Github

Internet hosting service for version control using git

Most popular collaboration tool for software development

Free of use (with limitations)

Github Tools

Besides hosting repos, Github provides tools for:

    creating issues and milestones

    automating testing and deployment

    linking with third-party applications

Repositories

What is a Repo

A repository is where a team can store, manage, and collaborate on source code

Repositories can be private or public

Anyone can create or fork a repository for free

Settings exist to control access and protect the code

Repository GUI

Github provide GUIs for:

    Looking at different branches and tags

    Adding and editing files

    Creating a Wiki

    Setting up a Project

Issues and Milestones

Issues

Issues can be created to list actionable items or point out bugs

Issues can be assigned, labeled, and added to milestones and projects

Multiple comments can be added to issues

Issues are often closed with a tag to the PR (or commit) that solved it

Milestones

A milestone is a collection of issues

Milestones can have a due date and a description

Frequently used to combine issues wrt:

    Release Planning (Sprints)

    Feature Development

    Bug Fixing

git Workflows

git Workflows

There are multiple ways in which a team can choose to collaborate using git/Github

These different methods are called git workflows

The most common flow adopted in CAPSTONE projects is the Github Flow

Github Workflow

1 - Clone or pull the Github repo

2 - Create a branch with a proper name

3 - Make the required changes and test

4 - Stage and commit the changes

5 - Push the branch to GitHub

6 - Merge via a Pull Request

7 - Delete the branch

Pull Request

Pull Request

Pull Requests (PRs) allow developers to propose changes

PRs can incorporate source code from other branches or from forked repos

Developers can visualize all changes that a PR introduces

Developers can document PRs (similar to issues)

Pull Request

Once accepted, a Pull Request merges the proposed code into the destination branch

Often, the "pulled" branch is deleted after the PR is done

PRs can be used to protect the source code and as part of an automation process

Automation

Github Actions

Github Actions allow developers to automate the boring stuff

These include: linting, testing, deployment, etc.

These actions run in machines hosted by Github or third-party vendors; frequently use integration

YAML

Github Actions rely on the use of YAML files for defining workflows

These files specify:

→ Which systems to run the tests on

→ What triggers the workflow

→ What commands to run

→ etc.

CI/CD

Continuous Integration

regularly building, testing, and merging to a shared repository

Continuous Delivery

regularly delivering software to a staging environment for testing and user acceptance

Continuous Deployment

automatically deploying the software to production with no manual intervention

CI/CD Diagram

Reading Material

GitHub and Git Tutorial for Beginners (required)

Benefits of Pull Requests (required)

Github Actions (required)

YAML (required)

CI vs CD vs CD (required)

CI/CD Tools (required video)