forked from rexyai/RestRserve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/rexyai/RestRserve into dev
- Loading branch information
Showing
53 changed files
with
597 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,6 @@ CONTRIBUTING.md | |
^\.travis\.yml$ | ||
^\.openapi\.yaml$ | ||
^pkgdown$ | ||
^\.dockerignore$ | ||
^\.appveyor.yml$ | ||
cran-comments.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
init: | ||
ps: | | ||
$ErrorActionPreference = "Stop" | ||
Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" | ||
Import-Module '..\appveyor-tool.ps1' | ||
install: | ||
- ps: Bootstrap | ||
cache: | ||
- C:\RLibrary | ||
environment: | ||
global: | ||
CRAN: http://cloud.r-project.org | ||
WARNINGS_ARE_ERRORS: 0 | ||
matrix: | ||
- R_VERSION: devel | ||
GCC_PATH: mingw_32 | ||
- R_VERSION: devel | ||
R_ARCH: x64 | ||
GCC_PATH: mingw_64 | ||
build_script: | ||
- travis-tool.sh install_deps | ||
test_script: | ||
- travis-tool.sh run_tests | ||
on_failure: | ||
- 7z a failure.zip *.Rcheck\* | ||
- appveyor PushArtifact failure.zip | ||
artifacts: | ||
- path: '*.Rcheck\**\*.log' | ||
name: Logs | ||
- path: '*.Rcheck\**\*.out' | ||
name: Logs | ||
- path: '*.Rcheck\**\*.fail' | ||
name: Logs | ||
- path: '*.Rcheck\**\*.Rout' | ||
name: Logs | ||
- path: '\*_*.tar.gz' | ||
name: Bits | ||
- path: '\*_*.zip' | ||
name: Bits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git | ||
.Rproj.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve RestRserve | ||
title: "[BUG] short bug description " | ||
labels: bug, not-confirmed | ||
assignees: '' | ||
|
||
--- | ||
|
||
### Reporting an Issue | ||
Make use of the *Preview* tab just above! | ||
|
||
### Before filing an issue | ||
Please ensure that you: | ||
- searched existing [GitHub issues](https://github.com/rexyai/RestRserve/issues) which can be searched among open and closed ones; | ||
- read the [Contributing](https://github.com/rexyai/RestRserve/blob/master/CONTRIBUTING.md) page for details on preferred reporting and style; | ||
|
||
### Describe the bug | ||
A clear and concise description of what the bug is. | ||
|
||
### To Reproduce | ||
Please provide a **minimal** example. 'minimal' generally means that example should not use any packages except `RestRserve`. If you are not sure what 'minimal reproducible example' is, please consult [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). **We appreciate your time to make a bug report.** | ||
|
||
For example: | ||
```r | ||
library("RestRserve") | ||
app = Application$new() | ||
app$add_post(path = "/bug", function(req, res) { | ||
res$set_body(req$body) | ||
}) | ||
app$logger$set_log_level("debug") | ||
request = Request$new( | ||
path = "/bug", | ||
method = "POST", | ||
body = '{"key":invalid_json}', | ||
content_type = "application/json" | ||
) | ||
|
||
response = app$process_request(request) | ||
cat(response$body) | ||
``` | ||
|
||
### Expected behavior | ||
A clear and concise description of what you expected to happen. | ||
|
||
### Environment information | ||
Please provide output of the `sessionInfo()` command. | ||
|
||
For example: | ||
``` | ||
R version 3.6.0 (2019-04-26) | ||
Platform: x86_64-apple-darwin15.6.0 (64-bit) | ||
Running under: macOS Mojave 10.14.6 | ||
Matrix products: default | ||
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib | ||
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib | ||
locale: | ||
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 | ||
attached base packages: | ||
[1] stats graphics grDevices utils datasets methods base | ||
other attached packages: | ||
[1] RestRserve_0.2.0 | ||
loaded via a namespace (and not attached): | ||
[1] compiler_3.6.0 backports_1.1.5 R6_2.4.1 tools_3.6.0 Rcpp_1.0.3 uuid_0.1-2 checkmate_1.9.4 jsonlite_1.6 mime_0.7 | ||
``` | ||
|
||
### Additional context | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,54 @@ | ||
# Project goals | ||
## Contributing to RestRserve | ||
|
||
- develop high-performance **http interface** which will allow to use R code as a **backend** for web-services | ||
- make creation and deployment of applications simple and robust | ||
- work nice with docker | ||
Interested in contributing? Great! We really welcome bug reports and pull requests that expand and improve the functionality of `RestRserve` from all contributors. | ||
|
||
# Development | ||
### Asking Questions | ||
|
||
### Design | ||
- [chat on gitter](https://gitter.im/RestRserve/community) | ||
- post a question on Stack Overflow using the [restrserve] tag | ||
|
||
- minimal number of dependencies | ||
- `Rserve` | ||
- `R6` (which has 0 zero dependencies) | ||
- `swagger` (swagger-ui assets) | ||
- `yaml` (used for OpenAPI and actually not absolutely necessary) | ||
### Bug reports | ||
|
||
### Programming style | ||
- make sure the issue is a bug report and **not** a question or feature request | ||
- one issue for one purpose. Don't report more than one bug or request several features in the same issue | ||
- feel free to add reactions to existing issues that are important to you. We monitor this and it helps us prioritize where to devote our efforts | ||
|
||
- we use ` = ` for assignement | ||
- for `R6` classes we use CamelCase | ||
- for the rest we use snake_case | ||
- we don't use `.` inside names | ||
- stick to base R style (except point above) | ||
- fail fast - catch errors at the early stages | ||
### Feedback | ||
|
||
Please share your feedback in [this github ticket](https://github.com/rexyai/RestRserve/issues/109) | ||
|
||
|
||
### Pull Requests (PRs) | ||
|
||
- If you are not fixing an open issue please consider to file a new issue before submitting the PR. So, It may save you time to create an issue first and start a discussion to see if your idea would be accepted in principle. If you are going to spend more than a day on the PR, creating an issue first lets other people know you are working on it to save duplicating effort. | ||
- The PR's status must be passing tests before we will start to look at it | ||
- every new feature or bug fix must have one or more new tests in `inst/tests/` | ||
- please create the PR against the `dev` branch | ||
- just one feature/bugfix per PR please. Small changes are easier to review and accept than big sweeping changes. Sometimes big sweeping changes are needed and we just have to discuss those case by case | ||
- github enables us to squash commits together when merging, so you don't have to squash yourself | ||
|
||
# Rserve resources | ||
## Feature requests | ||
|
||
[Rserve](https://github.com/s-u/Rserve/) is amazing software highly undervalued by the community. Here we keep links to useful resources about Rserve: | ||
Please don't put "feature request" items into GitHub Issues. If there's a new feature that you want to see added to RestRserve, you'll need to write the code yourself - or convince someone else to partner with you to write the code (we love feature submissions!). If you enter a wish list item in GitHub Issues with no code, you can expect it to be marked "invalid" as soon as it's reviewed. | ||
|
||
1. Official Rserve page on Rforge - [news section](http://rforge.net/Rserve/news.html) | ||
1. Description of the **configuration** on [github wiki](https://github.com/s-u/Rserve/wiki/rserve.conf) - **not complete**. For most detailed information it worths to check source code - [setConfig function](https://github.com/s-u/Rserve/blob/05ff32d3c4512954a99162d392d0465d432d591e/src/Rserv.c#L1094) in `Rserve.c` | ||
1. **http** interface: | ||
* **request** object format. Rserve passes 4 values (`url`, `query`, `body`, `headers`) to the R code. Parsing logic is described in [FastRWeb::.http.request](https://github.com/s-u/FastRWeb/blob/aaf8847f11903675b1ec7eb9c0e1cc98b92512e5/R/run.R#L58) and [RestRserve:::parse_request](https://github.com/rexyai/RestRserve/blob/4aecbfb18b8403908c727fa478d161247d591764/R/request.R#L4) functions | ||
* **response** object from R code defined in [http.c](https://github.com/s-u/Rserve/blob/05ff32d3c4512954a99162d392d0465d432d591e/src/http.c#L353-L372) function inside `Rserve.c` | ||
1. Some discissions at issue tracker | ||
* [RServe for real-time](https://github.com/s-u/Rserve/issues/64) | ||
1. [Rserve tag](https://stackoverflow.com/questions/tagged/rserve) on StackOverflow | ||
Sometimes, the line between 'bug' and 'feature' is a hard one to draw. Generally, a feature is anything that adds new behavior, while a bug is anything that causes incorrect behavior. | ||
|
||
# Drafting a release | ||
If you need some feature but don't have capacity/experience to work on it you can ask fot support at https://rexy.ai/ or [[email protected]](mailto:[email protected]). | ||
|
||
```sh | ||
git tag -a v0.1.5 -m "version 0.1.5" | ||
git push origin master --tags | ||
``` | ||
## Programming Style | ||
|
||
We use [lint](https://github.com/rexyai/RestRserve/blob/master/.lintr) in order to have consistent code style. | ||
|
||
In a nutshell: | ||
|
||
- do as other files do and do not invent a new style | ||
- use `=` for assignment (not `<-`); see [here](https://github.com/Rdatatable/data.table/pull/3582#discussion_r287075480), [here](https://github.com/Rdatatable/data.table/issues/3590#issuecomment-495776200), [here](https://stackoverflow.com/questions/1741820/what-are-the-differences-between-and-in-r#comment14293879_1742591) and [here](https://twitter.com/kdpsinghlab/status/1044568690346393606) | ||
- for `R6` classes we use CamelCase | ||
- for the rest we use snake_case | ||
- we don't use `.` inside names | ||
- other then that stick to base R style | ||
- Spacing | ||
- 2-space indentation | ||
- No trailing white space | ||
- Add a whitespace between `if` and opening bracket, also before opening curly bracket: `if (condition) {` | ||
- Use `L` suffix for integer; i.e. `x[1L]` not `x[1]` (to save coercion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.