Skip to content

Tutorial 1: Your first commit

Shuiqiang Lin edited this page Apr 7, 2019 · 10 revisions

Everyone on the team should complete this exercise as soon as they have access to the team repo.

Instructions

  1. Check you have access to the repo via gitpod: Setup Instructions
  2. Git pull to get the latest code git pull --rebase --autostash (read this if you're not sure what --rebase does)
  3. In the /client/src/js/pages/teamPage folder, there will be a file called teamPage.spec.js.
  4. Add a test that checks for your name in the describe template tests. (The code should look similar to this)
  describe('#render', () => {
    it('should render my team page', () => {
      const page = new TeamPage();
      expect(page.render()).toContain("<h1>Made by:</h1>");
    });

    it('should contain team members names', () => {
      const page = new TeamPage();
      expect(page.render()).toContain("Sheila");
      expect(page.render()).toContain("Bruce");
    });
  });
  1. Run
    ./go pre-commit This will run the pre-commit checks - something should fail.
  2. Fix the failing test by adding your name and your pairs name to the team page in client/src/pages/teamPage/teamPage.hbs
  3. Run the tests again ./go test – everything should pass.

Before you push

  1. Check the CI build (see below), do not pull unless it's green!
  2. Run git pull --rebase --autostash
  3. Fix any merge conflicts
  4. Run ./go pre-commit
  5. Repeat steps 2-5 until all tests have passed and all conflicts have been resolved

Push your code

  1. Run git add -p to add your changes.
  2. Run git commit -m "[COMMIT MESSAGE] your commit message in the following format
  • git commit -m "[name 1/name 2][#0] {verb here} {what your commit does here}"

e.g.

  • git commit -m "[Bruce/Sheila][#0] Add names Bruce and Sheila to team page"
  1. Git pull to get the latest changes git pull --rebase
  2. ./go pre-commit
  3. Push your changes git push origin master

If you see a 403 error when you push, try this work around Alt Text

Click on the icon on the top right corner and navigate to Open Access Control Alt Text

Allow Gitpod to write to your public repos. This is needed because Gitpod needs to talk to Github to commit your code to the shared repo. If you ever want to use Gitpod on your own private repo you will then need to also allow write access to private repos. This isn't needed for LevelUp though Alt Text

Check the build status

To view the build status and get notifications about the build status:

Add the following XML config to CCTray or CCMenu on your dev machine

https://circleci.com/gh/twlevelup/watch_edition.cc.xml

You can also access the CI server and view the status of the build here Circle CI

Clone this wiki locally