Skip to content

Commit

Permalink
Merge branch 'v5_alpha' into v5_alpha_labstack
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/echo.yml
#	Makefile
#	context.go
#	context_test.go
#	echo.go
#	echo_test.go
#	group.go
#	group_test.go
#	middleware/basic_auth.go
#	middleware/basic_auth_test.go
#	middleware/body_limit_test.go
#	middleware/decompress_test.go
#	middleware/extractor.go
#	middleware/jwt.go
#	middleware/jwt_external_test.go
#	middleware/jwt_test.go
#	middleware/key_auth.go
#	middleware/key_auth_test.go
#	middleware/logger.go
#	middleware/method_override_test.go
#	middleware/recover.go
#	middleware/recover_test.go
#	router.go
#	router_test.go
#	server_test.go
  • Loading branch information
aldas committed Jul 17, 2022
2 parents ed2888c + aad765a commit 7402266
Show file tree
Hide file tree
Showing 34 changed files with 2,288 additions and 488 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/echo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- '_fixture/**'
- '.github/**'
- 'codecov.yml'
workflow_dispatch: # to be able to run workflow manually
workflow_dispatch:

jobs:
test:
Expand All @@ -29,72 +29,72 @@ jobs:
# Each major Go release is supported until there are two newer major releases. https://golang.org/doc/devel/release.html#policy
# Echo tests with last four major releases
# except v5 starts from 1.17 until there is last four major releases after that
go: [1.17]
go: [1.17, 1.18]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Install Dependencies
run: go get -v golang.org/x/lint/golint
run: |
go install golang.org/x/lint/golint@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Run Tests
run: |
golint -set_exit_status ./...
staticcheck ./...
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
- name: Upload coverage to Codecov
if: success() && matrix.go == 1.17 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
if: success() && matrix.go == 1.18 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
token:
fail_ci_if_error: false

benchmark:
needs: test
strategy:
matrix:
os: [ubuntu-latest]
go: [1.17]
go: [1.18]
name: Benchmark comparison ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Checkout Code (Previous)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
path: previous

- name: Checkout Code (New)
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: new

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Install Dependencies
run: go get -v golang.org/x/perf/cmd/benchstat
run: go install golang.org/x/perf/cmd/benchstat@latest

- name: Run Benchmark (Previous)
run: |
cd previous
go test -run="-" -bench=".*" -count=8 ./... > benchmark.txt
- name: Run Benchmark (New)
run: |
cd new
go test -run="-" -bench=".*" -count=8 ./... > benchmark.txt
- name: Run Benchstat
run: |
benchstat previous/benchmark.txt new/benchmark.txt
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Changelog

## v4.7.2 - 2022-03-16

**Fixes**

* Fix nil pointer exception when calling Start again after address binding error [#2131](https://github.com/labstack/echo/pull/2131)
* Fix CSRF middleware not being able to extract token from multipart/form-data form [#2136](https://github.com/labstack/echo/pull/2136)
* Fix Timeout middleware write race [#2126](https://github.com/labstack/echo/pull/2126)

**Enhancements**

* Recover middleware should not log panic for aborted handler [#2134](https://github.com/labstack/echo/pull/2134)


## v4.7.1 - 2022-03-13

**Fixes**

* Fix `e.Static`, `.File()`, `c.Attachment()` being picky with paths starting with `./`, `../` and `/` after 4.7.0 introduced echo.Filesystem support (Go1.16+) [#2123](https://github.com/labstack/echo/pull/2123)

**Enhancements**

* Remove some unused code [#2116](https://github.com/labstack/echo/pull/2116)


## v4.7.0 - 2022-03-01

**Enhancements**

* Add JWT, KeyAuth, CSRF multivalue extractors [#2060](https://github.com/labstack/echo/pull/2060)
* Add LogErrorFunc to recover middleware [#2072](https://github.com/labstack/echo/pull/2072)
* Add support for HEAD method query params binding [#2027](https://github.com/labstack/echo/pull/2027)
* Improve filesystem support with echo.FileFS, echo.StaticFS, group.FileFS, group.StaticFS [#2064](https://github.com/labstack/echo/pull/2064)

**Fixes**

* Fix X-Real-IP bug, improve tests [#2007](https://github.com/labstack/echo/pull/2007)
* Minor syntax fixes [#1994](https://github.com/labstack/echo/pull/1994), [#2102](https://github.com/labstack/echo/pull/2102), [#2102](https://github.com/labstack/echo/pull/2102)

**General**

* Add cache-control and connection headers [#2103](https://github.com/labstack/echo/pull/2103)
* Add Retry-After header constant [#2078](https://github.com/labstack/echo/pull/2078)
* Upgrade `go` directive in `go.mod` to 1.17 [#2049](https://github.com/labstack/echo/pull/2049)
* Add Pagoda [#2077](https://github.com/labstack/echo/pull/2077) and Souin [#2069](https://github.com/labstack/echo/pull/2069) to 3rd-party middlewares in README

## v4.6.3 - 2022-01-10

**Fixes**
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ tag:
check: lint vet race ## Check project

init:
@go get -u golang.org/x/lint/golint
@go install golang.org/x/lint/golint@latest
@go install honnef.co/go/tools/cmd/staticcheck@latest

lint: ## Lint the files
@golint -set_exit_status ${PKG_LIST}
Expand All @@ -29,6 +30,6 @@ benchmark: ## Run benchmarks
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

goversion ?= "1.16"
test_version: ## Run tests inside Docker with given version (defaults to 1.16 oldest supported). Example: make test_version goversion=1.16
goversion ?= "1.17"
test_version: ## Run tests inside Docker with given version (defaults to 1.17 oldest supported). Example: make test_version goversion=1.17
@docker run --rm -it -v $(shell pwd):/project golang:$(goversion) /bin/sh -c "cd /project && make init check"
Loading

0 comments on commit 7402266

Please sign in to comment.