Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1.0 #752

Merged
merged 28 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
129f258
bump version to 1.1.0
schloerke Jan 5, 2021
6575f64
Merge branch 'master' into rc-v1.1.0
schloerke Jan 5, 2021
dfc6bf0
Spelling
schloerke Jan 5, 2021
0b51299
Fix community link
schloerke Jan 5, 2021
af149dc
Run revdep
schloerke Jan 5, 2021
cd59bf3
Do not force all suggested packages when checking
schloerke Jan 5, 2021
a134316
Reoragnize news order
schloerke Jan 5, 2021
90c685e
Build pkgdown on master and rc branches
schloerke Jan 5, 2021
07c6e0c
Update cran-comments.md
schloerke Jan 5, 2021
a702807
run revdep. added a new dep
schloerke Jan 18, 2021
7074be0
Use new brew install command
schloerke Jan 18, 2021
8362fc2
Merge branch 'master' into rc-v1.1.0
schloerke Mar 1, 2021
c6b30c4
Declare option("plumber.methodNotAllowed") to be experimental.
schloerke Mar 1, 2021
899a2d8
Try with rspm
schloerke Mar 1, 2021
ae8ad05
Install sodium from cran on ubuntu 16
schloerke Mar 1, 2021
f538787
actually use ubuntu 16
schloerke Mar 1, 2021
47af6cd
Fix spelling
schloerke Mar 1, 2021
ddf23c6
Try no rspm. But install xml2 from cran but also install deps from cran
schloerke Mar 1, 2021
ef437bf
Install with c++11 makevars
schloerke Mar 1, 2021
f10d4ee
Always install xml2 for now
schloerke Mar 2, 2021
e415759
Run revdepc
schloerke Mar 2, 2021
7b96482
Merge branch 'master' into rc-v1.1.0
schloerke Mar 22, 2021
c968416
Merge branch 'master' into rc-v1.1.0
schloerke Mar 23, 2021
6e9a4db
cheatsheet -> cheat sheet
schloerke Mar 23, 2021
58ae65e
Run revdep
schloerke Mar 23, 2021
17aa26d
disable test on cran that has different behavior given the platform
schloerke Mar 23, 2021
2dd67d2
Update cran-comments.md
schloerke Mar 23, 2021
674f8c0
Fix cheat sheet thumbnail
schloerke Mar 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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'
Expand All @@ -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}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
on:
push:
branches: master
branches:
- master
- rc-**
pull_request:
branches: master

Expand Down
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -48,6 +48,7 @@ Suggests:
feather,
future,
rstudioapi,
spelling,
mockery (>= 0.4.2)
RoxygenNote: 7.1.1
Collate:
Expand Down Expand Up @@ -89,3 +90,4 @@ Collate:
'validate_api_spec.R'
'zzz.R'
RdMacros: lifecycle
Language: en-US
26 changes: 13 additions & 13 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plumber 1.0.0.9999 Development version
plumber 1.1.0
--------------------------------------------------------------------------------

### Breaking changes
Expand All @@ -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()`.
Expand All @@ -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)

Expand Down Expand Up @@ -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.


Expand Down
2 changes: 1 addition & 1 deletion R/openapi-spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion R/options_plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -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`.}
Expand Down
2 changes: 1 addition & 1 deletion R/plumber-step.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions R/plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- badges: end -->

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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -95,9 +95,9 @@ remotes::install_github("rstudio/plumber")
library(plumber)
```

## Cheatsheet
## Cheat Sheet

<a href="https://github.com/rstudio/cheatsheets/blob/master/plumber.pdf"><img src="https://github.com/rstudio/cheatsheets/blob/master/pngs/thumbnails/plumber-cheatsheet-thumbs.png" width="630" height="252"/></a>
<a href="https://github.com/rstudio/cheatsheets/blob/master/plumber.pdf"><img src="https://raw.githubusercontent.com/rstudio/cheatsheets/master/pngs/thumbnails/plumber-cheatsheet-thumbs.png" width="630" height="252"/></a>

## Hosting

Expand Down
74 changes: 25 additions & 49 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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 <barret@rstudio.com>'
Thank you,
Barret

New maintainer:
Barret Schloerke <barret@rstudio.com>
Old maintainer(s):
Jeff Allen <cran@trestletech.com>

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
<https://cran.r-project.org/web/checks/check_results_plumber.html>.

- 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 <barret@rstudio.com>'

New maintainer:
Barret Schloerke <barret@rstudio.com>
Old maintainer(s):
Jeff Allen <cran@trestletech.com>
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
Loading