Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bms63 committed Jul 14, 2022
0 parents commit 135fbaf
Show file tree
Hide file tree
Showing 59 changed files with 4,121 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
^renv$
^renv\.lock$
^.*\.Rproj$
^.*\.lycheeignore$
^\.Rproj\.user$
^pkgdown$
^_pkgdown\.yml$
^.github$
^.lintr$
^docs$
^Meta$
^codecov\.yml$
^man/dev_util_.+\.Rd$
^vignettes/admiral\.Rmd$
^vignettes/development_process\.Rmd$
^vignettes/contribution_model\.Rmd$
^vignettes/pr_review_guidance\.Rmd$
^vignettes/programming_strategy\.Rmd$
^vignettes/git_usage\.Rmd$
^vignettes/faq\.Rmd$
^vignettes/writing_vignettes\.Rmd$
^vignettes/unit_test_guidance\.Rmd$
^vignettes/.+png$
^LICENSE\.md$
^\.github$
^admiralext\.Rcheck$
^admiralext.*\.tar\.gz$
^admiralext.*\.tgz$
^staged_dependencies.yaml$
^README.Rmd$
5 changes: 5 additions & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (Sys.getenv("GITHUB_ACTIONS") == "" || (Sys.getenv("GITHUB_ACTIONS") == "true" && getRversion()$major == 3 && getRversion()$minor == 6)) {
source("renv/activate.R")
} else {
options(repos = c(CRAN = "https://cran.rstudio.com"))
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/* @dinakar29
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bug Report
description: Something is not working correctly or is not working at all!
title: "Bug: <Insert Issue Title Here>"
labels: ["bug", "programming"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
**Example:** Bug: derive_vars_dtm() is returning NA values when using preserve argument
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us what were you expecting to happen before the bug?
placeholder: "A bug happened!"
validations:
required: true
- type: textarea
id: session-info
attributes:
label: Session Information
description: Use `sessionInfo()` in the R console to gather all the details of your environment when the bug happened.
placeholder: "Place the console output here"
validations:
required: false
- type: textarea
id: logs
attributes:
label: Reproducible Example
description: We love code that can reproduce the example. Check out [reprex](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html)
placeholder: "Please give us as many details as you can! The faster we can recreate the bug, the faster we can get a fix in the works. Warning, Error Messages and Screenshots are also great."
validations:
required: false
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/02_feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Feature Request
description: Enchancement to admiral functionality
title: "Feature Request: <Insert Issue Title Here>"
labels: ["enhancement", "programming"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request! We love keeping admiral fresh!
- type: textarea
id: feature
attributes:
label: Feature Idea
description: Tell us your idea in as few words as possible
placeholder: "`derive_var_dtm` should do x, y and z"
validations:
required: true
- type: textarea
id: input
attributes:
label: Relevant Input
description: Can you provide what the inputs should look like?
placeholder: "What should the input look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue"
validations:
required: false
- type: textarea
id: output
attributes:
label: Relevant Output
description: Can you provide what the final output should look like?
placeholder: "What should the output look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue"
validations:
required: false
- type: textarea
id: code
attributes:
label: Reproducible Example/Pseudo Code
description: Can you provide a working example or a sketch of how the code should work?
placeholder: "We love example code and it will speed up the process! REMINDER: no patient level data or company sensitive information should be shared via this open public issue"
validations:
required: false
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/03_docs_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Updates or Enhancements for Documentation
description: Documents out of date? Examples need reworking? Got an idea for a new article?
title: "Documentation: <Insert Issue Title Here>"
labels: ["vignettes", "website", "documentation"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
The admiral team loves documentation! Help us keep it up to date and fresh!
- type: dropdown
id: browsers
attributes:
label: Please select a category the issue is focused on?
multiple: true
options:
- Function Documentation
- User Guides
- Developer Guides
- Other
- I have a new documentation idea! Yay!
- type: textarea
id: docs-out-if-sync
attributes:
label: Let us know where something needs a refresh or put your idea here!
description: Screen shots are super helpful here! You can do a screenshot and cut and paste it here right in here.
placeholder: "Something is out of sync or needs a refresh"
validations:
required: true
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/05_onboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Onboarding Tasks
description: Bringing a Core or non-Core member onto the admiral team [for admiral team only]
title: "Onboarding: <Insert Issue Title Here>"
labels: ["onboarding"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
Welcome to the Team! We love contributors!
- type: checkboxes
id: core
attributes:
label: Onboarding tasks for Core (Roche-GSK) Team Members
description:
options:
- label: Given a tour of Github from a Core member
- label: Understand how to Create Issues and do a Pull Request
- label: Understand the Programming Strategy
- label: Read and understand [Developer Guides Articles](https://pharmaverse.github.io/admiral/index.html)
- label: Invited to all relevant meetings - Stand Ups, Retrospective, Sprint Planning, Question/Comments, Backlog, Community Meeting
- label: Given access to Box and relevant documents
- label: Given write access to Github Repository
- label: Slack channel invites to admiral and admiral_dev
- label: Introduction to Teams ways of working
- type: checkboxes
id: non-core
attributes:
label: Onboarding tasks for non-Core Team Members
description:
options:
- label: Given a tour of Github from a Core member
- label: Understand how to Create Issues and do a Pull Request
- label: Understand the Programming Strategy
- label: Read and understand [Developer Guides Articles](https://pharmaverse.github.io/admiral/index.html)
- label: Invited to all relevant meetings - Question/Comments, Community Meeting
- label: Given write access to Github Repository
- label: Slack channel invites to admiral
- label: Introduction to Teams ways of working
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/06_general_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: General Issue
description: Issue that is difficult to fit into bug, feature or documentation issue.
title: "General Issue: <Insert Issue Title Here>"
labels: ["general issue"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
**Example:** General Issue: Linked In Blog Post for updates on the latest admiral release?
- type: textarea
id: background
attributes:
label: Background Information
description: Please provide the context and purpose of this piece of work. Links and screenshots are encouraged.
placeholder: "Example: Use changelog/news.md file to gather relevant changes and create into a nice post for Linked In. The more information the better and the faster we can get this issue completed."
validations:
required: true
- type: textarea
id: done
attributes:
label: Definition of Done
description: Please define the deliverable or the desired outcome.
placeholder: "Example: All changes since last release are highlighted in Blog Post and posted to Linked In"
validations:
required: false
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Thank you for your Pull Request! We have developed this task checklist from the [Development Process Guide](https://pharmaverse.github.io/admiral/main/articles/development_process.html) to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `devel` branch until you have checked off each task.

- [ ] Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
- [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Run `styler::style_file()` to style R and Rmd files
- [ ] Updated relevant unit tests or have written new unit tests - See [Unit Test Guide](https://pharmaverse.github.io/admiral/main/articles/unit_test_guidance.html#writing-unit-tests-in-admiral-)
- [ ] If you removed/replaced any function and/or function parameters, did you fully follow the [deprecation guidance](https://pharmaverse.github.io/admiral/main/articles/programming_strategy.html#deprecation-1)?
- [ ] Update to all relevant roxygen headers and examples.
- [ ] Run `devtools::document()` so all `.Rd` files in the `man` folder and the `NAMESPACE` file in the project root are updated appropriately
- [ ] Address any updates needed for vignettes and/or templates
- [ ] Update `NEWS.md` if the changes pertain to a user-facing function (i.e. it has an `@export` tag) or documentation aimed at users (rather than developers)
- [ ] Build admiral site `pkgdown::build_site()` and check that all affected examples are displayed correctly and that all new functions occur on the "[Reference](https://pharmaverse.github.io/admiral/main/reference/index.html)" page.
- [ ] Address or fix all lintr warnings and errors - `lintr::lint_package()`
- [ ] Run `R CMD check` locally and address all errors and warnings - `devtools::check()`
- [ ] Link the issue so that it closes after successful merging.
- [ ] Address all merge conflicts and resolve appropriately.
- [ ] Pat yourself on the back for a job well done! Much love to your accomplishment!
95 changes: 95 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# GitHub Actions Workflows

This directory contains GitHub Actions Continuous integration/continuous delivery (CI/CD) workflows, most of which are also used by `admiral`'s extensions.
Workflows defined here are responsible for assuring high package quality standards without compromising performance, security, or reproducibility.

## What these workflows do?

Most workflows have a `BEGIN boilderplate steps` and `END boilderplate steps` section within them which define some standard steps required for installing system dependencies, R version and R packages which serve as dependencies for the package.

The underlying mechanisms for installing R and Pandoc are defined in [`r-lib/actions`][r-lib-actions], while the installation of system dependencies and R package dependencies is managed via the [Staged Dependencies GitHub Action][sd-action]. The latter is used in conjunction with the [`staged_dependencies.yaml`](../../staged_dependencies.yaml) file in order to install dependencies that are in the _same stage of development_ as the current package. You can read more about how it works [here](sd-repo). Note that the latter is not necesary for this workflow to work and is completely optional.

Following the installation of system dependencies, R, and package dependencies, each workflow does something different.

### [`check-templates.yml`](check-templates.yml)

This workflow checks for issues within template scripts. For example, in admiral package there are several template scripts with admiral-based functions showing how to build certain ADaM datasets. As we update the admiral functions, we want to make sure these template scripts execute appropriately. Functions in the template scripts that are deprecated or used inappropriately will cause this workflow to fail.

### [`code-coverage.yml`](code-coverage.yml)

This workflow measures code coverage for unit tests and reports the code coverage as a percentage of the _total number of lines covered by unit tests_ vs. the _total number of lines in the codebase_.

The [`covr`][covr] R package is used to calculate the coverage.

Report summaries and badges for coverage are generated using a series of other GitHub Actions.

### [`links.yml`](links.yml)

This workflow checks whether URLs embedded in code and documentation are valid. Invalid URLs reults in workflow failures. This workflow uses [`lychee`][lychee] to detect broken links. Occasionally this check will detect false positives of urls that look like urls. To remedy, please add this false positive to the `.lycheeignore` file.

### [`lintr.yml`](lintr.yml)

Static code analysis is performed by this workflow, which in turn uses the [`lintr`][lintr] R package.

Any [`.lintr`](../../.lintr) configurations in the repository will be by this workflow.

### [`man-pages.yml`](man-pages.yml)

This workflow checks if the manual pages in the `man/` directory of the package are up-to-date with ROxygen comments in the code.

Workflow failures indicate that the manual pages are not up-to-date with ROxygen comments, and corrective actions are provided in the workflow log.

### [`pkgdown.yml`](pkgdown.yml)

Documentation for the R package is generated via this workflow. This workflow uses the [`pkgdown`](pkgdown) framework to generate documentation in HTML, and the HTML pages are deployed to the `gh-pages` branch.

Moreover, an additional `Versions` dropdown is generated via the [][multi-version-docs] GitHub Action, so that an end user can view multiple versions of the documentation for the package.

### [`r-cmd-check.yml`](r-cmd-check.yml)

This workflow performs `R CND check` for the package. Failed workflows are typically indicative of problems encountered during the check, and therefore an indication that the package does not meet quality standards.

### [`r-pkg-validation.yml`](r-pkg-validation.yml)

When a new release of the package is made, this workflow executes to create a validation report via [theValidatoR][validation]. The PDF report is then attached to the release within GitHub.

### [`readme-render.yml`](readme-render.yml)

If your codebase uses a [`README.Rmd` file](../../README.Rmd), then this workflow will automatically render a `README.md` and commit it to your branch.

### [`spellcheck.yml`](spellcheck.yml)

Spellchecks are performed by this workflow, and the [`spelling`][spelling] R package is used to detect spelling mistakes. Failed workflows typically indicate misspelled words. In the `inst/WORDLIST` file, you can add words and or acronyms that you want the spell check to ignore, for example occds is not an English word but a common acronym used within Pharma. The workflow will flag this until a user adds it to the `inst/WORDLIST`.

### [`style.yml`](style.yml`)

Code style is enforced via the [`styler`][styler] R package. Custom style configurations, if any, will be honored by this workflow.

Failed workflows are indicative of unstyled code.

## How to use these workflows?

### Reuse (recommended)

You could add just _one_ file called `.github/workflows/common.yml` to directly import these workflows while receiving the latest updates and enhancements, given that the workflows defined in this repository enable reusability via the [`workflow_call`][workflow_call] GitHub Actions event.

The contents of the `.github/workflows/common.yml` file are available in the [`common.yml.inactive`](common.yml.inactive) file in this repository.

### Copy as-is (not recommended)

Alternatively, if you want a high level of customization, you could simply copy the workflows as-is from this repository to your repository.

<!-- Begin links -->
[r-lib-actions]: https://github.com/r-lib/actions
[sd-action]: https://github.com/marketplace/actions/staged-dependencies-action
[sd-repo]: https://github.com/openpharma/staged.dependencies
[lychee]: https://github.com/lycheeverse/lychee
[covr]: https://covr.r-lib.org/
[lintr]: https://lintr.r-lib.org/
[pkgdown]: https://pkgdown.r-lib.org/
[multi-version-docs]: https://github.com/marketplace/actions/r-pkgdown-multi-version-docs
[validation]: https://github.com/marketplace/actions/r-package-validation-report
[spelling]: https://docs.ropensci.org/spelling/
[styler]: https://styler.r-lib.org/
[workflow_call]: https://docs.github.com/en/actions/using-workflows/reusing-workflows
<!-- End links -->
Loading

0 comments on commit 135fbaf

Please sign in to comment.