Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate dependency management for submodules #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

@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