Issues

Issues will be collected using GitHub's issue trackers, one for each HADES repo. Anyone can file an issue.

Assign an issue to a collaborator to indicate that person is working on it, or will be working on it shortly.

Issues can be labelled with the following labels (See also here):

Type of issue

Issue collaboration

Milestones

GitHub milestones should be used to indicate future versions, and link issues to those versions. Note that these milestones will also be reported in our roadmap dashboard, so they are a good way to keep HADES users informed on what will happen to their favorite package moving forward.

Some recommendations for milestones:

Pull requests

Before you do a pull request, you should always file an issue and make sure the package maintainer agrees that it’s a problem, and is happy with your basic proposal for fixing it. We don’t want you to spend a bunch of time on something that we don’t think is a good idea.

Additional requirements for pull requests:

Repo organization

All HADES repos follow the basic structure of R packages. See R packages for a thorough discussion on R packages.

Documentation

We use R's default package documentation features:

The package manual and vignettes are available

All of these should be generated when releasing a new version, as discussed in the Release Process section.

README.md

In addition, the README.md file forms the main page of the package repo. This page has a standard structure, as for example can be seen here.

extras folder

The extras folder contains all files used by the package developer. These files will not be part of the package once installed. A required file in this folder is PackageMaintenance.R, which contains the code executed when releasing a package.

Unit tests

OHDSI unit testing for R follows the standard R practice using test_that: A folder named 'tests' is created in the root of the package, and this folder contains

library(testthat)
library(<package name>)
test_check("<package name>")

The sub-folder 'testthat' should contain one or more R scripts whose file name starts with 'test-' (e.g. 'test-connection.R'. Each file should contain one or more test_that blocks, for example

test_that("Function x returns 2", {
  expect_equal(x(), 2)
})

When unit tests are performed

Unit tests are triggered when

You should only push changes to the GitHub repository if they pass R check locally.

Code coverage

We use codecov in combination with the covr package to measure which lines of codes are covered by at least one unit test.

Testing functions requiring database access

On the OHDSI Jenkins server there are 3 databases that can be accessed from within a unit test, for the 3 main platforms (SQL Server, Oracle, PostgreSQL). To access the databases locally, you'll need to specify several environmental variables. These environmental variables should also be available when running tests using Github Actions.

Some example code in the DatabaseConnector package can be found here.

Coding guidelines

Some general coding guidelines:

Function calls must not have invisible side effects

When a user calls a function, the effect of that call should be aparent to the user. This means:

Intead of using library, always explicitly reference the packge a function belongs to, for example SqlRender::translate().

Avoid unnecessary dependencies

Dependencies lead to instability. Only add dependencies to other packages if completely unavoidable.

We have more or less accepted we need to depend on the core tidyverse packages, so any of those packages are allowed.

Use named arguments

Except for very simple function calls (e.g. print(x)), use named arguments, for example:

sql <- SqlRender::translate(sql = "SELECT * FROM my_table;", targetDialect = "postgresql")

instead of

sql <- SqlRender::translate("SELECT * FROM my_table;", "postgresql")


OHDSI/Hades documentation built on April 3, 2025, 3:06 p.m.