Update module github.com/labstack/echo/v4 to v5 - autoclosed#1291
Update module github.com/labstack/echo/v4 to v5 - autoclosed#1291renovate[bot] wants to merge 1 commit intomasterfrom
Conversation
ℹ️ Artifact update noticeFile name: transcoder/go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
|
Will need to do an MR with both echo+jwt changes. Quick glance looks like all of this is related to small (yet breaking) changeto how context is setup. From release notes: find . -type f -name "*.go" -exec sed -i 's/ echo.Context/ *echo.Context/g' {} +
find . -type f -name "*.go" -exec sed -i 's/echo\/v4/echo\/v5/g' {} + |
|
Will need to wait on open-telemetry/opentelemetry-go-contrib#8457 before upgrading to echo v5. |
fb48a74 to
663a270
Compare
712c346 to
18606d4
Compare
18606d4 to
7b5f3c6
Compare
|
working on updating a sample project to echo v5. Sharing some notes here to prepare. Boilerplate changes that can be applied. find . -type f -name "*.go" -exec sed -i 's/ echo.Context/ *echo.Context/g' {} +
find . -type f -name "*.go" -exec sed -i 's/echo\/v4/echo\/v5/g' {} +
find . -type f -name "*.go" -exec sed -i 's/echo-jwt\/v4/echo-jwt\/v5/g' {} +
find . -type f -name "*.go" -exec sed -i 's|"go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho"|echootel "github.com/labstack/echo-opentelemetry"|g' {} +
find . -type f -name "*.go" -exec sed -i 's/otelecho\./echootel./g' {} +
find . -type f -name "*.go" -exec sed -i 's/echootel\.Middleware/echootel.NewMiddleware/g' {} +
go get github.com/labstack/echo-jwt/v5@latest
go get github.com/labstack/echo/v5@latest
go get github.com/labstack/echo-jwt/v5@latest
go get github.com/labstack/echo-opentelemetry@latest
go mod tidyThere are a number of additional changes that need to happen as outlined in https://github.com/labstack/echo/blob/master/API_CHANGES_V5.md. Will need to update Echo errorhandler, server startup, and assigning logger (they default to slog, so we can purge our custom adapter) |
77bade3 to
42defc2
Compare
c6a8e52 to
3a20d7e
Compare
847bcaf to
3a20d7e
Compare
3a20d7e to
847bcaf
Compare
This PR contains the following updates:
v4.15.1→v5.0.4Release Notes
labstack/echo (github.com/labstack/echo/v4)
v5.0.4Compare Source
Enhancements
http.Server.Servereturns we need to wait for graceful shutdown goroutine to finish by @aldas in #2898echo.StatusCodeby @suwakei in #2892echo.ResolveResponseStatusfunction to help middleware/handlers determine HTTP status code and echo.Response by @aldas in #2900v5.0.3Compare Source
Security
This applies to cases when:
middleware.StaticConfig.Filesystemisnil(default)echo.Filesystemis has not been set explicitly (default)Exposure is restricted to the active process working directory and its subfolders.
v5.0.2Compare Source
Security
config.Browse=truelists all files/subfolders fromconfig.Filesystemroot and not starting fromconfig.Rootin #2887v5.0.1Compare Source
v5.0.0Compare Source
Echo
v5is maintenance release with major breaking changesContextis now struct instead of interface and we can add method to it in the future in minor versions.Routerinterface for possible new routing implementations.log/sloginstead.Upgrade notes and
v4support:v4is supported with security* updates and bug fixes until 2026-12-31v5API changes will be addressed, even if this violates semantic versioning.See API_CHANGES_V5.md for public API changes between
v4andv5, notes on upgrading.Upgrading TLDR:
If you are using Linux you can migrate easier parts like that:
macOS
or in your favorite IDE
Replace all:
echo.Context->*echo.Contextecho/v4->echo/v5This should solve most of the issues. Probably the hardest part is updating all the tests.
Configuration
📅 Schedule: Branch creation - "on monday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.