Skip to content

Commit

Permalink
feat(plugins): version agnostic, base roadrunner on the current commit (
Browse files Browse the repository at this point in the history
#293)

* feat(plugins): version agnostic, base roadrunner on the current commit

* fix: configuration_parser surrogate_key headers

* fix(configuration): agnostic_parser handle basepath directive

* bump to v1.6.27
  • Loading branch information
darkweak authored Dec 21, 2022
1 parent 7aa58f6 commit 6113517
Show file tree
Hide file tree
Showing 22 changed files with 93 additions and 44 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
run: make build-and-run-beego
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Beego as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -116,11 +117,12 @@ jobs:
run: make build-and-run-chi
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Chi as middleware
uses: jakejarvis/wait-action@master
with:
time: 40s
time: 50s
-
name: Set Chi logs configuration result as environment variable
run: cd plugins/chi && echo "$(make load-checker)" >> $GITHUB_ENV
Expand Down Expand Up @@ -163,11 +165,12 @@ jobs:
run: make build-and-run-dotweb
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Dotweb as middleware
uses: jakejarvis/wait-action@master
with:
time: 40s
time: 50s
-
name: Set Dotweb logs configuration result as environment variable
run: cd plugins/dotweb && echo "$(make load-checker)" >> $GITHUB_ENV
Expand Down Expand Up @@ -210,11 +213,12 @@ jobs:
run: make build-and-run-echo
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Echo as middleware
uses: jakejarvis/wait-action@master
with:
time: 45s
time: 50s
-
name: Set Echo logs configuration result as environment variable
run: cd plugins/echo && echo "$(make load-checker)" >> $GITHUB_ENV
Expand Down Expand Up @@ -257,6 +261,7 @@ jobs:
run: make build-and-run-fiber
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Fiber as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -304,6 +309,7 @@ jobs:
run: make build-and-run-gin
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Gin as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -351,6 +357,7 @@ jobs:
run: make build-and-run-go-zero
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Go-zero as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -398,6 +405,7 @@ jobs:
run: make build-and-run-goyave
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Goyave as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -445,6 +453,7 @@ jobs:
run: make build-and-run-kratos
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Kratos as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -492,11 +501,12 @@ jobs:
run: make build-and-run-roadrunner
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Roadrunner as middleware
uses: jakejarvis/wait-action@master
with:
time: 10s
time: 50s
-
name: Set Roadrunner logs configuration result as environment variable
run: cd plugins/roadrunner && echo "$(make load-checker)" >> $GITHUB_ENV
Expand Down Expand Up @@ -539,6 +549,7 @@ jobs:
run: make build-and-run-skipper
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Skipper as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -586,6 +597,7 @@ jobs:
run: make build-and-run-souin
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Souin as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -633,6 +645,7 @@ jobs:
run: make build-and-run-traefik
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Traefik as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -680,6 +693,7 @@ jobs:
run: make build-and-run-tyk
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Tyk as middleware
uses: jakejarvis/wait-action@master
Expand Down Expand Up @@ -727,11 +741,12 @@ jobs:
run: make build-and-run-webgo
env:
GH_APP_TOKEN: ${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: ${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside Webgo as middleware
uses: jakejarvis/wait-action@master
with:
time: 45s
time: 50s
-
name: Set Webgo logs configuration result as environment variable
run: cd plugins/webgo && echo "$(make load-checker)" >> $GITHUB_ENV
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/workflow_plugins_generator.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

plugins=("beego" "chi" "dotweb" "echo" "fiber" "gin" "go-zero" "goyave" "kratos" "roadrunner" "skipper" "souin" "traefik" "tyk" "webgo")
durations=("50" "40" "40" "45" "50" "50" "50" "50" "50" "10" "65" "50" "20" "30" "45")
durations=("50" "50" "50" "50" "50" "50" "50" "50" "50" "50" "65" "50" "20" "30" "50")
versions=("19" "19" "19" "19" "19" "19" "19" "19" "19" "19" "19" "19" "19" "19" "19")

IFS= read -r -d '' tpl <<EOF
Expand Down Expand Up @@ -83,6 +83,7 @@ for i in ${!plugins[@]}; do
run: make build-and-run-$lower
env:
GH_APP_TOKEN: \${{ secrets.GH_APP_TOKEN }}
CURRENT_SHA: \${{ github.event.pull_request.head.sha }}
-
name: Wait for Souin is really loaded inside $capitalized as middleware
uses: jakejarvis/wait-action@master
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ experimental:
plugins:
souin:
moduleName: github.com/darkweak/souin
version: v1.6.26
version: v1.6.27
```
After that you can declare either the whole configuration at once in the middleware block or by service. See the examples below.
```yaml
Expand Down
4 changes: 2 additions & 2 deletions plugins/beego/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/beego/beego/v2 v2.0.4
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
)

require (
Expand Down Expand Up @@ -87,4 +87,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/caddy/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/buraksezer/olric v0.5.0
github.com/caddyserver/caddy/v2 v2.6.2
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
go.uber.org/zap v1.24.0
)

Expand Down Expand Up @@ -180,4 +180,4 @@ require (
howett.net/plist v1.0.0 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/chi/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/chi
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/go-chi/chi/v5 v5.0.7
)

Expand Down Expand Up @@ -84,4 +84,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/dotweb/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/dotweb
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/devfeel/dotweb v1.7.19
)

Expand Down Expand Up @@ -85,4 +85,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/echo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/echo
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/labstack/echo/v4 v4.9.0
)

Expand Down Expand Up @@ -90,4 +90,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/fiber/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/fiber
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/gofiber/fiber/v2 v2.34.1
github.com/valyala/fasthttp v1.38.0
)
Expand Down Expand Up @@ -88,4 +88,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/gin/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/gin
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/gin-gonic/gin v1.8.1
)

Expand Down Expand Up @@ -97,4 +97,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/go-zero/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/go-zero
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/zeromicro/go-zero v1.3.0
)

Expand Down Expand Up @@ -96,4 +96,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/goyave/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/goyave
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/pquerna/cachecontrol v0.1.0
goyave.dev/goyave/v4 v4.4.2
)
Expand Down Expand Up @@ -91,4 +91,4 @@ require (
gorm.io/gorm v1.23.5 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/kratos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/kratos
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/go-kratos/kratos/v2 v2.5.0
gopkg.in/yaml.v3 v3.0.1
)
Expand Down Expand Up @@ -87,4 +87,4 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
7 changes: 6 additions & 1 deletion plugins/roadrunner/examples/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
FROM ghcr.io/roadrunner-server/velox:latest as velox

ARG CURRENT_SHA
ARG GH_TOKEN
ENV CGO_ENABLED=0
ENV VERSION=v2.10.7
ENV TIME="$(date +%H:%M)"

RUN apk add git

COPY . /opt
WORKDIR /opt/plugins/roadrunner
RUN go get -u "github.com/darkweak/souin@${CURRENT_SHA}"
WORKDIR /opt/plugins/roadrunner/examples
RUN sed -i "s/GH_TOKEN/${GH_TOKEN}/" configuration.toml

RUN apk add git
RUN vx build -c configuration.toml -o /usr/bin/

FROM composer:latest AS development-runner
COPY --from=velox /usr/bin/rr /usr/bin/rr

RUN apk add linux-headers
RUN docker-php-ext-install sockets
RUN composer require spiral/roadrunner nyholm/psr7

Expand Down
1 change: 1 addition & 0 deletions plugins/roadrunner/examples/docker-compose.yml.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ services:
target: development-runner
args:
GH_TOKEN: ${GH_APP_TOKEN}
CURRENT_SHA: ${CURRENT_SHA}
ports:
- 80:80
4 changes: 2 additions & 2 deletions plugins/roadrunner/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/roadrunner
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/roadrunner-server/errors v1.2.0
go.uber.org/zap v1.24.0
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -84,4 +84,4 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
4 changes: 2 additions & 2 deletions plugins/skipper/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/skipper
go 1.19

require (
github.com/darkweak/souin v1.6.26
github.com/darkweak/souin v1.6.27
github.com/zalando/skipper v0.13.225
)

Expand Down Expand Up @@ -126,4 +126,4 @@ require (
layeh.com/gopher-json v0.0.0-20201124131017-552bb3c4c3bf // indirect
)

replace github.com/darkweak/souin v1.6.26 => ../..
replace github.com/darkweak/souin v1.6.27 => ../..
Loading

0 comments on commit 6113517

Please sign in to comment.