Skip to content

Commit

Permalink
Complex update 3.x (#13)
Browse files Browse the repository at this point in the history
* Make HTTP stream stoppable; add phpunit; up PHP version to 8.1
* Add test server; add feature tests
* Update spiral/roadrunner-worker dependency
* Update composer.json; migrate phpunit config
  • Loading branch information
roxblnfk committed Apr 13, 2023
2 parents 2520f41 + 529f962 commit 7bbfccb
Show file tree
Hide file tree
Showing 30 changed files with 1,011 additions and 266 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{yml, yaml, sh, conf, neon*}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto

/.github export-ignore
/tests export-ignore
/.* export-ignore
/phpunit.xml* export-ignore
/phpstan.* export-ignore
/psalm.* export-ignore
/infection.* export-ignore
/codecov.* export-ignore
12 changes: 12 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Code of Conduct

The Spiral code of conduct is derived from the Ruby code of conduct.
Any violations of the code of conduct may be reported by email `wolfy-j[at]spiralscout.com`.

- Participants will be tolerant of opposing views.

- Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.

- When interpreting the words and actions of others, participants should always assume good intentions.

- Behavior which can be reasonably considered harassment will not be tolerated.
6 changes: 6 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Contributing

Feel free to contribute to the development of the Framework or its components.

For more information on contributing rules you can find on the documentation
page at https://spiral.dev/docs/about-contributing
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: roadrunner-server
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: 🐛 Bug Report
about: Report errors and problems
labels: Bug

---
### Description

<!-- A clear and concise description of the problem. -->

### How To Reproduce

<!-- Code and/or config needed to reproduce the problem. -->

### Additional Info

| Q | A
|------------------| ---
| Package Version | x.y.z <!-- Please set the package version -->
| PHP version | x.y.z <!-- Please set the PHP version -->
| Operating system | Linux <!-- Please set your OS -->

<!-- Optional: any other context about the problem: log messages, screenshots, etc. -->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/2_Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: 🚀 Feature Request
about: RFC and ideas for new features and improvements
labels: Feature

---
## Description

<!-- A clear and concise description of the new feature. -->

## Example

<!-- A simple example of the new feature in action (include PHP code, YAML config, etc.)
If the new feature changes an existing feature, include a simple before/after comparison. -->
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/3_Support_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: ❓ Question
about: Use if you have problems and don't know how to formulate them
labels: Question

---

<!--
We use GitHub issues only to discuss Spiral bugs and new features. In the
case that you have a general question, please use the chat:
- Discord: https://discord.gg/kmmfk7M
Thanks!
-->
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Q | A
| ------------- | ---
| Bugfix? | ✔️/❌
| Breaks BC? | ✔️/❌ <!-- please update "xxx Impact Changes" section in CHANGELOG.md file -->
| New feature? | ✔️/❌ <!-- please update "Other Features" section in CHANGELOG.md file -->
| Issues | #... <!-- prefix each issue number with "#" symbol, no need to create an issue if none exist, explain below instead -->
| Docs PR | spiral/docs#... <!-- prefix each issue number with "spiral/docs#", required only for new features -->

<!-- Please, replace this notice by a short description of your feature/bugfix.
This will help people understand your PR and can be used as a start for the documentation. -->
11 changes: 11 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Security Policy
===============

If you found something which shouldn't be there or a bug which opens a security
hole, please let me know immediately by email `wolfy-j[at]spiralscout.com`.

DO NOT PUBLISH SECURITY REPORTS PUBLICLY.

The full [Security Policy][1] is described in the official documentation.

[1]: https://spiral.dev/docs/about-contributing#critical-security-issues
19 changes: 19 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
pull_request: null
push:
branches:
- master
- '*.*'

name: phpunit

jobs:
phpunit:
uses: spiral/gh-actions/.github/workflows/phpunit.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1', '8.2']
stability: >-
['prefer-lowest', 'prefer-stable']
17 changes: 17 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
pull_request: null
push:
branches:
- master
- '*.*'

name: static analysis

jobs:
psalm:
uses: spiral/gh-actions/.github/workflows/psalm.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
23 changes: 19 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Dependency directories (remove the comment below to include it)
# vendor/
.idea
vendor
# Composer lock file
composer.lock

# IDEs
/.idea
/.vscode

# Vendors
/vendor
**/vendor

# Temp dirs & trash
/tests/server*
clover*
cover*
.DS_Store
*.cache

.phpunit.cache/
.phpunit.result.cache
65 changes: 47 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,71 @@
"license": "MIT",
"authors": [
{
"name": "Anton Titov / Wolfy-J",
"email": "[email protected]"
"name": "Anton Titov (wolfy-j)",
"email": "[email protected]"
},
{
"name": "Valery Piashchynski",
"homepage": "https://github.com/rustatian"
},
{
"name": "Aleksei Gagarin (roxblnfk)",
"homepage": "https://github.com/roxblnfk"
},
{
"name": "Pavel Buchnev (butschster)",
"email": "[email protected]"
},
{
"name": "Maksim Smakouz (msmakouz)",
"email": "[email protected]"
},
{
"name": "RoadRunner Community",
"homepage": "https://github.com/spiral/roadrunner/graphs/contributors"
"homepage": "https://github.com/roadrunner-server/roadrunner/graphs/contributors"
}
],
"homepage": "https://spiral.dev/",
"support": {
"docs": "https://roadrunner.dev/docs",
"issues": "https://github.com/roadrunner-server/roadrunner/issues",
"forum": "https://forum.roadrunner.dev/",
"chat": "https://discord.gg/V6EK4he"
},
"require": {
"php": ">=7.4",
"php": ">=8.1",
"ext-json": "*",
"spiral/roadrunner-worker": "^2.2.0",
"psr/http-factory": "^1.0.1",
"psr/http-message": "^1.0.1"
"psr/http-message": "^1.0.1",
"spiral/roadrunner": "^2023.1",
"spiral/roadrunner-worker": "^3.0"
},
"require-dev": {
"jetbrains/phpstorm-attributes": "^1.0",
"nyholm/psr7": "^1.3",
"phpunit/phpunit": "^10.0",
"symfony/process": "^6.2",
"vimeo/psalm": "^5.9"
},
"autoload": {
"psr-4": {
"Spiral\\RoadRunner\\Http\\": "src"
}
},
"require-dev": {
"nyholm/psr7": "^1.3",
"phpstan/phpstan": "~0.12",
"phpunit/phpunit": "~8.0",
"jetbrains/phpstorm-attributes": "^1.0",
"vimeo/psalm": "^4.22",
"symfony/var-dumper": "^5.1"
"autoload-dev": {
"psr-4": {
"Spiral\\RoadRunner\\Tests\\Http\\": "tests"
}
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/roadrunner-server"
}
],
"scripts": {
"analyze": "psalm"
},
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"suggest": {
"spiral/roadrunner-cli": "Provides RoadRunner installation and management CLI tools"
},
Expand Down
22 changes: 22 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false" colors="true"
processIsolation="false"
executionOrder="random"
stopOnFailure="false"
stopOnError="false"
stderr="true"
cacheDirectory=".phpunit.cache"
>
<testsuites>
<testsuite name="RR Worker Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory>src</directory>
</include>
</coverage>
</phpunit>
6 changes: 4 additions & 2 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="1"
resolveFromConfigFile="true"
findUnusedBaselineEntry="false"
findUnusedCode="false"
>
<issueHandlers>
<RedundantConditionGivenDocblockType errorLevel="suppress" />
Expand Down
Loading

0 comments on commit 7bbfccb

Please sign in to comment.