Thank you for your interest in contributing to brapiR2!
How to Contribute
- Fork the repository on GitHub
- Clone your fork locally
- Create a branch for your feature or fix
- Make your changes following the style guide below
-
Test your changes with
devtools::check() - Submit a pull request
Style Guide
- Follow the tidyverse style guide
- Use
roxygen2for documentation - All exported functions must have
@examples - Use
clifor user-facing messages (notmessage()orcat())
Adding a New BrAPI Endpoint
- Add the function in the appropriate module file (
R/core.R,R/germplasm.R, etc.) - Follow the existing pattern:
conas first argument,...for query params - Use
brapi_get()orbrapi_post_search()internally - Add
#' @exportto the function’s roxygen block and rundevtools::document()to regenerateNAMESPACE(it carries a roxygen2 “do not edit by hand” header, so never edit it directly) - Write tests in
tests/testthat/ - Update
NEWS.md
Running the Test Suite
- Integration tests run against the public BrAPI test server at https://test-server.brapi.org and require no authentication token.
- These tests are guarded by
skip_on_cran()andskip_if_offline(), so they are skipped automatically when there’s no network access. - Mocked tests use
testthat::local_mocked_bindings()and run fully offline. - Some tests exercise optional integrations and require their packages to be installed for the full suite to run:
furrrandfuture(parallel batch fetching),rappdirs(response caching), andAGHmatrix,BGLR,lme4,metan,rrBLUP, andsommer(genomic selection workflows). Tests that depend on a missing package are skipped rather than failed.
Reporting Issues
- Use the GitHub issue tracker
- Include a minimal reproducible example
- Note which BrAPI server you’re connecting to (if relevant)
Code of Conduct
Please be respectful and constructive. We follow the Contributor Covenant code of conduct.
