go-http-metrics icon indicating copy to clipboard operation
go-http-metrics copied to clipboard

Separate dependency management for submodules

Open markbastiaans opened this issue 2 years ago • 1 comments

This PR aims to split out framework-specific submodules into submodules with their own go.mod / go.sum files.

The readme currently mentions that the current setup is by design, but a more modular setup does have an advantage. Any project using this library will only include dependencies for the specific frameworks in use, and not for all frameworks covered. This reduces the size of the dependency graph, but does not reduce compiled binary sizes in practice. Still, this is a great improvement since you won't have to pull in all dependencies when you e.g. build. This is especially important if you're dealing with resource / bandwidth limits, or dealing with dependency scanning / SBOMs as part of your security chain.

After this PR is merged, submodules have to be individually tagged, e.g. middleware/gin/v0.1.0, metrics/prometheus/v0.1.0. The version can differ from the core module.

markbastiaans avatar Jun 01 '23 10:06 markbastiaans

@markbastiaans For this to be effective you also have to update the dependabot config. Dependabot doesn't work recursively. You have to add an entry for every directory that has a go.mod file.

https://github.com/slok/go-http-metrics/blob/master/.github/dependabot.yml

gaby avatar Mar 27 '24 04:03 gaby