From 4e8c75b24f23dbf13d830c284d1be9b2f5c5e20c Mon Sep 17 00:00:00 2001 From: "Hiranyamaya (Hiru) Dash" <16350928+HDash@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:56:47 +0100 Subject: [PATCH 1/7] Force install pacakge with dependencies --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 0d78967a..b2295224 100644 --- a/action.yml +++ b/action.yml @@ -330,7 +330,7 @@ runs: install.packages(c("rmarkdown","BiocManager"), dependencies = TRUE) message(paste('****', Sys.time(), 'pass number 1 at installing dependencies****')) repos <- BiocManager::repositories() - remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE) + remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE) continue-on-error: true shell: Rscript {0} @@ -342,7 +342,7 @@ runs: options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) message(paste('****', Sys.time(), 'pass number 2 at installing dependencies****')) repos <- BiocManager::repositories() - remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE) + remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE) shell: Rscript {0} - name: 🛠 Install RUnit (via BiocGenerics) From 182483470b8227381857d5d72bb609b9d5e934c1 Mon Sep 17 00:00:00 2001 From: HDash <16350928+HDash@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:02:09 +0100 Subject: [PATCH 2/7] Use CODECOV_TOKEN for coverage report upload --- action.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index b2295224..a66ac459 100644 --- a/action.yml +++ b/action.yml @@ -96,6 +96,12 @@ inputs: (e.g. {{ secrets.PAT_GITHUB }}) which allows access to private repositories. Read here for more details: https://docs.github.com/en/actions/security-guides/automatic-token-authentication. + CODECOV_TOKEN: + description: > + Codecov repository token needed to upload coverage reports. + Providing this token helps prevent report upload failures by bypassing + Codecov's GitHub API rate limits. Read here for more details: + https://docs.codecov.com/docs/adding-the-codecov-token cache_version: description: > Which cache version to use. @@ -330,7 +336,7 @@ runs: install.packages(c("rmarkdown","BiocManager"), dependencies = TRUE) message(paste('****', Sys.time(), 'pass number 1 at installing dependencies****')) repos <- BiocManager::repositories() - remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE) + remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE) continue-on-error: true shell: Rscript {0} @@ -342,7 +348,7 @@ runs: options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) message(paste('****', Sys.time(), 'pass number 2 at installing dependencies****')) repos <- BiocManager::repositories() - remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=TRUE) + remotes::install_local(repos=repos, dependencies=TRUE, build_vignettes=FALSE, upgrade=TRUE, force=FALSE) shell: Rscript {0} - name: 🛠 Install RUnit (via BiocGenerics) @@ -441,9 +447,13 @@ runs: - name: 📋 Test coverage if: inputs.run_covr == 'true' && runner.os == 'Linux' + env: + CODECOV_TOKEN: ${{ inputs.CODECOV_TOKEN }} run: | + ## NOTE: codecov() uses CODECOV_TOKEN env var if specified. + ## (recommended) covr::codecov() - shell: Rscript {0} + shell: Rscript {0} - name: 🛠 Install package ️ if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' From b162168ec6302b786eef6737beb813710d16b8db Mon Sep 17 00:00:00 2001 From: "Brian M. Schilder" <34280215+bschilder@users.noreply.github.com> Date: Sat, 21 Sep 2024 15:23:48 +0100 Subject: [PATCH 3/7] update to R 4.4.1 --- .Rprofile | 6 ------ .github/workflows/rworkflows.yml | 2 +- DESCRIPTION | 4 ++-- NEWS.md | 11 +++++++++++ 4 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 .Rprofile diff --git a/.Rprofile b/.Rprofile deleted file mode 100644 index 11149d70..00000000 --- a/.Rprofile +++ /dev/null @@ -1,6 +0,0 @@ -options(repos = c(BioCsoft = "https://bioconductor.org/packages/3.18/bioc", - BioCann = "https://bioconductor.org/packages/3.18/data/annotation", - BioCexp = "https://bioconductor.org/packages/3.18/data/experiment", - BioCworkflows = "https://bioconductor.org/packages/3.18/workflows", - BioCbooks = "https://bioconductor.org/packages/3.18/books", - CRAN = "https://cran.rstudio.com/" )) diff --git a/.github/workflows/rworkflows.yml b/.github/workflows/rworkflows.yml index 32b89c01..900110e5 100644 --- a/.github/workflows/rworkflows.yml +++ b/.github/workflows/rworkflows.yml @@ -25,7 +25,7 @@ jobs: - os: ubuntu-latest r: auto bioc: release - cont: ghcr.io/bioconductor/bioconductor_docker:RELEASE_3_18 + cont: ghcr.io/bioconductor/bioconductor_docker:RELEASE_3_19 python-version: 3.11 - os: macOS-latest r: latest diff --git a/DESCRIPTION b/DESCRIPTION index 837f0a47..23d841da 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rworkflows Type: Package Title: Test, Document, Containerise, and Deploy R Packages -Version: 1.0.1 +Version: 1.0.2 Authors@R: c(person(given = "Brian", family = "Schilder", @@ -64,4 +64,4 @@ VignetteBuilder: knitr License: GPL-3 Config/testthat/edition: 3 LazyData: true -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 diff --git a/NEWS.md b/NEWS.md index d7ff0e69..651593e0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,14 @@ +# rworkflows 1.0.2 + +## New features + +* Update *rworkflows.yml* to use new Bioc release, 3.19 + +## Bug fixes + +* Get back up on CRAN after deprecation occurred while I was away. +* Remove .*Rprofile* (didn't seem to help CRAN and was getting outdated) + # rworkflows 1.0.1 ## New features From 90555d4cea76806dc2ae7682cf1a00d501db13c5 Mon Sep 17 00:00:00 2001 From: "Brian M. Schilder" <34280215+bschilder@users.noreply.github.com> Date: Sat, 21 Sep 2024 15:23:52 +0100 Subject: [PATCH 4/7] update to R 4.4.1 --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 651593e0..695d0f59 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ ## New features +* Update to R 4.4.1 and ensure everything stil works. * Update *rworkflows.yml* to use new Bioc release, 3.19 ## Bug fixes From e4259a9a88b61556a5d7f61f298483b5afcd0836 Mon Sep 17 00:00:00 2001 From: "Brian M. Schilder" <34280215+bschilder@users.noreply.github.com> Date: Wed, 2 Oct 2024 20:48:25 +0100 Subject: [PATCH 5/7] Add GH token to all code check steps --- .Rhistory | 98 +++++++++++------------ DESCRIPTION | 2 +- NEWS.md | 14 +++- action.yml | 14 ++++ tests/testthat/test-construct_authors.R | 5 +- tests/testthat/test-construct_conda_yml.R | 3 +- 6 files changed, 83 insertions(+), 53 deletions(-) diff --git a/.Rhistory b/.Rhistory index fc99a7ec..a89306dd 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,52 +1,3 @@ -jsn <- jsonlite::read_json(path) -names(jsn) -testthat::expect_true( -all(c("image","features","customizations") %in% names(jsn)) -) -devtools::check_man() -file.edit("Rprofile") -file.edit(".Rprofile") -BiocManager::repositories() -devtools::check_man() -library(rworkflows) -deparse(BiocManager::repositories()) -cat(deparse(BiocManager::repositories())) -cont4 <- construct_cont(default_tag = "release", -default_registry = "ghcr.io", -run_check_cont = TRUE) -cont4 <- construct_cont(default_tag = "release", -default_registry = NULL, -run_check_cont = TRUE) -is.null(c("a","b")) -library(rworkflows) -cont4 <- construct_cont(default_tag = "release", -default_registry = NULL, -run_check_cont = TRUE) -devoptera::args2vars(construct_cont) -default_registry -default_registry=NULL -default_registry <- check_registry(registry = default_registry) -#### Remove any trailing : (e.g. when default_tag=NULL) #### -cont <- lapply(cont, function(x){ -if(is.null(x)) NULL else trimws(x,whitespace = ":") -}) -#### Run QC #### -cont2 <- lapply(cont,function(co){ -if(is.null(co)){ -return(NULL) -} else if(!grepl("/",co) && -!is.null(default_cont)){ -messager("Only tag name supplied to 'cont'.", -"Assuming default=",shQuote(default_cont),v=verbose) -co <- paste(default_cont,co,sep=":") -} else if(!grepl(":",co) | -!grepl(default_cont,co)) { -return(co) -} -splt <- strsplit(co,":")[[1]] -bioc_version <- rev(splt)[1] -if(isTRUE(versions_explicit)){ -if(grepl(":",co)){ info <- bioc_r_versions(bioc_version = bioc_version) return( paste0(splt[[1]],":RELEASE_",gsub("[.]","_",info$bioc)) @@ -510,3 +461,52 @@ library(rworkflows) ?testthat::skip_on_cran() testthat::skip_if_offline() readLines("https://hub.docker.com/v2/repositories//bioconductor/bioconductor_docker/tags?page_size=1000") +devtools::check_man() +devtools::install_dev_deps() +devtools::install_dev_deps() +gh::gh_token() +file.edit("~/.Renviron") +credentials::set_github_pat() +gh::gh_token() +devtools::install_dev_deps() +credentials::set_github_pat() +devtools::install_dev_deps() +devtools::build() +devtools::check_man() +version +version +install.packages("devtools") +install.packages("BiocManager") +install.packages("devtools") +devtools::install_dev_deps() +devtools::check_man() +install.packages("roxygen2") +devtools::check_man() +devtools::install_dev_deps() +packageVersion("roxygen2") +version +version +version() +version() +version +rworkflows::use_workflow() +rworkflows::use_workflow(force_new = T) +gh::gh_token() +credentials::set_github_pat() +a1 <- construct_authors() +library() +library(rworkflows) +a1 <- construct_authors() +testthat::expect_equal(as.character(a1), "yourGivenName yourFamilyName [cre] (yourOrcidId)") +a2 <- construct_authors(authors = "Test 1, Test1") +testthat::expect_equal(as.character(a2), "Test 1, Test1") +testthat::expect_equal(as.character(a1), "yourGivenName yourFamilyName [cre] (yourOrcidId)") +testthat::expect_true(as.character(a1) %in% +c("yourGivenName yourFamilyName [cre] (ORCID: yourOrcidId)", +"yourGivenName yourFamilyName [cre] (yourOrcidId)")) +installed.packages() +names(installed.packages()) +rownames(installed.packages()) +"reticulate" %in% rownames(installed.packages()) +credentials::set_github_pat() +remotes::install_github("r-lib/remotes") diff --git a/DESCRIPTION b/DESCRIPTION index 23d841da..8482e316 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rworkflows Type: Package Title: Test, Document, Containerise, and Deploy R Packages -Version: 1.0.2 +Version: 1.0.3 Authors@R: c(person(given = "Brian", family = "Schilder", diff --git a/NEWS.md b/NEWS.md index 695d0f59..d2b9f455 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,14 +1,26 @@ +# rworkflows 1.0.3 + +## New features + +* New arg `run_telemetry` allows users to disable workflow telemetry. + +## Bug fixes + +* Add `GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}` to all code check steps. + # rworkflows 1.0.2 ## New features -* Update to R 4.4.1 and ensure everything stil works. +* Update to R 4.4.1 and ensure everything still works. * Update *rworkflows.yml* to use new Bioc release, 3.19 ## Bug fixes * Get back up on CRAN after deprecation occurred while I was away. * Remove .*Rprofile* (didn't seem to help CRAN and was getting outdated) +* *test-construct_conda_yml.R*: Add conditional to only run certain steps + if `reticulate` is installed (for `noSuggests` tests in CRAN). # rworkflows 1.0.1 diff --git a/action.yml b/action.yml index a66ac459..aca14b7a 100644 --- a/action.yml +++ b/action.yml @@ -164,11 +164,17 @@ inputs: description: > Free up additional disk space by deleting non-essential sofwares. default: false + run_telemetry: + description: > + Whether to run the workflow telemetry action: + https://github.com/catchpoint/workflow-telemetry-action + default: true runs: using: 'composite' steps: - name: 🔭 Collect Workflow Telemetry + if: inputs.run_telemetry == 'true' uses: runforesight/workflow-telemetry-action@v1 continue-on-error: true with: @@ -391,6 +397,7 @@ runs: AS_CRAN: ${{ inputs.as_cran }} run_vignettes: ${{ inputs.run_vignettes }} timeout: ${{ inputs.timeout }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) if(!require("rcmdcheck", quietly=TRUE)) install.packages("rcmdcheck") @@ -414,6 +421,7 @@ runs: if: inputs.has_runit == 'true' env: timeout: ${{ inputs.timeout }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) BiocGenerics:::testPackage() @@ -427,6 +435,7 @@ runs: run_vignettes: ${{ inputs.run_vignettes }} as_cran: ${{ inputs.as_cran }} timeout: ${{ inputs.timeout }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE, timeout=Sys.getenv("timeout")) #### Install deps #### @@ -449,6 +458,7 @@ runs: if: inputs.run_covr == 'true' && runner.os == 'Linux' env: CODECOV_TOKEN: ${{ inputs.CODECOV_TOKEN }} + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | ## NOTE: codecov() uses CODECOV_TOKEN env var if specified. ## (recommended) @@ -457,6 +467,8 @@ runs: - name: 🛠 Install package ️ if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' + env: + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: R CMD INSTALL . shell: bash {0} @@ -507,6 +519,8 @@ runs: - name: 📦 Build pkgdown site if: inputs.run_pkgdown == 'true' && runner.os == 'Linux' + env: + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | options(crayon.enabled = TRUE) pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) diff --git a/tests/testthat/test-construct_authors.R b/tests/testthat/test-construct_authors.R index 88088624..4796fdaa 100644 --- a/tests/testthat/test-construct_authors.R +++ b/tests/testthat/test-construct_authors.R @@ -1,7 +1,10 @@ test_that("construct_authors works", { a1 <- construct_authors() - testthat::expect_equal(as.character(a1), "yourGivenName yourFamilyName [cre] (yourOrcidId)") + + testthat::expect_true(as.character(a1) %in% + c("yourGivenName yourFamilyName [cre] (ORCID: yourOrcidId)", + "yourGivenName yourFamilyName [cre] (yourOrcidId)")) a2 <- construct_authors(authors = "Test 1, Test1") testthat::expect_equal(as.character(a2), "Test 1, Test1") diff --git a/tests/testthat/test-construct_conda_yml.R b/tests/testthat/test-construct_conda_yml.R index 0b039879..a98b9c5b 100644 --- a/tests/testthat/test-construct_conda_yml.R +++ b/tests/testthat/test-construct_conda_yml.R @@ -30,7 +30,8 @@ test_that("construct_conda_yml works", { #### Construct an actual conda env #### - if(conda_installed() && + if("reticulate" %in% rownames(installed.packages()) && + conda_installed() && is_gha() && .Platform$OS.type != "windows"){ envname <- "testenv" From 4251ae92eabd780971781a0b5be6ba4b91cd2f2c Mon Sep 17 00:00:00 2001 From: "Brian M. Schilder" <34280215+bschilder@users.noreply.github.com> Date: Wed, 2 Oct 2024 23:23:47 +0100 Subject: [PATCH 6/7] Add yml issue templates [skip ci] --- .github/ISSUE_TEMPLATE/bug_report.md | 52 ----------- .github/ISSUE_TEMPLATE/bug_report.yml | 104 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.md | 20 ---- .github/ISSUE_TEMPLATE/feature_request.yml | 40 ++++++++ 5 files changed, 145 insertions(+), 72 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index c41bda2d..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -## 1. Bug description - -(A clear and concise description of what the bug is.) - -### Console output - -``` -# Paste console output here (e.g. from R/python/command line) - -``` - -### Expected behaviour - -(A clear and concise description of what you expected to happen.) - - -## 2. Reproducible example - -### Code - -(Please add the steps to reproduce the bug here. See [here](https://www.r-bloggers.com/2020/10/how-to-make-a-reprex/) for an intro to making a reproducible example (i.e. reprex) and why they're important! __This will help us to help you much faster.__) - -```R -# Paste example here - -``` - -### Data - -(If possible, upload a small sample of your data so that we can reproduce the bug on our end. If that's not possible, please at least include a screenshot of your data and other relevant details.) - - -## 3. Session info - -(Add output of the R function `utils::sessionInfo()` below. This helps us assess version/OS conflicts which could be causing bugs.) - -
- -``` -# Paste utils::sessionInfo() output - -``` -
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..9e28085e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,104 @@ +name: 🐛 Bug Report +description: File a bug report +labels: [bug, no-bot] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this issue! :hugs: + + However note the following before opening an issue: + :warning: **IF YOU DON'T FILL IN THE TEMPLATE, YOUR ISSUE IS LIABLE TO BE CLOSED.** :warning: + + - type: checkboxes + id: checklist + attributes: + label: "Checklist" + options: + - label: "I am able to reproduce the bug with the latest version" + required: true + - label: "I checked, but didn't find any duplicates (open OR closed) of this issue in the repo" + required: true + + - type: input + id: version + attributes: + label: Affected version + description: "What version are you currently using?" + placeholder: "x.y.z (check with the `packageVersion()` R function)" + validations: + required: true + + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to reproduce the bug + description: | + Please add **ALL** the code necessary to reproduce the bug here (step-by-step). + By 'reproduce', we mean that someone else can copy and paste the exact same code into their R console, execute it, and get the exact same output as you. + + This means you need to define all variables *within* the example, including data. + You can upload a small sample of your data by dragging-and-dropping it into this Issue. + Alternatively, you can include code to create some dummy data that reproduces the error. + If that's not possible, please at least include a screenshot of your data and other relevant details. + + See [here](https://www.r-bloggers.com/2020/10/how-to-make-a-reprex/) for an intro to making a reproducible example (i.e. reprex) and why they're important! + placeholder: | + # For example: + df <- data.frame(list(a=rep(2,3), b=rep(1,3))) + df["bTYPO"] + validations: + required: true + + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + description: | + Copy and paste the R console output. + placeholder: | + # For example: + Error in `[.data.frame`(df, "bTYPO") : undefined columns selected + validations: + required: true + + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: | + Tell us what you expect to happen. + placeholder: | + The values of the data.frame column are printed. + validations: + required: true + + - type: textarea + id: session-info + validations: + required: true + attributes: + label: Session info + description: | + Copy and paste the output of the `sessionInfo() R function. + placeholder: | + R version 4.4.1 (2024-06-14) + Platform: aarch64-apple-darwin20 + Running under: macOS 15.0 + + Matrix products: default + BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib + LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0 + + locale: + [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 + + time zone: Europe/London + tzcode source: internal + + attached base packages: + [1] stats graphics grDevices utils datasets methods base + ... + ... + ... + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..ec4bb386 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index c1ee811c..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [---] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..0997c76c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,40 @@ +name: ⭐ Feature Request +description: Submit a feature request +labels: [enhancement, no-bot] +body: + - type: markdown + attributes: + value: | + Thanks for submitting a feature request! + + - type: textarea + id: the-feature-request + attributes: + label: The feature request + description: + Write a clear and concise description of what the feature or problem is. + placeholder: | + I think it could be improved by adding [...] + validations: + required: true + + - type: textarea + id: proposed-solution + attributes: + label: Proposed solution + description: Share how this will benefit its users. + placeholder: | + - One idea would be to add an [...], similar to how this package did [LINK]. + - An alternative solution might be [...] + validations: + required: true + + - type: textarea + id: additional-context + attributes: + label: Additional context + description: + Please include any other context, like screenshots or mockups, if + applicable. + placeholder: | + Our lab studies [...] and thought it would be cool to try [...] From 1908435f9991ccca9c8bc76c8a810a19d3c0720d Mon Sep 17 00:00:00 2001 From: "Brian M. Schilder" <34280215+bschilder@users.noreply.github.com> Date: Wed, 2 Oct 2024 23:33:54 +0100 Subject: [PATCH 7/7] Add form issue templates [skip ci] --- R/use_issue_template.R | 5 +- inst/templates/bug_report.yml | 104 +++++++++++++++++++++++ inst/templates/config.yml | 1 + inst/templates/feature_request.yml | 40 +++++++++ man/get_description.Rd | 9 +- man/get_description_repo.Rd | 9 +- man/infer_docker_org.Rd | 9 +- man/use_issue_template.Rd | 2 +- tests/testthat/test-use_issue_template.R | 2 +- 9 files changed, 162 insertions(+), 19 deletions(-) create mode 100644 inst/templates/bug_report.yml create mode 100644 inst/templates/config.yml create mode 100644 inst/templates/feature_request.yml diff --git a/R/use_issue_template.R b/R/use_issue_template.R index 7fdd320c..78a2956d 100644 --- a/R/use_issue_template.R +++ b/R/use_issue_template.R @@ -10,8 +10,9 @@ #' @importFrom here here #' @examples #' path <- use_issue_template(save_dir=tempdir()) -use_issue_template <- function(templates=c("bug_report.md", - "feature_request.md"), +use_issue_template <- function(templates=c("bug_report.yml", + "feature_request.yml", + "config.yml"), save_dir=here::here(".github", "ISSUE_TEMPLATE"), path=file.path(save_dir,templates), diff --git a/inst/templates/bug_report.yml b/inst/templates/bug_report.yml new file mode 100644 index 00000000..9e28085e --- /dev/null +++ b/inst/templates/bug_report.yml @@ -0,0 +1,104 @@ +name: 🐛 Bug Report +description: File a bug report +labels: [bug, no-bot] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this issue! :hugs: + + However note the following before opening an issue: + :warning: **IF YOU DON'T FILL IN THE TEMPLATE, YOUR ISSUE IS LIABLE TO BE CLOSED.** :warning: + + - type: checkboxes + id: checklist + attributes: + label: "Checklist" + options: + - label: "I am able to reproduce the bug with the latest version" + required: true + - label: "I checked, but didn't find any duplicates (open OR closed) of this issue in the repo" + required: true + + - type: input + id: version + attributes: + label: Affected version + description: "What version are you currently using?" + placeholder: "x.y.z (check with the `packageVersion()` R function)" + validations: + required: true + + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to reproduce the bug + description: | + Please add **ALL** the code necessary to reproduce the bug here (step-by-step). + By 'reproduce', we mean that someone else can copy and paste the exact same code into their R console, execute it, and get the exact same output as you. + + This means you need to define all variables *within* the example, including data. + You can upload a small sample of your data by dragging-and-dropping it into this Issue. + Alternatively, you can include code to create some dummy data that reproduces the error. + If that's not possible, please at least include a screenshot of your data and other relevant details. + + See [here](https://www.r-bloggers.com/2020/10/how-to-make-a-reprex/) for an intro to making a reproducible example (i.e. reprex) and why they're important! + placeholder: | + # For example: + df <- data.frame(list(a=rep(2,3), b=rep(1,3))) + df["bTYPO"] + validations: + required: true + + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + description: | + Copy and paste the R console output. + placeholder: | + # For example: + Error in `[.data.frame`(df, "bTYPO") : undefined columns selected + validations: + required: true + + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: | + Tell us what you expect to happen. + placeholder: | + The values of the data.frame column are printed. + validations: + required: true + + - type: textarea + id: session-info + validations: + required: true + attributes: + label: Session info + description: | + Copy and paste the output of the `sessionInfo() R function. + placeholder: | + R version 4.4.1 (2024-06-14) + Platform: aarch64-apple-darwin20 + Running under: macOS 15.0 + + Matrix products: default + BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib + LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0 + + locale: + [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 + + time zone: Europe/London + tzcode source: internal + + attached base packages: + [1] stats graphics grDevices utils datasets methods base + ... + ... + ... + diff --git a/inst/templates/config.yml b/inst/templates/config.yml new file mode 100644 index 00000000..ec4bb386 --- /dev/null +++ b/inst/templates/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/inst/templates/feature_request.yml b/inst/templates/feature_request.yml new file mode 100644 index 00000000..0997c76c --- /dev/null +++ b/inst/templates/feature_request.yml @@ -0,0 +1,40 @@ +name: ⭐ Feature Request +description: Submit a feature request +labels: [enhancement, no-bot] +body: + - type: markdown + attributes: + value: | + Thanks for submitting a feature request! + + - type: textarea + id: the-feature-request + attributes: + label: The feature request + description: + Write a clear and concise description of what the feature or problem is. + placeholder: | + I think it could be improved by adding [...] + validations: + required: true + + - type: textarea + id: proposed-solution + attributes: + label: Proposed solution + description: Share how this will benefit its users. + placeholder: | + - One idea would be to add an [...], similar to how this package did [LINK]. + - An alternative solution might be [...] + validations: + required: true + + - type: textarea + id: additional-context + attributes: + label: Additional context + description: + Please include any other context, like screenshots or mockups, if + applicable. + placeholder: | + Our lab studies [...] and thought it would be cool to try [...] diff --git a/man/get_description.Rd b/man/get_description.Rd index 045574c5..29df081f 100644 --- a/man/get_description.Rd +++ b/man/get_description.Rd @@ -36,11 +36,10 @@ for \emph{DESCRIPTION} files.} \item{use_repos}{Use R standard R package repositories like CRAN and Bioc to find \emph{DESCRIPTION} files.} -\item{repo}{The requested Bioconductor repository. The default will be the -Bioconductor software repository: BioCsoft. Available repos include: -"BioCsoft", "BioCann", "BioCexp", "BioCworkflows", and "CRAN". Note -that not all repos are available for all versions, particularly older -versions (but who would use those, right?).} +\item{repo}{\code{character(1)} The requested Bioconductor repository. The default +is to pull from the "BioCsoft" repository. Possible repositories include +"BioCsoft", "BioCexp", "BioCworkflows", "BioCann", and "CRAN". Note that +not all repos are available for all versions, particularly older versions.} \item{verbose}{Print messages.} } diff --git a/man/get_description_repo.Rd b/man/get_description_repo.Rd index 13ac4cb1..ce74e804 100644 --- a/man/get_description_repo.Rd +++ b/man/get_description_repo.Rd @@ -20,11 +20,10 @@ get_description_repo( \item{db}{A \link[data.table]{data.table} of R package metadata generated by \link[BiocPkgTools]{biocPkgList}.} -\item{repo}{The requested Bioconductor repository. The default will be the -Bioconductor software repository: BioCsoft. Available repos include: -"BioCsoft", "BioCann", "BioCexp", "BioCworkflows", and "CRAN". Note -that not all repos are available for all versions, particularly older -versions (but who would use those, right?).} +\item{repo}{\code{character(1)} The requested Bioconductor repository. The default +is to pull from the "BioCsoft" repository. Possible repositories include +"BioCsoft", "BioCexp", "BioCworkflows", "BioCann", and "CRAN". Note that +not all repos are available for all versions, particularly older versions.} \item{version}{The requested Bioconductor version. Will default to use the BiocManager defaults (i.e., \code{version()}).} diff --git a/man/infer_docker_org.Rd b/man/infer_docker_org.Rd index 34e26964..12897728 100644 --- a/man/infer_docker_org.Rd +++ b/man/infer_docker_org.Rd @@ -37,11 +37,10 @@ for \emph{DESCRIPTION} files.} to find \emph{DESCRIPTION} files.} \item{\code{db}}{A \link[data.table]{data.table} of R package metadata generated by \link[BiocPkgTools]{biocPkgList}.} - \item{\code{repo}}{The requested Bioconductor repository. The default will be the -Bioconductor software repository: BioCsoft. Available repos include: -"BioCsoft", "BioCann", "BioCexp", "BioCworkflows", and "CRAN". Note -that not all repos are available for all versions, particularly older -versions (but who would use those, right?).} + \item{\code{repo}}{\code{character(1)} The requested Bioconductor repository. The default +is to pull from the "BioCsoft" repository. Possible repositories include +"BioCsoft", "BioCexp", "BioCworkflows", "BioCann", and "CRAN". Note that +not all repos are available for all versions, particularly older versions.} }} } \value{ diff --git a/man/use_issue_template.Rd b/man/use_issue_template.Rd index fa0ef8c6..737888f1 100644 --- a/man/use_issue_template.Rd +++ b/man/use_issue_template.Rd @@ -5,7 +5,7 @@ \title{Use Issue Template} \usage{ use_issue_template( - templates = c("bug_report.md", "feature_request.md"), + templates = c("bug_report.yml", "feature_request.yml", "config.yml"), save_dir = here::here(".github", "ISSUE_TEMPLATE"), path = file.path(save_dir, templates), force_new = FALSE, diff --git a/tests/testthat/test-use_issue_template.R b/tests/testthat/test-use_issue_template.R index 495323e4..50888f08 100644 --- a/tests/testthat/test-use_issue_template.R +++ b/tests/testthat/test-use_issue_template.R @@ -9,5 +9,5 @@ test_that("use_issue_template works", { show = TRUE) ) testthat::expect_true(all(file.exists(path2))) - testthat::expect_equal("name: Bug report",out[[2]]) + testthat::expect_equal("description: File a bug report",out[[2]]) })