From 20c7d9f63f8759e9d717475d92686f21d83602f2 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 26 Mar 2021 12:12:15 -0400 Subject: [PATCH] v1.1.0 (#752) --- .github/workflows/R-CMD-check.yaml | 15 ++- .github/workflows/pkgdown.yaml | 4 +- DESCRIPTION | 4 +- NEWS.md | 26 +++--- R/openapi-spec.R | 2 +- R/options_plumber.R | 3 +- R/plumber-step.R | 2 +- R/plumber.R | 6 +- R/ui.R | 4 +- README.md | 10 +- cran-comments.md | 74 +++++---------- inst/WORDLIST | 142 +++++++++++++++++++++++++++++ man/Plumber.Rd | 6 +- man/PlumberEndpoint.Rd | 2 +- man/options_plumber.Rd | 3 +- revdep/README.md | 40 ++++---- revdep/cran.md | 2 +- revdep/problems.md | 81 ++++++++++++++-- revdep/revdep_cran.md | 2 +- tests/spelling.R | 3 + tests/testthat/files/endpoints.R | 2 +- tests/testthat/test-plumber.R | 3 + vignettes/annotations.Rmd | 6 +- vignettes/hosting.Rmd | 2 +- vignettes/security.Rmd | 2 +- 25 files changed, 329 insertions(+), 117 deletions(-) create mode 100644 inst/WORDLIST create mode 100644 tests/spelling.R diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 967314ffe..adaa2b81f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -42,6 +42,7 @@ jobs: env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + _R_CHECK_FORCE_SUGGESTS_: false RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -69,8 +70,8 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} - key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- + key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-2-${{ hashFiles('.github/r-depends.rds') }} + restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-2- - name: Install system dependencies if: runner.os == 'Linux' @@ -91,6 +92,16 @@ jobs: shell: Rscript {0} run: | install.packages("Rcpp", type = "source") + - name: Ubuntu 16 xml2 + if: matrix.config.os == 'ubuntu-16.04' + shell: Rscript {0} + run: | + pak::pkg_system_requirements("withr", execute = TRUE) + pak::pkg_install("withr") + pak::pkg_system_requirements("xml2", execute = TRUE) + # https://github.com/r-lib/xml2/issues/294 + # always install for now + withr::with_makevars(c(CXX = "g++ -std=c++11"), install.packages("xml2", verbose = TRUE)) - name: Install dependencies shell: Rscript {0} diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 9abd08b53..cd3567651 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,6 +1,8 @@ on: push: - branches: master + branches: + - master + - rc-** pull_request: branches: master diff --git a/DESCRIPTION b/DESCRIPTION index 12eb50101..6f41fd2a6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Encoding: UTF-8 Package: plumber Type: Package Title: An API Generator for R -Version: 1.0.0.90002 +Version: 1.1.0 Roxygen: list(markdown = TRUE) Authors@R: c( person("Barret", "Schloerke", role = c("cre", "aut"), email = "barret@rstudio.com"), @@ -48,6 +48,7 @@ Suggests: feather, future, rstudioapi, + spelling, mockery (>= 0.4.2) RoxygenNote: 7.1.1 Collate: @@ -89,3 +90,4 @@ Collate: 'validate_api_spec.R' 'zzz.R' RdMacros: lifecycle +Language: en-US diff --git a/NEWS.md b/NEWS.md index f04c937c6..52c6d0db4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -plumber 1.0.0.9999 Development version +plumber 1.1.0 -------------------------------------------------------------------------------- ### Breaking changes @@ -13,17 +13,15 @@ plumber 1.0.0.9999 Development version * Added option `plumber.trailingSlash`. This option (which is **disabled** by default) allows routes to be redirected to route definitions with a trailing slash. For example, if a `GET` request is submitted to `/test?a=1` with no `/test` route is defined, but a `GET` `/test/` route definition does exist, then the original request will respond with a `307` to reattempt against `GET` `/test/?a=1`. This option will be _enabled_ by default in a future release. This logic executed for before calling the `404` handler. (#746) -* Added option `plumber.methodNotFound`. This option (which is enabled by default) allows for a status of `405` to be returned if an invalid method is used when requesting a valid route. This logic executed for before calling the default `404` handler. (#746) - -* Guess OpenApi response content type from serializer. (@meztez #684) +* Added an experimental option `plumber.methodNotAllowed`. This option (which is enabled by default) allows for a status of `405` to be returned if an invalid method is used when requesting a valid route. This logic executed for before calling the default `404` handler. (#746) * Passing `edit = TRUE` to `plumb_api()` will open the API source file. (#699) -* Allow for spaces in `@apiTag` and `@tag` when tag is surrended by single or double quotes. (#685) - * OpenAPI Specification can be set using a file path. (@meztez #696) -* Un-deprecated `Plumber$run(debug=, swaggerCallback=)` and added the parameters for `Plumber$run(docs=, quiet=)` and `pr_run(debug=, docs=, swaggerCallback=, quiet=)`. Now, all four parameters will not produce lingering effects on the `Plumber` router. (@jcheng5 #765) +* Guess OpenAPI response content type from serializer. (@meztez #684) + +* Undeprecated `Plumber$run(debug=, swaggerCallback=)` and added the parameters for `Plumber$run(docs=, quiet=)` and `pr_run(debug=, docs=, swaggerCallback=, quiet=)`. Now, all four parameters will not produce lingering effects on the `Plumber` router. (@jcheng5 #765) * Setting `quiet = TRUE` will suppress routine startup messages. * Setting `debug = TRUE`, will display information when an error occurs. See `pr_set_debug()`. * Setting `docs` will update the visual documentation. See `pr_set_docs()`. @@ -33,19 +31,21 @@ plumber 1.0.0.9999 Development version * `PlumberStep` (and `PlumberEndpoint` and `PlumberFilter`) received a new field `$srcref` and method `$getFunc()`. `$srcref` will contain the corresponding `srcref` information from original source file. `$getFunc()` will return the evaluated function. (#782) +* Allow for spaces in `@apiTag` and `@tag` when tag is surrounded by single or double quotes. (#685) + ### Bug fixes -* Fixed bug where `httpuv` would return a status of `500` with body `An exception occurred` if no headers were set on the response object. (#745) +* Ignore regular comments in block parsing. (@meztez #718) -* Fixed bug where all `pr_*()` returned invisibly. Now all `pr_*()` methods will print the router if displayed in the console. (#740) +* Block parsing comments, tags and responses ordering match plumber api ordering. (#722) -* Ignore regular comments in block parsing (@meztez #718) +* Fixed bug where `httpuv` would return a status of `500` with body `An exception occurred` if no headers were set on the response object. (#745) -* Block parsing comments, tags and responses ordering match plumber api ordering. (#722) +* Fixed bug where all `pr_*()` returned invisibly. Now all `pr_*()` methods will print the router if displayed in the console. (#740) * When calling `Plumber$handle()` and defining a new `PlumberEndpoint`, `...` will be checked for invalid names. (@meztez, #677) -* `/__swagger__/` now always redirect to `/__docs__/`, even when Swagger isn't the selected interface. Use `options(plumber.legacyRedirects = FALSE)` to disable this behavior. (@blairj09 #694) +* `/__swagger__/` now always redirects to `/__docs__/`, even when Swagger isn't the selected interface. Use `options(plumber.legacyRedirects = FALSE)` to disable this behavior. (@blairj09 #694) * Fixed `available_apis()` bug where all packages printed all available APIs. (@meztez #708) @@ -428,7 +428,7 @@ plumber 0.2.2 plumber 0.2.1 -------------------------------------------------------------------------------- -* Add more Roxygen documentation for exported functions +* Add more `roxygen2` documentation for exported functions * Remove the warning in the README as the API seems to be stabilizing. diff --git a/R/openapi-spec.R b/R/openapi-spec.R index 7dce8466f..20f210d37 100644 --- a/R/openapi-spec.R +++ b/R/openapi-spec.R @@ -291,7 +291,7 @@ getArgsMetadata <- function(endpoint_func) { error = function(cond) {NA}) } # Check that it is possible to transform arg value into - # an example for the openAPI spec. Valid transform are + # an example for the OpenAPI spec. Valid transform are # either a logical, a numeric, a character or a list that # is json serializable. Otherwise set to NA. if (!is.logical(arg) && !is.numeric(arg) && !is.character(arg) diff --git a/R/options_plumber.R b/R/options_plumber.R index a08b5f396..94f4ff5a4 100644 --- a/R/options_plumber.R +++ b/R/options_plumber.R @@ -15,7 +15,8 @@ #' that has a matching route with a trailing slash. For example, if set to `TRUE` and the #' GET route `/test/` existed, then a GET request of `/test?a=1` would redirect to #' `/test/?a=1`. Defaults to `FALSE`. This option will default to `TRUE` in a future release.} -#' \item{`plumber.methodNotAllowed`}{Logical value which allows the router to notify that an +#' \item{`plumber.methodNotAllowed`}{`r lifecycle::badge("experimental")` +#' Logical value which allows the router to notify that an #' unavailable method was requested, but a different request method is allowed. For example, #' if set to `TRUE` and the GET route `/test` existed, then a POST request of `/test` would #' receive a 405 status and the allowed methods. Defaults to `TRUE`.} diff --git a/R/plumber-step.R b/R/plumber-step.R index bf442523c..a94fa8319 100644 --- a/R/plumber-step.R +++ b/R/plumber-step.R @@ -166,7 +166,7 @@ getRelevantArgs <- function(args, func) { #' Plumber Endpoint #' -#' Defines a terminal handler in a PLumber router. +#' Defines a terminal handler in a Plumber router. #' #' @export PlumberEndpoint <- R6Class( diff --git a/R/plumber.R b/R/plumber.R index d4dfebd3a..03cefd730 100644 --- a/R/plumber.R +++ b/R/plumber.R @@ -1017,7 +1017,7 @@ Plumber <- R6Class( } private$api_spec_handler <- api_fun }, - #' @description Retrieve openAPI file + #' @description Retrieve OpenAPI file getApiSpec = function() { #FIXME: test routerSpec <- private$routerSpecificationInternal(self) @@ -1093,12 +1093,12 @@ Plumber <- R6Class( warning("addGlobalProcessor has been deprecated in v0.4.0 and will be removed in a coming release. Please use `registerHook`(s) instead.") self$registerHooks(proc) }, - #' @description Deprecated. Retrieve openAPI file + #' @description Deprecated. Retrieve OpenAPI file openAPIFile = function() { warning("`$openAPIFile()` has been deprecated in v1.0.0 and will be removed in a coming release. Please use `$getApiSpec()`.") self$getApiSpec() }, - #' @description Deprecated. Retrieve openAPI file + #' @description Deprecated. Retrieve OpenAPI file swaggerFile = function() { warning("`$swaggerFile()` has been deprecated in v1.0.0 and will be removed in a coming release. Please use `$getApiSpec()`.") self$getApiSpec() diff --git a/R/ui.R b/R/ui.R index b4c779d6b..f6bcf11ee 100644 --- a/R/ui.R +++ b/R/ui.R @@ -21,7 +21,7 @@ mount_docs <- function(pr, host, port, docs_info, callback, quiet = FALSE) { ) ) - # Mount openAPI spec paths openapi.json + # Mount OpenAPI spec paths openapi.json mount_openapi(pr, api_url) # Mount Docs @@ -71,7 +71,7 @@ unmount_docs <- function(pr, docs_info) { return() } - # Unount openAPI spec paths openapi.json + # Unount OpenAPI spec paths openapi.json unmount_openapi(pr) # Mount Docs diff --git a/README.md b/README.md index b4b120cfb..e60ddc3b4 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ [![](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) -[![RStudio community](https://img.shields.io/badge/community-plumber-blue?style=social&logo=rstudio&logoColor=75AADB)](https://community.rstudio.com/tags/plumber) +[![RStudio community](https://img.shields.io/badge/community-plumber-blue?style=social&logo=rstudio&logoColor=75AADB)](https://community.rstudio.com/tag/plumber) Plumber allows you to create a web API by merely decorating your existing R -source code with special comments. Take a look at an example. +source code with `roxygen2`-like comments. Take a look at an example. ```r # plumber.R @@ -40,7 +40,7 @@ function(a, b) { These comments allow `plumber` to make your R functions available as API endpoints. You can use either `#*` as the prefix or `#'`, but we recommend the -former since `#'` will collide with Roxygen. +former since `#'` will collide with `roxygen2`. ```r library(plumber) @@ -95,9 +95,9 @@ remotes::install_github("rstudio/plumber") library(plumber) ``` -## Cheatsheet +## Cheat Sheet - + ## Hosting diff --git a/cran-comments.md b/cran-comments.md index 1521fdd6b..b3bf50434 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,87 +1,63 @@ ## Comments -#### 2020-9-14 +#### 2020-3-23 -I've fixed the urls and resubmitting. +Bug fixes and new features. -Best, -Barret +CRAN checks: +* I have disabled the brittle test that is currently failing on https://www.r-project.org/nosvn/R.check/r-devel-windows-x86_64-gcc10-UCRT/plumber-00check.html . Checking this test on windows GHA only. +* I can not see why this installation is failing: https://www.r-project.org/nosvn/R.check/r-release-windows-ix86+x86_64/plumber-00check.html -#### 2020-9-14 +Please let me know if there is anything else I can provide. -Flavor: r-devel-linux-x86_64-debian-gcc -Check: CRAN incoming feasibility, Result: NOTE - Maintainer: 'Barret Schloerke ' +Thank you, +Barret - New maintainer: - Barret Schloerke - Old maintainer(s): - Jeff Allen - Found the following (possibly) invalid URLs: - URL: https://rstudio.github.io/plumber (moved to https://www.rplumber.io/) - From: README.md - Status: 200 - Message: OK - URL: https://www.rstudio.com/products/connect/ (moved to https://rstudio.com/products/connect/) - From: README.md - Status: 200 - Message: OK +#### 2020-1-5 -#### 2020-9-14 +These checks have naturally resolved. -This is a major version update. +- Barret -Please let me know if there is anything else I can provide. -Thank you, -Barret +#### 2020-12-13 -#### 2020-9-14 +Dear maintainer, -Confirmed! You may change the maintainer. +Please see the problems shown on +. -- Jeff +Please correct before 2021-01-08 to safely retain your package on CRAN. -#### 2020-9-14 - -Hi Jeff, +Best, +-k -I'm emailing to have a formal request to change the maintainer in `plumber` to Barret Schloerke... -My I change `plumber`'s maintainer to Barret Schloerke? - -Thank you, -Barret ## Test environments -* local macOS, R 4.0.0 +* local macOS, R 4.0.2 * GitHub Actions * macOS * oldrel, release, devel * windows - * oldrel, release, devel + * release, devel * ubuntu18 * 3.4, 3.5, oldrel, release, devel * ubuntu16 * 3.4, 3.5, oldrel, release, devel +* devtools:: + * check_win_devel() + * check_win_release() + * check_win_oldrelease() 0 errors ✔ | 0 warnings ✔ | 0 notes ✔ -* devtools::build_win() - * checking CRAN incoming feasibility ... NOTE - Maintainer: 'Barret Schloerke ' - - New maintainer: - Barret Schloerke - Old maintainer(s): - Jeff Allen -Status: 1 NOTE ## revdepcheck results -We checked 8 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 13 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 000000000..5ec786eac --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,142 @@ +API's +Api +BMP +BUGFIX +CLI +CORS +CentOS +Crypto +DDoS +DNS +Deprecations +DigitalOcean +DoS +Dockerfile +Dockerfiles +DuckDuckGo +GlobalEnv +HAProxy +HSTS +HTTPOnly +HTTPS +Hookable +IPs +IPv +JSON +MacOS +Mailgun +Nginx +OpenAPI +OpenCPU +Packrat +Parsers +Phusion +PlumberEndpoint's +Quickstart +README +RedHat +RedShift +Rscript +SSL +SameSite +Sanitization +Serializer +Serializers +TLS +TSV +UI +URI +Unencrypted +Unmount +WebSocket +Webhook +Webhooks +XSS +YAML +addAssets +addEndpoint +api +apis +autogenerated +balancer +cloneable +codecov +config +contentType +crypto +cryptographically +css +decrypt +decrypted +df +dir +dockercloud +entrypoint +expr +filesystem +ggplot +globalProcessor +haproxy +htmlwidget +http +httpuv +httr +imposter +integrations +interpretable +javascript +js +js's +json +kB +keyring +lexicographically +libsodium +lifecycle +magrittr's +mailgun +multiprocess +natively +nginx +npm +onHeaders +onWSOpen +param +params +parsers +performant +postBody +postserialize +pre +proc +programmatically +pseudorandom +pwd +randomPort +renderers +repo +req +retransmitted +rstudio +runnable +scalability +scalable +serializer +serializers +setCookie +setosa +ssl +subfolder +subrouters +systemd +transactional +unmount +unparsed +unsecure +untrusted +validator +webhook +webhook’s + +ing +Undeprecated diff --git a/man/Plumber.Rd b/man/Plumber.Rd index f1a1bf705..26f9c9c36 100644 --- a/man/Plumber.Rd +++ b/man/Plumber.Rd @@ -863,7 +863,7 @@ The value returned will not be validated for OAS compatibility.} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-getApiSpec}{}}} \subsection{Method \code{getApiSpec()}}{ -Retrieve openAPI file +Retrieve OpenAPI file \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Plumber$getApiSpec()}\if{html}{\out{
}} } @@ -974,7 +974,7 @@ addAssets has been deprecated in v0.4.0 and will be removed in a coming release. \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-openAPIFile}{}}} \subsection{Method \code{openAPIFile()}}{ -Deprecated. Retrieve openAPI file +Deprecated. Retrieve OpenAPI file \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Plumber$openAPIFile()}\if{html}{\out{
}} } @@ -984,7 +984,7 @@ Deprecated. Retrieve openAPI file \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-swaggerFile}{}}} \subsection{Method \code{swaggerFile()}}{ -Deprecated. Retrieve openAPI file +Deprecated. Retrieve OpenAPI file \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Plumber$swaggerFile()}\if{html}{\out{
}} } diff --git a/man/PlumberEndpoint.Rd b/man/PlumberEndpoint.Rd index 0bbaeda4f..0aa9a3b22 100644 --- a/man/PlumberEndpoint.Rd +++ b/man/PlumberEndpoint.Rd @@ -9,7 +9,7 @@ Plumber Endpoint Plumber Endpoint } \details{ -Defines a terminal handler in a PLumber router. +Defines a terminal handler in a Plumber router. Parameters values are obtained from parsing blocks of lines in a plumber file. They can also be provided manually for historical reasons. diff --git a/man/options_plumber.Rd b/man/options_plumber.Rd index 756b071f2..ef2b717fb 100644 --- a/man/options_plumber.Rd +++ b/man/options_plumber.Rd @@ -48,7 +48,8 @@ by RStudio to open the docs when then API is ran from the editor. Defaults to op that has a matching route with a trailing slash. For example, if set to \code{TRUE} and the GET route \verb{/test/} existed, then a GET request of \verb{/test?a=1} would redirect to \verb{/test/?a=1}. Defaults to \code{FALSE}. This option will default to \code{TRUE} in a future release.} -\item{\code{plumber.methodNotAllowed}}{Logical value which allows the router to notify that an +\item{\code{plumber.methodNotAllowed}}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}} +Logical value which allows the router to notify that an unavailable method was requested, but a different request method is allowed. For example, if set to \code{TRUE} and the GET route \verb{/test} existed, then a POST request of \verb{/test} would receive a 405 status and the allowed methods. Defaults to \code{TRUE}.} diff --git a/revdep/README.md b/revdep/README.md index c3e7f2366..03c42f711 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -2,35 +2,39 @@ |field |value | |:--------|:----------------------------| -|version |R version 4.0.0 (2020-04-24) | -|os |macOS Catalina 10.15.6 | +|version |R version 4.0.2 (2020-06-22) | +|os |macOS 10.16 | |system |x86_64, darwin17.0 | |ui |X11 | |language |(EN) | |collate |en_US.UTF-8 | |ctype |en_US.UTF-8 | |tz |America/New_York | -|date |2020-09-14 | +|date |2021-03-23 | # Dependencies -|package |old |new |Δ | -|:-------|:-----|:----------|:--| -|plumber |0.4.6 |0.9.9.9000 |* | +|package |old |new |Δ | +|:-------|:-----|:-----|:--| +|plumber |1.0.0 |1.1.0 |* | # Revdeps -## All (9) +## All (13) -|package |version |error |warning |note | -|:----------------------------------------------|:-------|:-----|:-------|:----| -|arenar |0.1.8 | | | | -|[AzureContainers](problems.md#azurecontainers) |1.3.0 | | |1 | -|bayesAB |1.1.2 | | | | -|googleCloudRunner |0.3.0 | | | | -|gqlr |0.0.2 | | | | -|[openmetrics](problems.md#openmetrics) |0.2.0 | | |1 | -|[rjsonapi](problems.md#rjsonapi) |0.1.0 | | |1 | -|rsconnect |0.8.16 | | | | -|swagger |3.33.0 | | | | +|package |version |error |warning |note | +|:----------------------------------------------|:--------|:-----|:-------|:----| +|arenar |0.2.0 | | | | +|[AzureContainers](problems.md#azurecontainers) |1.3.1 | | |1 | +|bayesAB |1.1.2 | | | | +|googleCloudRunner |0.4.1 | | | | +|gqlr |0.0.2 | | | | +|[log](problems.md#log) |1.1.0 | | |1 | +|[microservices](problems.md#microservices) |0.1.0 | | |1 | +|[openmetrics](problems.md#openmetrics) |0.3.0 | | |1 | +|[rapidoc](problems.md#rapidoc) |8.4.3 | | |1 | +|redoc |2.0.0.49 | | | | +|[rjsonapi](problems.md#rjsonapi) |0.1.0 | | |1 | +|rsconnect |0.8.16 | | | | +|swagger |3.33.1 | | | | diff --git a/revdep/cran.md b/revdep/cran.md index 7ac41de33..c08b35369 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 9 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 13 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/revdep/problems.md b/revdep/problems.md index 3f1dd2f47..c5011f233 100644 --- a/revdep/problems.md +++ b/revdep/problems.md @@ -2,11 +2,11 @@
-* Version: 1.3.0 +* Version: 1.3.1 * GitHub: https://github.com/Azure/AzureContainers * Source code: https://github.com/cran/AzureContainers -* Date/Publication: 2020-05-06 08:10:02 UTC -* Number of recursive dependencies: 57 +* Date/Publication: 2020-10-14 23:40:17 UTC +* Number of recursive dependencies: 74 Run `revdep_details(, "AzureContainers")` for more info @@ -20,15 +20,60 @@ Run `revdep_details(, "AzureContainers")` for more info All declared Imports should be used. ``` +# log + +
+ +* Version: 1.1.0 +* GitHub: NA +* Source code: https://github.com/cran/log +* Date/Publication: 2021-01-14 09:10:02 UTC +* Number of recursive dependencies: 67 + +Run `revdep_details(, "log")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘R6’ + All declared Imports should be used. + ``` + +# microservices + +
+ +* Version: 0.1.0 +* GitHub: https://github.com/tidylab/microservices +* Source code: https://github.com/cran/microservices +* Date/Publication: 2021-03-03 09:20:20 UTC +* Number of recursive dependencies: 68 + +Run `revdep_details(, "microservices")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespaces in Imports field not imported from: + ‘config’ ‘desc’ ‘dplyr’ ‘glue’ ‘withr’ + All declared Imports should be used. + ``` + # openmetrics
-* Version: 0.2.0 +* Version: 0.3.0 * GitHub: https://github.com/atheriel/openmetrics * Source code: https://github.com/cran/openmetrics -* Date/Publication: 2020-07-14 08:00:03 UTC -* Number of recursive dependencies: 45 +* Date/Publication: 2020-11-09 21:20:02 UTC +* Number of recursive dependencies: 63 Run `revdep_details(, "openmetrics")` for more info @@ -42,6 +87,28 @@ Run `revdep_details(, "openmetrics")` for more info All declared Imports should be used. ``` +# rapidoc + +
+ +* Version: 8.4.3 +* GitHub: https://github.com/meztez/rapidoc +* Source code: https://github.com/cran/rapidoc +* Date/Publication: 2021-02-05 10:30:05 UTC +* Number of recursive dependencies: 19 + +Run `revdep_details(, "rapidoc")` for more info + +
+ +## In both + +* checking dependencies in R code ... NOTE + ``` + Namespace in Imports field not imported from: ‘jsonlite’ + All declared Imports should be used. + ``` + # rjsonapi
@@ -50,7 +117,7 @@ Run `revdep_details(, "openmetrics")` for more info * GitHub: https://github.com/ropensci/rjsonapi * Source code: https://github.com/cran/rjsonapi * Date/Publication: 2017-01-09 01:47:26 -* Number of recursive dependencies: 46 +* Number of recursive dependencies: 58 Run `revdep_details(, "rjsonapi")` for more info diff --git a/revdep/revdep_cran.md b/revdep/revdep_cran.md index 197327e39..613992c71 100644 --- a/revdep/revdep_cran.md +++ b/revdep/revdep_cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 8 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 10 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/tests/spelling.R b/tests/spelling.R new file mode 100644 index 000000000..6713838fc --- /dev/null +++ b/tests/spelling.R @@ -0,0 +1,3 @@ +if(requireNamespace('spelling', quietly = TRUE)) + spelling::spell_check_test(vignettes = TRUE, error = FALSE, + skip_on_cran = TRUE) diff --git a/tests/testthat/files/endpoints.R b/tests/testthat/files/endpoints.R index e96dbe0ef..f287feda6 100644 --- a/tests/testthat/files/endpoints.R +++ b/tests/testthat/files/endpoints.R @@ -9,7 +9,7 @@ function(req, res, forward){ #* @get /test #* @post /test #* @more stuff -#' @param req Roxygen params +#' @param req roxygen2 params #* hey foo <- function(a, b, ..., req, res, forward){ 5 diff --git a/tests/testthat/test-plumber.R b/tests/testthat/test-plumber.R index b141a531f..1f13008cd 100644 --- a/tests/testthat/test-plumber.R +++ b/tests/testthat/test-plumber.R @@ -63,6 +63,9 @@ test_that("plumb accepts a file", { test_that("plumb gives a good error when passing in a dir instead of a file", { + # brittle test. Fails on r-devel-windows-x86_64-gcc10-UCRT + skip_on_cran() + if (isWindows()) { # https://stat.ethz.ch/R-manual/R-devel/library/base/html/files.html # "However, directory names must not include a trailing backslash or slash on Windows" diff --git a/vignettes/annotations.Rmd b/vignettes/annotations.Rmd index 57604e493..5f437eaf1 100644 --- a/vignettes/annotations.Rmd +++ b/vignettes/annotations.Rmd @@ -13,7 +13,7 @@ source("_helpers.R") ## Annotations {#annotations} -Annotations are specially-structured comments used in your plumber file to create an API. A full annotation line starts with `#*` or `#'`, then the annotation keyword `@...`, any number of space characters followed by the content. It is recommended to use `#*` to differentiate them from `Roxygen2` annotations. +Annotations are specially-structured comments used in your plumber file to create an API. A full annotation line starts with `#*` or `#'`, then the annotation keyword `@...`, any number of space characters followed by the content. It is recommended to use `#*` to differentiate them from `roxygen2` annotations. ## Global annotations {#global-annotations} @@ -85,9 +85,9 @@ Types are used to define API inputs. You can use most of them in dynamic routes. Query parameters currently need to be explicitly converted as they are pushed as is (character) to block expression. Only dynamic route parameters are converted to specified `@param` type before being pushed to block expression. -Plumber parameter type to OpenAPI type refenrence. For programmatic use, pick the one with an asterisk. +Plumber parameter type to OpenAPI type reference. For programmatic use, pick the one with an asterisk. -Type | OpenApi | Availability +Type | OpenAPI | Availability ---------------- | ----------- | --------- `bool`, `boolean`*, `logical` | `boolean` | `query`, `path` `dbl`, `double`, `float`, `number`*, `numeric` | `number` `format:double` | `query`, `path` diff --git a/vignettes/hosting.Rmd b/vignettes/hosting.Rmd index e2da05271..a8bc167d1 100644 --- a/vignettes/hosting.Rmd +++ b/vignettes/hosting.Rmd @@ -267,7 +267,7 @@ We can use the [dockercloud/haproxy](https://github.com/docker/dockercloud-hapro The trick that allows this image to listen in to our scaling of `app1` is by passing in the docker socket as a shared volume. Note that this particular arrangement will differ based on your host OS. The above configuration is intended for Linux, but MacOS X users would require a [slightly different config](https://github.com/docker/dockercloud-haproxy#example-of-docker-composeyml-running-in-linux). -We could export port `80` of our new load balancer to port `80` of our host machine if we solely wanted to load-balance a single application. Alternatively, we can actually use both nginx (to handle the routing of various applications) and HAProxy (to handle the load balancing of a particular application). To do that, we'd merely add a new `location` block to our `nginx.conf` file that knows how to send traffic to HAproxy, or modify the existing `location` block to send traffic to the load balancer instead of going directly to the application. +We could export port `80` of our new load balancer to port `80` of our host machine if we solely wanted to load-balance a single application. Alternatively, we can actually use both nginx (to handle the routing of various applications) and HAProxy (to handle the load balancing of a particular application). To do that, we'd merely add a new `location` block to our `nginx.conf` file that knows how to send traffic to HAProxy, or modify the existing `location` block to send traffic to the load balancer instead of going directly to the application. So the `location /app1/` block becomes: diff --git a/vignettes/security.Rmd b/vignettes/security.Rmd index 0d8dc7af0..258724a42 100644 --- a/vignettes/security.Rmd +++ b/vignettes/security.Rmd @@ -138,7 +138,7 @@ In the [section on setting cookies](./rendering-output.html#setting-cookies), we First and foremost, recognize that that the client has the ability to modify or fabricate the cookies that they send to your API. So storing preferences that the user themselves provided in a cookie is not a concern. Storing something with security implications -- like the identity of the user making requests -- however, would be; a malicious user would just need to modify the user ID saved in their cookie in order to trick your API into thinking that they were someone they're not. -There are two common work-arounds to this concern. You can store all session information on the server identified by long, cryptographically random IDs and only rely on the cookie to store the ID. Or you can use signed/encrypted cookies, as detailed in the [section on setting encrypted cookies](./rendering-output.html#encrypted-cookies). +There are two common workarounds to this concern. You can store all session information on the server identified by long, cryptographically random IDs and only rely on the cookie to store the ID. Or you can use signed/encrypted cookies, as detailed in the [section on setting encrypted cookies](./rendering-output.html#encrypted-cookies). You should also be aware of how cookies will be handled and managed by clients. You can manage these properties by providing different parameters to the `setCookie()` call.