Skip to content

Session 4 guide

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

Code working group - Session 4

Agenda

  • 30 min: discussion, debugging, tour various build issues
  • 10 min: Intro to Dependencies, DESCRIPTION, NAMESPACE, and examples
  • 5 min: Review the whole workflow, and merge to master-private to close issues
  • 10 min: Demo of adding a dependency

Task

In this task, we'll run through the whole contribution workflow again, but this time, we'll be each adding a function that has an external dependency. The idea is to practice the whole branch-change-commit-rebase workflow. Again, we'll then open a PR from our issue branch to develop-private, and ensure our code passes status checks & reviews before integrating it.

At this point, we'll generally assume everyone has created a function with tests, and that it is now merged into the codebase (master-private), and the issue closed. If not, you can easily start this task independently from the previous issue!

  1. Open a new issue specifying what you'll be adding
  2. Create a new branch
    • First, ensure your local repository is up to date: while on develop-private, pull any changes from GitHub
    • While still on the develop-private branch, create a new branch, corresponding to your new issue
  3. Add your contribution for today's task, by creating a new function which uses a function from an external package available on CRAN. You will need to:
    • Add the package as a dependency in DESCRIPTION
    • Import the function with and @import statement in your function
  4. When you've finished, commit & push your changes, and once Travis status checks pass, open a pull request from your issue branch onto the develop-private branch
  5. If anybody has made changes to the develop-private branch in between your commits to your branch, don't forget to rebase regularly onto develop private:
    • Get the latest changes on the develop-private branch: git checkout develop-private then git pull
    • Go back to your issue branch, git checkout issue/XXX
    • Rebase: git rebase develop-private

✨ Keep in mind our workflow from previous sessions - you'll need to...

  • ...follow the steps from Session 1 to create and document a function
  • ...follow the steps from Session 2 to create a test for it
  • ...follow the steps from Session 3 to push your changes, and run through the debugging cycle until the Travis status checks pass

Clone this wiki locally