Removal of the vendor folder - open discussion #284
Replies: 10 comments 13 replies
-
We already have the go.mod file to keep track of what versions of the dependencies we're using, and I don't see much of a benefit by uploading the vendor folder. I also don't believe that dependencies being deleted is a real issue; we can probably find duplicates of a lost dependency in most cases (eg. a toml library, there are multiple available.) We can mitigate it by reducing external dependencies and be precise with our dependency choices. |
Beta Was this translation helpful? Give feedback.
-
I initially had relatively strong feelings about this in terms of seeing the vendor folder remove but have cooled down a bit after reading up a bit on some of the history behind it, in which people seem to have very strong opinions in that the vendor code should be committed. Pros
Cons
I think I still sit on the remove the vendor folder side of things but can really go either way. At a bare minimum, a I might come back around and edit this or add replies as I think and learn more about this. Up til now I haven't worked with Go at all so I'm doing a fair share of learning as I go through issues, code, and history. |
Beta Was this translation helpful? Give feedback.
-
Seems like we have a consensus here. At least no one supporting the other side spoke up for it. What do you see to be required for the removal? @OldiLo if you would un-conflict and rebase your PR #269, I think we are now at the point to discuss it. |
Beta Was this translation helpful? Give feedback.
-
Everything is vendored because i'm strongly against npm style left-pad dependency management. I think people take on dependencies way too lightly. And as already mentioned here, supply chain attacks are not a theoretical problem. It's quite possible that i swing too far to the other side of npm-style dependencies, but my philosophy is that if you take one on, you must consider that code (and all its dependencies, recusively) as your liability. (Exceptions confirm the rule, std-lib etc.) (I'm still not interested in picking this back up, but just an explaination why everything is vendored. I also dont understand how you vendor something without committing the vendor folder, but i also dont smoke whatever bestpractices(tm) people come up with all the time.) |
Beta Was this translation helpful? Give feedback.
-
I think we shouldn't commit vendor but definitely rely on GitHub Actions much more than is currently used. For commits, automatically running |
Beta Was this translation helpful? Give feedback.
-
If we remove the vendor folder we still need to review changes being done to dependencies when they are updated to be sure they were not tampered with. So we will not be spared from this tedious work. The only thing changing is: we will not do that work in our repository, but in their original repos. I've finally come to the conclusion to go with the removal. It at least clears the repo up some more. |
Beta Was this translation helpful? Give feedback.
-
I use https://www.mend.io/free-developer-tools/renovate/ (https://github.com/marketplace/renovate) at my day job to help with this. It's basically a better Dependabot, and makes a PR for dependency updates with things like adoption rate, success rate, and a link to the code diff. No experience with using it for Go, but probably works well as long as dependencies are pinned. |
Beta Was this translation helpful? Give feedback.
-
A very different approach I didn't see discussed would be shipping vendor with release versions. These versions could be branches and these branches could fetch and extract a tarball containing that version/branches So head would have vendor as submodules, This way, you don't really have to worry quite as much about what you're shipping, as what you're shipping will all have been checked and approved except the bleeding edge head branch, which regular end users should be steered away from using. Maybe none of that would work for reasons I don't understand. Just thought I'd throw in my 2 cents as an outsider having stumbled upon this little issue and become vaguely interested. Take it for what it's worth |
Beta Was this translation helpful? Give feedback.
-
Any security audit/concerns belonging to the upstream dependencies should be handled upstream. It's not beneficial to projects to all independently do their own internally. So long as the source of the dependencies is being trusted, you update for the project and leverage checksums as your trust factor. It's not going to get much better than that? Vulnerabilities/exploits can exist long before they're caught. Committing them into the project in full doesn't magically protect from that, you can get changes that reviewers cannot confidently assess (or lack the awareness of such) where such issues can slip through or introduce the exploit in a non-obvious manner. I couldn't imagine personally reviewing every single software update on my linux system line by line for example, you draw the line somewhere. As for a copy, we have forks/mirrors and other services that archive/snapshot such. I strongly disagree about dependencies being part of the main projects history. They're a different kind of change, probably better suited with git LFS or a separate branch if not repo if insisting on it. For cloning locally to build, you've got to do a shallow clone otherwise you're pulling in a lot more weight lugged around from In the CI, you can leverage caching between runs. Cache can persist for a duration before it's dropped, and be downloaded if needed, should you need to fallback to it due to issues with upstream. At least I'm having a hard time seeing worthwhile pragmatic benefits of having the source of dependencies committed. As a user of a project, it doesn't instil more confidence in the project being trustworthy, more likely the opposite. I understand that opinion can be different when you're the one performing the review, or it's an internal product, but I've seen that go wrong too. |
Beta Was this translation helpful? Give feedback.
-
I stumbled upon the vendor folder while trying to build the app today, and I found this discussion and I wanted to share my 2 cents. I hope this doesn’t get into a war of opinions since I see that people already have strong positions on the matter for something that should be actually trivial. But I wanted to share my point of view since I think this is a super nice project and really helpful tool. First of all, I think there’s an over-concern for the security or thrust on the dependencies but there’s virtually no difference between having them committed in the vendor folder versus just using Every time you update a dependency it is the job of the maintainers to check what changed between versions, and if there’s a vulnerability introduced in a dependency you just simply stick to the older version (pinned by the version in Second, go mod is the official tool from the programming language to add, maintain and update dependencies, why to reinvent the wheel? There is an argument of being able to build the application offline, but at that point you already cloned the project from a repository in GitHub so you already need the Internet. In addition to the half of users using this project for internet calls (oh!, the irony). Besides, you really need an offline version of the application that's what the releases are for. You can simultaneously add a binary release or a source release with the vendor folder included. |
Beta Was this translation helpful? Give feedback.
-
This idea has been voiced once or twice already.
What are the pro's and con's of that?
On the one hand we already forked two projects into our org, but I'm not too keen on doing that for 6-7 github-hosted and 10+ gioui.org-hosted golang deps as well.
Can we avoid it?
Beta Was this translation helpful? Give feedback.
All reactions