From bc8a3ff724c425a31c2c50a7b5f093983ed792ef Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Mon, 21 Sep 2020 12:41:53 +0300 Subject: Simplify watcher test, fix lgtm warinings and errors --- service/reload/213977608/file.txt | 0 service/reload/423382903/file.txt | 0 service/reload/watcher.go | 11 +---------- worker.go | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) create mode 100755 service/reload/213977608/file.txt create mode 100755 service/reload/423382903/file.txt diff --git a/service/reload/213977608/file.txt b/service/reload/213977608/file.txt new file mode 100755 index 00000000..e69de29b diff --git a/service/reload/423382903/file.txt b/service/reload/423382903/file.txt new file mode 100755 index 00000000..e69de29b diff --git a/service/reload/watcher.go b/service/reload/watcher.go index 027d2d0d..721495c3 100644 --- a/service/reload/watcher.go +++ b/service/reload/watcher.go @@ -177,15 +177,6 @@ func (w *Watcher) retrieveFilesSingle(serviceName, path string) (map[string]os.F // so, we will add files with goto pattern outer: for i := 0; i < len(fileInfoList); i++ { - var pathToFile string - // BCE check elimination - // https://go101.org/article/bounds-check-elimination.html - if len(fileInfoList) != 0 && len(fileInfoList) >= i { - pathToFile = filepath.Join(pathToFile, fileInfoList[i].Name()) - } else { - return nil, errors.New("file info list len") - } - // if file in ignored --> continue if _, ignored := w.watcherConfigs[serviceName].ignored[path]; ignored { continue @@ -199,7 +190,7 @@ outer: } } - filesList[pathToFile] = fileInfoList[i] + filesList[fileInfoList[i].Name()] = fileInfoList[i] } return filesList, nil diff --git a/worker.go b/worker.go index 3740aee8..4fbf4369 100644 --- a/worker.go +++ b/worker.go @@ -250,7 +250,7 @@ func (w *Worker) execPayload(rqs *Payload) (rsp *Payload, err error) { } // add streaming support :) - if rsp.Body, pr, err = w.rl.Receive(); err != nil { + if rsp.Body, _, err = w.rl.Receive(); err != nil { return nil, errors.Wrap(err, "worker error") } -- cgit v1.2.3 From b02aa40700946d90ce9d5d5c3ead78f427bce7bf Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Mon, 21 Sep 2020 13:09:43 +0300 Subject: Add few TODOs to cleanup later --- static_pool.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static_pool.go b/static_pool.go index c7cc6517..c4b6f42d 100644 --- a/static_pool.go +++ b/static_pool.go @@ -188,6 +188,7 @@ func (p *StaticPool) Destroy() { // finds free worker in a given time interval. Skips dead workers. func (p *StaticPool) allocateWorker() (w *Worker, err error) { + // TODO loop counts upward, but its variable is bounded downward. for i := atomic.LoadInt64(&p.numDead); i >= 0; i++ { // this loop is required to skip issues with dead workers still being in a ring // (we know how many workers). @@ -291,6 +292,7 @@ func (p *StaticPool) discardWorker(w *Worker, caused interface{}) { } // destroyWorker destroys workers and removes it from the pool. +// TODO caused unused func (p *StaticPool) destroyWorker(w *Worker, caused interface{}) { go func() { err := w.Stop() -- cgit v1.2.3 From a7dbcd55f3c530a9954c28c807f0d94a5a0f41eb Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Tue, 22 Sep 2020 11:39:27 +0300 Subject: Bump golang version in GHA --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index c85aa6c9..4e2dc069 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: php: [7.2, 7.3, 7.4] - go: [1.13, 1.14] + go: [1.14, 1.15] os: [ubuntu-latest] env: GO111MODULE: on -- cgit v1.2.3 From e39711cb0db52641d57126fc9b5db7d5b6c5b198 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 23 Sep 2020 00:29:34 +0300 Subject: correct bors build --- bors.toml | 6 +++--- service/reload/213977608/file.txt | 0 service/reload/423382903/file.txt | 0 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100755 service/reload/213977608/file.txt delete mode 100755 service/reload/423382903/file.txt diff --git a/bors.toml b/bors.toml index cedaffb2..6dbbcaee 100644 --- a/bors.toml +++ b/bors.toml @@ -1,9 +1,9 @@ status = [ -'Build (PHP 7.2, Go 1.13, OS ubuntu-latest)', +'Build (PHP 7.2, Go 1.15, OS ubuntu-latest)', 'Build (PHP 7.2, Go 1.14, OS ubuntu-latest)', -'Build (PHP 7.3, Go 1.13, OS ubuntu-latest)', +'Build (PHP 7.3, Go 1.15, OS ubuntu-latest)', 'Build (PHP 7.3, Go 1.14, OS ubuntu-latest)', -'Build (PHP 7.4, Go 1.13, OS ubuntu-latest)', +'Build (PHP 7.4, Go 1.15, OS ubuntu-latest)', 'Build (PHP 7.4, Go 1.14, OS ubuntu-latest)', 'runner / golangci-lint', 'Build docker image',] diff --git a/service/reload/213977608/file.txt b/service/reload/213977608/file.txt deleted file mode 100755 index e69de29b..00000000 diff --git a/service/reload/423382903/file.txt b/service/reload/423382903/file.txt deleted file mode 100755 index e69de29b..00000000 -- cgit v1.2.3 From 9c08cf339ba66d86691382b5a9c35ac2838be033 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Fri, 2 Oct 2020 13:57:07 +0300 Subject: Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..1c90e4a4 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 15 * * 6' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['go'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 -- cgit v1.2.3 From 07278036a91565fe9b4f0fac2b1556a1b59e3373 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 21 Oct 2020 13:54:09 +0300 Subject: Release 1.8.4 --- CHANGELOG.md | 4 ++++ build.sh | 2 +- go.mod | 4 ++-- go.sum | 6 ++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c58de9b..f37c117c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ CHANGELOG ========= +v1.8.4 (21.10.2020) +------------------- +- Update Goridge go dep to 2.4.6 + v1.8.3 (02.09.2020) ------------------- - Fix superfluous response.WriteHeader issue. diff --git a/build.sh b/build.sh index 77c13fff..df05fff0 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ cd $(dirname "${BASH_SOURCE[0]}") OD="$(pwd)" # Pushes application version into the build information. -RR_VERSION=1.8.3 +RR_VERSION=1.8.4 # Hardcode some values to the core package LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.Version=${RR_VERSION}" diff --git a/go.mod b/go.mod index 0060343d..ccaff45e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/spiral/roadrunner -go 1.14 +go 1.15 require ( github.com/NYTimes/gziphandler v1.1.1 @@ -19,7 +19,7 @@ require ( github.com/sirupsen/logrus v1.6.0 github.com/spf13/cobra v1.0.0 github.com/spf13/viper v1.7.1 - github.com/spiral/goridge/v2 v2.4.5 + github.com/spiral/goridge/v2 v2.4.6 github.com/stretchr/testify v1.6.1 github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a github.com/yookoala/gofast v0.4.0 diff --git a/go.sum b/go.sum index 9a487c66..b91bd265 100644 --- a/go.sum +++ b/go.sum @@ -138,8 +138,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -264,8 +262,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spiral/goridge/v2 v2.4.5 h1:rg4lLEJLrEh1Wj6G1qTsYVbYiQvig6mOR1F9GyDIGm8= -github.com/spiral/goridge/v2 v2.4.5/go.mod h1:C/EZKFPON9lypi8QO7I5ObgVmrIzTmhZqFz/tmypcGc= +github.com/spiral/goridge/v2 v2.4.6 h1:9u/mrxCtOSy0lnumrpPCSOlGBX/Vprid/hFsnzWrd6k= +github.com/spiral/goridge/v2 v2.4.6/go.mod h1:mYjL+Ny7nVfLqjRwIYV2pUSQ61eazvVclHII6FfZfYc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -- cgit v1.2.3 From 494c703dae5d3e84c5d8ee3a81fc404bd059ea57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B5=D0=BC=D1=8C=D0=B5=D0=B2?= Date: Mon, 30 Nov 2020 00:16:40 +0300 Subject: Allow PHP 8.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6b817a2e..21c55fe4 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.2", + "php": "^7.4 || ^8.0", "ext-json": "*", "ext-curl": "*", "spiral/goridge": "^2.4.2", -- cgit v1.2.3 From 744e03e9effda59c35e9a4a359bb6a0503268210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B5=D0=BC=D1=8C=D0=B5=D0=B2?= Date: Mon, 30 Nov 2020 00:29:46 +0300 Subject: fix for php version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 21c55fe4..f23fd075 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^7.2 || ^8.0", "ext-json": "*", "ext-curl": "*", "spiral/goridge": "^2.4.2", -- cgit v1.2.3 From 5e3231c481e7404e92db1daaabc4dd96dc949e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B5=D0=BC=D1=8C=D0=B5=D0=B2?= Date: Mon, 30 Nov 2020 00:37:57 +0300 Subject: PHP 8 ci --- .github/workflows/ci-build.yml | 2 +- bors.toml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 4e2dc069..af66543e 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - php: [7.2, 7.3, 7.4] + php: [7.2, 7.3, 7.4, 8.0] go: [1.14, 1.15] os: [ubuntu-latest] env: diff --git a/bors.toml b/bors.toml index 6dbbcaee..18f30334 100644 --- a/bors.toml +++ b/bors.toml @@ -5,6 +5,8 @@ status = [ 'Build (PHP 7.3, Go 1.14, OS ubuntu-latest)', 'Build (PHP 7.4, Go 1.15, OS ubuntu-latest)', 'Build (PHP 7.4, Go 1.14, OS ubuntu-latest)', +'Build (PHP 8.0, Go 1.15, OS ubuntu-latest)', +'Build (PHP 8.0, Go 1.14, OS ubuntu-latest)', 'runner / golangci-lint', 'Build docker image',] -- cgit v1.2.3 From 4e7bdc525777601be7891e5db29a36b5e97e1243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B5=D0=BC=D1=8C=D0=B5=D0=B2?= Date: Mon, 30 Nov 2020 01:28:53 +0300 Subject: PHP 8 tests --- service/http/handler_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/service/http/handler_test.go b/service/http/handler_test.go index cb1cd728..bc22183d 100644 --- a/service/http/handler_test.go +++ b/service/http/handler_test.go @@ -722,8 +722,14 @@ func TestHandler_FormData_POST_Overwrite(t *testing.T) { form := url.Values{} - form.Add("key", "value1") - form.Add("key", "value2") + form.Add("key", "value") + form.Add("name[]", "name1") + form.Add("name[]", "name2") + form.Add("name[]", "name3") + form.Add("arr[x][y][z]", "y") + form.Add("arr[x][y][e]", "f") + form.Add("arr[c]p", "l") + form.Add("arr[c]z", "") req, err := http.NewRequest("POST", "http://localhost"+hs.Addr, strings.NewReader(form.Encode())) assert.NoError(t, err) @@ -746,7 +752,7 @@ func TestHandler_FormData_POST_Overwrite(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 200, r.StatusCode) - assert.Equal(t, `{"key":"value2","arr":{"x":{"y":null}}}`, string(b)) + assert.Equal(t, `{"arr":{"c":{"p":"l","z":""},"x":{"y":{"e":"f","z":"y"}}},"key":"value","name":["name1","name2","name3"]}`, string(b)) } func TestHandler_FormData_POST_Form_UrlEncoded_Charset(t *testing.T) { -- cgit v1.2.3 From 06a87687b9fc1c62a7a0346e1634dc8f686ef8b3 Mon Sep 17 00:00:00 2001 From: Vitaly Artemev Date: Mon, 30 Nov 2020 14:47:28 +0300 Subject: removed php 7.2 --- .github/workflows/ci-build.yml | 2 +- bors.toml | 2 -- composer.json | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index af66543e..930d1c17 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - php: [7.2, 7.3, 7.4, 8.0] + php: [7.3, 7.4, 8.0] go: [1.14, 1.15] os: [ubuntu-latest] env: diff --git a/bors.toml b/bors.toml index 18f30334..a3b0f49c 100644 --- a/bors.toml +++ b/bors.toml @@ -1,6 +1,4 @@ status = [ -'Build (PHP 7.2, Go 1.15, OS ubuntu-latest)', -'Build (PHP 7.2, Go 1.14, OS ubuntu-latest)', 'Build (PHP 7.3, Go 1.15, OS ubuntu-latest)', 'Build (PHP 7.3, Go 1.14, OS ubuntu-latest)', 'Build (PHP 7.4, Go 1.15, OS ubuntu-latest)', diff --git a/composer.json b/composer.json index f23fd075..3ce86754 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.2 || ^8.0", + "php": "^7.3 || ^8.0", "ext-json": "*", "ext-curl": "*", "spiral/goridge": "^2.4.2", -- cgit v1.2.3 From 9557eaed0dff03b1d550b608fd13d02c85532a1f Mon Sep 17 00:00:00 2001 From: Vitaly Artemev Date: Mon, 30 Nov 2020 15:51:18 +0300 Subject: changed PHP 8.0 -> PHP 8 --- bors.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bors.toml b/bors.toml index a3b0f49c..7743fb34 100644 --- a/bors.toml +++ b/bors.toml @@ -3,8 +3,8 @@ status = [ 'Build (PHP 7.3, Go 1.14, OS ubuntu-latest)', 'Build (PHP 7.4, Go 1.15, OS ubuntu-latest)', 'Build (PHP 7.4, Go 1.14, OS ubuntu-latest)', -'Build (PHP 8.0, Go 1.15, OS ubuntu-latest)', -'Build (PHP 8.0, Go 1.14, OS ubuntu-latest)', +'Build (PHP 8, Go 1.15, OS ubuntu-latest)', +'Build (PHP 8, Go 1.14, OS ubuntu-latest)', 'runner / golangci-lint', 'Build docker image',] -- cgit v1.2.3 From 0e5f37d059405b09e162bc7d16b0ec3fff3f3e14 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 2 Dec 2020 10:33:58 +0300 Subject: Release 1.9.0 --- .github/workflows/ci-build.yml | 12 ++++++------ CHANGELOG.md | 7 +++++++ Dockerfile | 2 +- bors.toml | 12 ++++++------ build.sh | 2 +- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 930d1c17..ded84778 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,6 +1,6 @@ name: CI -on: [push, pull_request] +on: [ push, pull_request ] jobs: build: @@ -9,9 +9,9 @@ jobs: strategy: fail-fast: false matrix: - php: [7.3, 7.4, 8.0] - go: [1.14, 1.15] - os: [ubuntu-latest] + php: [ 7.3, 7.4, 8.0 ] + go: [ 1.14, 1.15 ] + os: [ ubuntu-20.04 ] env: GO111MODULE: on steps: @@ -100,7 +100,7 @@ jobs: golangci-check: name: runner / golangci-lint - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Check out code into the Go module directory uses: actions/checkout@v1 @@ -111,7 +111,7 @@ jobs: image: name: Build docker image - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Check out code uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index f37c117c..db8ad552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +v1.9.0 (02.12.2020) +------------------- +- Update PHP minimal supported version to 7.3 +- Support PHP 8.0 +- Update Ubuntu version in GHA to 20.04 +- Update Golang version in the RR Dockerfile to 1.15.5 + v1.8.4 (21.10.2020) ------------------- - Update Goridge go dep to 2.4.6 diff --git a/Dockerfile b/Dockerfile index c857515f..67c06d28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.14.3 as builder +FROM golang:1.15.5 as builder COPY . /src diff --git a/bors.toml b/bors.toml index 7743fb34..2c1160b9 100644 --- a/bors.toml +++ b/bors.toml @@ -1,10 +1,10 @@ status = [ -'Build (PHP 7.3, Go 1.15, OS ubuntu-latest)', -'Build (PHP 7.3, Go 1.14, OS ubuntu-latest)', -'Build (PHP 7.4, Go 1.15, OS ubuntu-latest)', -'Build (PHP 7.4, Go 1.14, OS ubuntu-latest)', -'Build (PHP 8, Go 1.15, OS ubuntu-latest)', -'Build (PHP 8, Go 1.14, OS ubuntu-latest)', +'Build (PHP 7.3, Go 1.15, OS ubuntu-20.04)', +'Build (PHP 7.3, Go 1.14, OS ubuntu-20.04)', +'Build (PHP 7.4, Go 1.15, OS ubuntu-20.04)', +'Build (PHP 7.4, Go 1.14, OS ubuntu-20.04)', +'Build (PHP 8, Go 1.15, OS ubuntu-20.04)', +'Build (PHP 8, Go 1.14, OS ubuntu-20.04)', 'runner / golangci-lint', 'Build docker image',] diff --git a/build.sh b/build.sh index df05fff0..64411dba 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ cd $(dirname "${BASH_SOURCE[0]}") OD="$(pwd)" # Pushes application version into the build information. -RR_VERSION=1.8.4 +RR_VERSION=1.9.0 # Hardcode some values to the core package LDFLAGS="$LDFLAGS -X github.com/spiral/roadrunner/cmd/rr/cmd.Version=${RR_VERSION}" -- cgit v1.2.3 From 22e112187c0b3333e7c09456068a5782d4a939bc Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 2 Dec 2020 10:58:36 +0300 Subject: Rotate port in the TestHandler_FormData_PUT test --- service/http/handler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/http/handler_test.go b/service/http/handler_test.go index bc22183d..951bcbfd 100644 --- a/service/http/handler_test.go +++ b/service/http/handler_test.go @@ -852,7 +852,7 @@ func TestHandler_FormData_PUT(t *testing.T) { assert.NoError(t, h.rr.Start()) defer h.rr.Stop() - hs := &http.Server{Addr: ":8084", Handler: h} + hs := &http.Server{Addr: ":18084", Handler: h} defer func() { err := hs.Shutdown(context.Background()) if err != nil { -- cgit v1.2.3 From 3bf8089e46abd35e75fd36caa1038e80b57938eb Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 2 Dec 2020 11:25:19 +0300 Subject: Rotate ports in the Test_Service_PidEcho test --- service/limit/service_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/limit/service_test.go b/service/limit/service_test.go index b358c1c1..d6702a29 100644 --- a/service/limit/service_test.go +++ b/service/limit/service_test.go @@ -63,7 +63,7 @@ func Test_Service_PidEcho(t *testing.T) { err := c.Init(&testCfg{ httpCfg: `{ - "address": ":17029", + "address": ":27029", "workers":{ "command": "php ../../tests/http/client.php pid pipes", "pool": {"numWorkers": 1} @@ -91,8 +91,8 @@ func Test_Service_PidEcho(t *testing.T) { } }() - time.Sleep(time.Millisecond * 100) - req, err := http.NewRequest("GET", "http://localhost:17029", nil) + time.Sleep(time.Millisecond * 800) + req, err := http.NewRequest("GET", "http://localhost:27029", nil) if err != nil { return err } -- cgit v1.2.3 From 453133e7bb876a5f678ebd0847221495efbcd1ba Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Wed, 2 Dec 2020 11:42:56 +0300 Subject: Rotate ports in the Test_Service_Listener_MaxMemoryUsage test --- service/limit/service_test.go | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/service/limit/service_test.go b/service/limit/service_test.go index d6702a29..fae73166 100644 --- a/service/limit/service_test.go +++ b/service/limit/service_test.go @@ -2,6 +2,11 @@ package limit import ( "fmt" + "io/ioutil" + "net/http" + "testing" + "time" + "github.com/cenkalti/backoff/v4" json "github.com/json-iterator/go" "github.com/sirupsen/logrus" @@ -9,10 +14,6 @@ import ( "github.com/spiral/roadrunner/service" rrhttp "github.com/spiral/roadrunner/service/http" "github.com/stretchr/testify/assert" - "io/ioutil" - "net/http" - "testing" - "time" ) type testCfg struct { @@ -102,7 +103,6 @@ func Test_Service_PidEcho(t *testing.T) { return err } - b, err := ioutil.ReadAll(r.Body) if err != nil { return err @@ -137,7 +137,7 @@ func Test_Service_ListenerPlusTTL(t *testing.T) { c.Register(rrhttp.ID, &rrhttp.Service{}) c.Register(ID, &Service{}) - err := c.Init(&testCfg{ + err := c.Init(&testCfg{ httpCfg: `{ "address": ":7030", "workers":{ @@ -175,7 +175,6 @@ func Test_Service_ListenerPlusTTL(t *testing.T) { } }() - time.Sleep(time.Millisecond * 100) lastPID := getPID(s) @@ -190,7 +189,6 @@ func Test_Service_ListenerPlusTTL(t *testing.T) { return err } - b, err := ioutil.ReadAll(r.Body) if err != nil { return err @@ -278,7 +276,6 @@ func Test_Service_ListenerPlusIdleTTL(t *testing.T) { } }() - time.Sleep(time.Millisecond * 100) lastPID := getPID(s) @@ -415,7 +412,7 @@ func Test_Service_Listener_MaxMemoryUsage(t *testing.T) { err := c.Init(&testCfg{ httpCfg: `{ - "address": ":7033", + "address": ":10033", "workers":{ "command": "php ../../tests/http/client.php memleak pipes", "pool": {"numWorkers": 1} @@ -433,6 +430,7 @@ func Test_Service_Listener_MaxMemoryUsage(t *testing.T) { return err } + time.Sleep(time.Second * 3) s, _ := c.Get(rrhttp.ID) assert.NotNil(t, s) @@ -453,11 +451,11 @@ func Test_Service_Listener_MaxMemoryUsage(t *testing.T) { } }() - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Millisecond * 500) lastPID := getPID(s) - req, err := http.NewRequest("GET", "http://localhost:7033", nil) + req, err := http.NewRequest("GET", "http://localhost:10033", nil) if err != nil { return err } -- cgit v1.2.3