diff --git a/.Rbuildignore b/.Rbuildignore index 89edc0b59..5aa579196 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -25,3 +25,4 @@ rsconnect ^CRAN-RELEASE$ ^legacy_support.txt$ +^codecov\.yml$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 45baea1d9..5678def7c 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,121 +1,17 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -# -# NOTE: This workflow is overkill for most R packages and -# check-standard.yaml is likely a better choice. on: push: - branches: - - main - - master + branches: [main, rc-**] pull_request: - branches: - - main - - master + branches: [main] schedule: - - cron: '0 0 1,11,21 * *' # every 10 days (GHA cache invalidates after 7) + - cron: '0 7 * * 1' # every monday -name: R-CMD-check +name: Package checks jobs: - - rversions: - name: R Versions - runs-on: ubuntu-latest - outputs: - devel: ${{ steps.devel.outputs.installed-r-version }} - release: ${{ steps.release.outputs.installed-r-version }} - oldrel1: ${{ steps.oldrel1.outputs.installed-r-version }} - oldrel2: ${{ steps.oldrel2.outputs.installed-r-version }} - oldrel3: ${{ steps.oldrel3.outputs.installed-r-version }} - oldrel4: ${{ steps.oldrel4.outputs.installed-r-version }} - steps: - - { name: devel, uses: r-lib/actions/setup-r@master, id: devel, with: { r-version: devel, install-r: false }} - - { name: release, uses: r-lib/actions/setup-r@master, id: release, with: { r-version: release, install-r: false }} - - { name: oldrel/1, uses: r-lib/actions/setup-r@master, id: oldrel1, with: { r-version: oldrel/1, install-r: false }} - - { name: oldrel/2, uses: r-lib/actions/setup-r@master, id: oldrel2, with: { r-version: oldrel/2, install-r: false }} - - { name: oldrel/3, uses: r-lib/actions/setup-r@master, id: oldrel3, with: { r-version: oldrel/3, install-r: false }} - - { name: oldrel/4, uses: r-lib/actions/setup-r@master, id: oldrel4, with: { r-version: oldrel/4, install-r: false }} - + website: + uses: rstudio/shinycoreci/.github/workflows/call-website.yaml@v1 + routine: + uses: rstudio/shinycoreci/.github/workflows/call-routine.yaml@v1 R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - needs: - - rversions - strategy: - fail-fast: false - matrix: - config: - - {os: macOS-latest, r: '${{ needs.rversions.outputs.release }}'} - - {os: windows-latest, r: '${{ needs.rversions.outputs.release }}'} - - {os: windows-latest, r: '3.6'} - - - {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.devel }}', http-user-agent: "release" } - - {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.release }}'} - - {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel1 }}'} - - {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel2 }}'} - - {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel3 }}'} - - {os: ubuntu-20.04, r: '${{ needs.rversions.outputs.oldrel4 }}'} - - # Deliberately check on older ubuntu to maximise backward compatibility - - {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.devel }}', http-user-agent: "release" } - - {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.release }}'} - - {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel1 }}'} - - {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel2 }}'} - - {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel3 }}'} - - {os: ubuntu-18.04, r: '${{ needs.rversions.outputs.oldrel4 }}'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v2 - - - name: Install Node.js - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - - uses: r-lib/actions/setup-r@v1 - id: install-r - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - - - uses: r-lib/actions/setup-pandoc@v1 - - - uses: r-lib/actions/setup-r-dependencies@v1 - with: - extra-packages: rcmdcheck - cache-version: 1 - - # Install Cairo system dependencies - # used for svg testing - - name: Mac systemdeps - if: runner.os == 'macOS' - run: | - brew install --cask xquartz - brew install cairo - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_: false - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results - path: check + uses: rstudio/shinycoreci/.github/workflows/call-R-CMD-check.yaml@v1 diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index ea14c01f3..1c673ac4b 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -3,7 +3,8 @@ name: Docker on: push: branches: - - "master" + - "main" + - "rc-v**" - "docker**" schedule: - cron: '0 0 1 * *' # first of every month @@ -36,11 +37,11 @@ jobs: - name: GitHub # 'next' tag signifies the _next_ release tags: "next" - ref: "master" + ref: "main" steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 # https://github.com/marketplace/actions/publish-docker - name: rstudio/plumber diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml deleted file mode 100644 index cd3567651..000000000 --- a/.github/workflows/pkgdown.yaml +++ /dev/null @@ -1,85 +0,0 @@ -on: - push: - branches: - - master - - rc-** - pull_request: - branches: master - -name: pkgdown - -jobs: - pkgdown: - runs-on: ${{ matrix.config.os }} - strategy: - fail-fast: false - matrix: - config: - - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - env: - RSPM: ${{ matrix.config.rspm }} - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@master - id: install-r - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@master - - - name: Install pak and query dependencies - shell: Rscript {0} - run: | - install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - saveRDS(pak::pkg_deps_tree("local::.", dependencies = TRUE), ".github/r-depends.rds") - - name: Cache R packages - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-pkgdown-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: | - ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-pkgdown- - ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - shell: Rscript {0} - run: | - pak::local_system_requirements(execute = TRUE) - pak::pkg_system_requirements("pkgdown", execute = TRUE) - - - name: Install dependencies - shell: Rscript {0} - run: | - pak::local_install_dev_deps(upgrade = TRUE) - pak::pkg_install("pkgdown") - - - name: Install package - run: R CMD INSTALL . - - - name: Build Site (PR) - if: github.event_name != 'push' - shell: Rscript {0} - run: | - pkgdown::build_site(new_process = FALSE) - # Must validate after. Otherwise files are saved and `pkgdown::build_site()` gets mad - - name: Validate all topics exist (PR) - if: github.event_name != 'push' - shell: Rscript {0} - run: | - pkgdown::build_reference_index() - stopifnot(length(warnings()) == 0) - - - name: Git Config - if: github.event_name == 'push' - run: | - git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \ - git config --local user.name "${GITHUB_ACTOR}" - - - name: Build and Deploy Site - if: github.event_name == 'push' - shell: Rscript {0} - run: | - pkgdown::deploy_to_branch(new_process = FALSE) diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml deleted file mode 100644 index 08ec01dca..000000000 --- a/.github/workflows/pr-commands.yaml +++ /dev/null @@ -1,57 +0,0 @@ -on: - issue_comment: - types: [created] -name: Commands -jobs: - # added so that the workflow doesn't fail. - always_runner: - runs-on: ubuntu-latest - steps: - - name: Always run - run: echo "This job is used to prevent the workflow status from showing as failed when all other jobs are skipped" - document: - if: startsWith(github.event.comment.body, '/document') - name: document - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - uses: r-lib/actions/pr-fetch@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: r-lib/actions/setup-r@master - - name: Install dependencies - run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)' - - name: Document - run: Rscript -e 'roxygen2::roxygenise()' - - name: commit - run: | - git add man/\* NAMESPACE - git commit -m 'Document' - - uses: r-lib/actions/pr-push@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - # style: - # if: startsWith(github.event.comment.body, '/style') - # name: style - # runs-on: macOS-latest - # env: - # GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - # steps: - # - uses: actions/checkout@v2 - # - uses: r-lib/actions/pr-fetch@master - # with: - # repo-token: ${{ secrets.GITHUB_TOKEN }} - # - uses: r-lib/actions/setup-r@master - # - name: Install dependencies - # run: Rscript -e 'install.packages("styler")' - # - name: Style - # run: Rscript -e 'styler::style_pkg()' - # - name: commit - # run: | - # git add \*.R - # git commit -m 'Style' - # - uses: r-lib/actions/pr-push@master - # with: - # repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index 9dbaa27c7..000000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,61 +0,0 @@ -on: - push: - branches: - - master - pull_request: - branches: - - master - -name: test-coverage - -jobs: - test-coverage: - runs-on: ${{ matrix.config.os }} - strategy: - fail-fast: false - matrix: - config: - - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - env: - RSPM: ${{ matrix.config.rspm }} - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@master - id: install-r - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@master - - - name: Install pak and query dependencies - shell: Rscript {0} - run: | - install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - saveRDS(pak::pkg_deps_tree("local::.", dependencies = TRUE), ".github/r-depends.rds") - - name: Cache R packages - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-testing-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: | - ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-testing- - ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - shell: Rscript {0} - run: | - pak::local_system_requirements(execute = TRUE) - pak::pkg_system_requirements("pkgdown", execute = TRUE) - - - name: Install dependencies - shell: Rscript {0} - run: | - pak::local_install_dev_deps(upgrade = TRUE) - pak::pkg_install("covr") - - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index b7223dcc3..87a686bc4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,6 @@ Imports: lifecycle (>= 0.2.0), ellipsis (>= 0.3.0), rlang -LazyData: TRUE ByteCompile: TRUE Suggests: testthat (>= 0.11.0), @@ -52,7 +51,7 @@ Suggests: mockery (>= 0.4.2), geojsonsf, sf -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2 Collate: 'async.R' 'content-types.R' @@ -93,3 +92,4 @@ Collate: 'zzz.R' RdMacros: lifecycle Language: en-US +Config/Needs/install: Cairo diff --git a/Dockerfile b/Dockerfile index 8fa4f85d7..572068ec8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN install2.r remotes ## https://stackoverflow.com/a/55621942/591574 #ADD https://github.com/rstudio/plumber/commits/ _docker_cache -ARG PLUMBER_REF=master +ARG PLUMBER_REF=main RUN Rscript -e "remotes::install_github('rstudio/plumber@${PLUMBER_REF}')" EXPOSE 8000 diff --git a/README.md b/README.md index e60ddc3b4..9d0c29f77 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![R build status](https://github.com/rstudio/plumber/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/plumber/actions) [![](https://www.r-pkg.org/badges/version/plumber)](https://www.r-pkg.org/pkg/plumber) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/plumber?color=brightgreen)](https://www.r-pkg.org/pkg/plumber) -[![codecov](https://codecov.io/gh/rstudio/plumber/branch/master/graph/badge.svg)](https://codecov.io/gh/rstudio/plumber) +[![codecov](https://codecov.io/gh/rstudio/plumber/branch/main/graph/badge.svg)](https://codecov.io/gh/rstudio/plumber) [![RStudio community](https://img.shields.io/badge/community-plumber-blue?style=social&logo=rstudio&logoColor=75AADB)](https://community.rstudio.com/tag/plumber) @@ -97,7 +97,7 @@ library(plumber) ## Cheat Sheet - + ## Hosting diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..04c558599 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true diff --git a/man/register_parser.Rd b/man/register_parser.Rd index 0d92137d7..e8965f796 100644 --- a/man/register_parser.Rd +++ b/man/register_parser.Rd @@ -38,7 +38,7 @@ Functions signature should include \code{value}, \code{...} and possibly \code{content_type}, \code{filename}. Other parameters may be provided if you want to use the headers from \code{\link[webutils:parse_multipart]{webutils::parse_multipart()}}. -Parser function structure is something like below.\if{html}{\out{