Skip to content

Session 3 guide

Selin Jessa edited this page May 7, 2020 · 14 revisions

Code working group - Session 3

Agenda

  • 30 min: questions, troubleshooting, and fixing the repo
  • 5 min: recap
    • the workflow: why branch, commit, merge, rebase
    • testing: tolerance, regex
  • 10 min: intro to continuous integration, look around examples at the package cytobox
  • Flip the switch and turn on Travis builds! [on Travis, and update branch rules]
  • 5 min: intro PRs, PRs vs merge
  • 5 min: introduce the next task
  • 5 min: demo pull request for one issue branch onto develop-private, and follow the status check

Task:

The goal of this task is to start incorporating continuous integration and Pull Requests into our workflow, and try out the cycle of adding code, building, and debugging.

  1. Get the latest changes on the develop-private branch:
    • Go to the branch, git checkout develop-private and run git pull
    • Go back on your issue branch, git checkout issue/XXX and rebase: git rebase develop-private

🛑 At this step, you should verify that on your branch, you see a file called .travis.yml. This file needs to exist on the branch for Travis to run status checks on it.

  1. If you see "Current branch issue/8 is up to date.", go to Step 3! If not (i.e., if some changes from develop-private were incorporated into your branch), push the change of history to GitHub: git push -f origin issueXXX

  2. Now you'll want to watch the Travis status check on your branch

    • ✅ If the build passes, with a green checkmark, then there were no errors or warnings, and you can go to the next step
    • ❌ If the build fails: look through the build report, and fix the issues on your issue branch
      • From your branch, you'll need to inspect the Travis build log to find the issue, modify the appropriate files to fix it, add, commit, and push to trigger a new build
      • Repeat this until the build passes, let us know if you need help debugging! Here are a couple debugging tips:
        • The error will typically have occurred at the R CMD check step, so in the Travis build logs, the place to look is in the section "Checking package"
        • This section will output NOTEs, WARNINGs, and ERRORs, but only the latter two will cause a build to fail, so be sure to look for those messages to find the bug
  3. Congrats, your build passed! Open a pull request to merge issue/XXX into develop-private (NOT master-private).

Clone this wiki locally