.github/CONTRIBUTING.md

Contributing guide

Code of Conduct

Anyone getting involved in this package agrees to our Code of Conduct. If someone is breaking the Will Wheaton rule aka Don't be a dick, or breaking the Code of Conduct, please let Steph know at steph@itsalocke.com or keybase.io/stephlocke.

Bug reports

When you file a bug report, please spend some time making it easy for us to follow and reproduce. The more time you spend on making the bug report coherent, the more time we can dedicate to investigate the bug as opposed to the bug report. We recommend using reprex when providing minimal examples.

If you need a secure way to communicate with the maintainer of this package, message her via her Keybase account.

Ideas

Got an idea for how we can improve the package? Awesome stuff!

Please raise it in the issue tracker with some succinct information on expected behaviour of the enhancement and why you think it'll improve the package.

Package development

We really want people to contribute to the package. A great way to start doing this is to look at the help wanted issues and/or contribute an example.

The package interacts with the Hubspot API so you might need to refer to its docs.

Naming conventions

Submission checklist

Auth details for development

Default app

A default app was created under the Locke Data dev account. It's called "hubspot-pkg-locke-data", ID 205749.

Another app was created only for the purpose of testing bringing your own app. It's called "hubspot-byoa-test-pkg", ID 207639.

Testing

In tests/testthat/setup.R, the token path is set to "" and the API key to "demo" which ensures tests are run with the demo key.

For testing access with OAuth, two tokens were created and saved in tests/testthat, see inst/create_test_tokens.R. They were gitignored and Rbuildignored, and encrypted using the workflow https://cran.r-project.org/web/packages/googlesheets/vignettes/managing-auth-tokens.html#encrypting-tokens-for-hosted-continuous-integration except that they were also Rbuildignored.

Cf https://docs.travis-ci.com/user/encrypting-files/#encrypting-multiple-files

tar cvf tests/testthat/secrets.tar tests/testthat/.hubspot_token.rds tests/testthat/.hubspot_otherapp.rds
travis encrypt-file tests/testthat/secrets.tar

use_git_ignore(c("tests/testthat/secrets.tar", "tests/testthat/.hubspot_token.rds", "tests/testthat/.hubspot_otherapp.rds"))
use_build_ignore(c("tests/testthat/secrets.tar",
"tests/testthat/secrets.tar.enc",
"tests/testthat/.hubspot_token.rds", "tests/testthat/.hubspot_otherapp.rds"))

Therefore, R CMD check can't access them. The tests in tests/testthat/test-oauth.R using the OAuth tokens are skipped when they don't exist. On Travis CI, the tests are run on their own after R CMD check, so if they fail the build will fail.

To run the tests in locally, if you're a regular contributor to the package or your contribution touches OAuth, create tokens by running inst/create_test_tokens.R interactively.

Vignettes and example

At the moment of writing, no rendered code uses something else than the demo API key.



lockedata/hubspot documentation built on March 1, 2020, 8:54 p.m.