-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Remove dependency to go-git
#100
Comments
hello @nscuro, I can take care of this one, would you mind assigning it to me? I'm willing to work on it 🙋🏻♂️ |
@developer-guy Sure, thank you! |
Is this necessary to support If not, it might be worth moving license detection code entirely into a separate module in this repo, so that users who want to depend on the library don't have to take a dependency on go-git, or any license detection code. I'd be happy to help work out how that package should be arranged, I'm working on consuming this in Opting out of these dependencies could also be toggled behind a build tag, which would reduce binary size. But Go modules would still download the code, and vulnerability scanners etc would be needlessly triggered for unused deps. |
Yeah... While |
One idea that might be worth investigating: instead of having Users who don't want to detect licenses don't have to import your heavyweight licenser implementation in its separate module, and users who do, can. It also opens up the possibility of other licenser implementations, inside or outside your repos. |
@imjasonh Interesting idea for sure! I like the modularity aspect of it, but managing multiple modules could become a little cumbersome. Especially since license detection an essential feature for the Maybe I can combine this suggestion with one of your earlier ideas:
We can still introduce That being said, this will still hold true:
However, this not so much:
If you do the vuln scanning based on what your app actually uses (e.g. eventually Sounds acceptable to you? I'll try to do some experiments this weekend. |
Yeah I completely understand the headaches of managing multiple modules inside the same repo. We jump through quite a lot of hoops in go-containerregistry to isolate our main packages and CLI from heavy dependencies like k8s.io/client-go, cred helpers, etc., and there's always more to do. It's a pain. If the build tag approach bears fruit that'd be great to see. I've been hacking a bit this morning on the multiple module approach just to get an idea for it, and it's pretty gnarly. You'd either have to have:
In either case it means a pretty drastic overhaul of the package layout, and I don't know exactly which packages you have users for today that might be broken by changes. Of the two, option 2 sounds easier since the library is already new code since the last release, so there shouldn't be any breakage-sensitive users to worry about. (btw, thank you so much for using
Yeah, ideally scanners would be smart enough, but I've seen some pretty noisy false positives coming from dependabot especially, which is mostly what I'm worried about. 😕 |
Another thing to consider here is that I've also been reflecting on @samj1912's comment (#112 (comment)) about limiting external dependencies being a good thing (or even requirement) in some cases. His argument also feeds into anchore/syft#761 (comment). In addition, there are still interesting CDX uses cases like pedigree that I'd like to experiment with. For example, when using In short, I'm thinking about removing this from the |
Closing. We're going to keep using the library over shelling out to |
Just use raw
git
commands instead.go-git
introduces a lot of dependencies we don't otherwise use. Our usage of Git functions is also very shallow, nothing that would justify import such a powerful lib.The text was updated successfully, but these errors were encountered: