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()and byskip_if_brapi_down()(intests/testthat/helper-live-server.R), which pings the server once per run. They run, on CI as well as locally, whenever the server answers/serverinfowith HTTP 200 and JSON, and are skipped otherwise, with the HTTP status (or “no response”) in the skip message. - Mocked tests use
testthat::local_mocked_bindings()and run fully offline. - The parallel batch-fetching tests need
furrrandfutureinstalled. They are skipped rather than failed when either package is missing.
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 note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
