database-mesh / pisanix

A Database Mesh Project Sponsored by SphereEx
https://www.pisanix.io
Apache License 2.0
281 stars 37 forks source link

feat(CircuitBreak regex case_insensitive match config) #416

Closed arthur-zhang closed 1 year ago

arthur-zhang commented 1 year ago

add case_insensitive option to CircuitBreak regex config

it is friendly to provide case_insensitive option to proxy.config.plugin.circuit_break

[[proxy.config.plugin.circuit_break]]
regex = ["111", "^SELECT .* FOR UPDATE"]
case_insensitive = true

Tests

codecov[bot] commented 1 year ago

Codecov Report

Merging #416 (8c9d0bd) into master (df61eb4) will increase coverage by 6.48%. The diff coverage is 82.36%.

@@            Coverage Diff             @@
##           master     #416      +/-   ##
==========================================
+ Coverage   66.97%   73.46%   +6.48%     
==========================================
  Files           7        6       -1     
  Lines         427      731     +304     
==========================================
+ Hits          286      537     +251     
- Misses        133      183      +50     
- Partials        8       11       +3     
Flag Coverage Δ
unittests 73.46% <82.36%> (+6.48%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pisa-controller/pkg/proxy/server.go 20.00% <0.00%> (-2.23%) :arrow_down:
pisa-controller/pkg/webhook/server.go 26.66% <0.00%> (ø)
pisa-controller/pkg/proxy/http.go 51.35% <44.11%> (-6.55%) :arrow_down:
pisa-controller/pkg/webhook/injection.go 59.02% <82.56%> (+20.08%) :arrow_up:
pisa-controller/pkg/proxy/builder.go 91.21% <93.62%> (-0.01%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

xuanyuan300 commented 1 year ago

LGTM