Skip to content

Conversation

markbastiaans
Copy link

@markbastiaans markbastiaans commented Jun 1, 2023

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 markbastiaans requested a review from slok as a code owner June 1, 2023 10:34
@markbastiaans markbastiaans force-pushed the main branch 6 times, most recently from f93388c to b9f89c4 Compare June 1, 2023 13:07
@gaby
Copy link

gaby commented Mar 27, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants