CSE 341: Web Services

W02 Team Activity: Create the Team Repository

Overview

In this activity, your team will create the repository you will use for the rest of the course. You will also practice the pull request workflow that you will use on the team project.

By the end of the activity, every team member should have created a pull request, reviewed someone else's pull request, and merged an approved pull request.

Coordinate with your team

For this activity, you will need to coordinate with your team members. If possible, meet live in a Microsoft Teams video call. You can also work together by posting messages in your Microsoft Teams channel.

The important thing is that you make sure everyone can create pull requests, review them, and merge them into your repository.

About the Team Project

Your team will use a starter project called Kizuna Rail. Kizuna Rail is a fictional railway site with route information, station and schedule data, ticket options, a booking form, and confirmation pages.

This project is intentionally an existing codebase rather than a blank starter app. Part of your work this semester will be learning how the current application is organized before you make changes to it.

This team repository is separate from your individual Week 02 Books API assignment. Use the team repository for team practice and the team project, and keep your individual assignment work in your own Books API repository.

Why this matters

Working with a team in an existing codebase can be difficult. You will need to read unfamiliar code, coordinate changes with teammates, make small and focused pull requests, and review code that someone else wrote. This is also exactly the kind of work you will do in an internship and throughout your career.

Work together, but rotate roles

For this activity, only one person should create the team repository. After that, everyone should participate as a contributor, reviewer, and merger so the whole team understands the workflow.

Instructions

Choose a repository owner

Decide which team member will create the team repository. This person will be the initial repository owner and will add everyone else as collaborators.

  1. Choose one team member to create the repository.
  2. Make sure everyone knows the GitHub usernames for all team members.

Create the repository from the template

The repository owner should create the team repository from the Kizuna Rail starter template.

  1. Open the starter repository: https://github.com/byui-cse/cse341-ww-student-kizuna-rail.
  2. Click Use this template, then create a new repository. (If you don't see this option, make sure you are logged into GitHub.)
  3. Create the repository under the owner's GitHub account using a clear name like, cse341-team-project.
  4. Set the repository to be public.
  5. After the repository is created, copy the repository URL and share it with the team.

Add all team members as collaborators

The repository owner should invite every team member to collaborate on the repository.

  1. Open the new team repository on GitHub.
  2. Go to Settings, then select Collaborators.
  3. Add each team member by GitHub username.
  4. Each invited team member should accept the invitation.

Protect the main branch

Set up a rule for the main branch so pull requests require at least one review before they can be merged.

  1. In the team repository, open Settings.
  2. Expand the Rules option and select Rulesets.
  3. Create a new branch ruleset.
    • Ruleset name: main branch protection
    • Enforcement status: Active
    • Target branches: Include Default Branch
    • Select the option for Require a pull request before merging and select 1 as the number of required approvals.
    • Ensure that Block force pushes option is selected.
    • Click Create.

Do not skip branch protection

This setting helps prevent accidental direct changes to main. It also ensures that you get to practice reviewing each other's work before code is merged.

Clone the repository

Each team member should clone the team repository to their own computer. You can do this by using the VS Code option to Clone Git Repository... from the welcome page, or run the following command in your terminal:

git clone <team-repository-url>

After cloning, open the project in VS Code.

Practice the pull request workflow

Each team member should make a small local change, push a branch, and create a pull request. Keep the changes small so everyone has time to practice.

Suggested practice changes:

For example, the file might contain content like this:

# Team Practice Notes

## Pull Request Workflow
- Pull the latest `main` branch before starting a new branch.
- Include testing notes in every pull request.
- Ask for review in the team Microsoft Teams channel when a PR is ready.

Each team member should do the following:

  1. Create a new branch with a short name, such as add-practice-note:
    git switch -c add-practice-note
  2. Make a small change locally.
  3. Check which files changed:
    git status
  4. Stage and commit the change:
    git add team-practice.md
    git commit -m "Add team practice note"
  5. Push the branch to GitHub:
    git push origin add-practice-note
  6. Create a pull request into main.
  7. Ask a teammate to review the pull request.

Review and merge pull requests

Rotate through the review and merge process so every team member gets practice.

  1. Each pull request should be reviewed by someone other than the author.
  2. The reviewer should confirm that the change is small and safe.
  3. The reviewer should add a comment and approve the pull request.
  4. After the pull request has an approving review, anyone on the team can merge it. Then, you can safely delete the branch at GitHub.
  5. Continue until every team member has created a pull request.
  6. Continue until every team member has reviewed or merged at least one pull request.

Clean up local branches after your pull request is merged

The original author (who has the local branch for a commit) should delete their local branch after the pull request is merged. For example:

git switch main
git pull origin main
git branch -d add-practice-note

Make sure everyone gets the latest updates

After someone else's pull request is merged, everyone should update their local main branch with git pull origin main before starting another branch.

Completion Checklist

Submission

When you are finished, return to Canvas to complete the team activity quiz. Be prepared to confirm that you know the team repository URL and that every team member was able to create, review, and merge pull requests.

Other Links: