‹ BackHN Continuity

Thread

Don't couple your Go code to GitHub

325 points · 177 comments · birdculture

  1. SenHeng · · focus · HN ↗
    GitHub is almost forever. Your custom domain disappears when you stop paying the bills, which if you’re an open source developer has a higher likelihood than GitHub disappearing.

    One day, we’re all going back to vendoring dependencies.

    1. otterley · · focus · HN ↗
      Why did we stop vendoring dependencies in the first place?
      1. metaltyphoon · · focus · HN ↗
        Because its not as convenient
        1. otterley · · focus · HN ↗
          Can you elaborate?
          1. thayne · · focus · HN ↗
            Updates mean you have to copy over all the code into your repo, which creates a large diff, and hope you aren't overwriting any local changes someone might have made.

            It bloats your repo, both with the actual code, and the large diffs when you update it.

            You have to manually track new versions, without something to tell you if new versions are available, or if your version has known security vulnerabilities.

            If the dependency has it's own dependencies, you have to vendor those too recursively. And if multiple dependencies have the same transitive dependency, it is up to you to deduplicate them, and make sure you have a version compatible with all dependents.

            Etc.

            1. otterley · · focus · HN ↗
              Disk is cheap.

              Recursive dependencies have the same issues whether you vend them or not.

              Ensuring that diffs to updated dependencies remain within a vendor folder is trivial.

              So, what’s left?

              1. thayne · · focus · HN ↗
                > Disk is cheap

                The biggest problem isn't (usually) disk space, or network bandwidth, it is that git operations slow down as the size of the repo grows. And it means that cloning or pulling the repo takes longer, which can be especially problematic for CI.

                > Recursive dependencies have the same issues whether you vend them or not.

                Package managers usually handle resolving recursive/transitive dependencies for you. Some have support for vendoring dependencies, but not all do. In theory, you could have similar tooling for vendoring dependencies, but in practice that often isn't the case.

                1. otterley · · focus · HN ↗
                  These are all solvable problems IME. But it does mean you need people who are experienced at solving them or who care enough to learn.
                  1. thayne · · focus · HN ↗
                    > But it does mean you need people who are experienced at solving them or who care enough to learn.

                    That sounds like it's inconvenient to me.

                    1. otterley · · focus · HN ↗
                      The price of security and business continuity is the occasional inconvenience. Tale as old as time.
                      1. thayne · · focus · HN ↗
                        Vendoring isn't a clear win for security. It may provide some protection against "supply chain" attacks, but makes it more difficult for you to respond to vulnerabilities discovered in the version you vendored. And for business continuity, in many cases depending on an external registry is an acceptable risk.

                        And both of those concerns can be addressed by using an internal/private registry that mirrors the packages you need.

                        But in any event, your original question was to elaborate on why vendoring is inconvenient. Whether or not the benefits are worth the inconvenience is a different question, to which IMHO the answer is "it depends". Sometimes it is, and sometimes it isn't.

                        1. otterley · · focus · HN ↗
                          > Vendoring isn't a clear win for security. It may provide some protection against "supply chain" attacks, but makes it more difficult for you to respond to vulnerabilities discovered in the version you vendored.

                          How so? Whether a dependency is vendored or not, you still have to update it to integrate a security update to that dependency, don't you? The alternative is to not pin your dependencies, but that is far riskier overall.

                          > Whether or not the benefits are worth the inconvenience is a different question

                          I would contend that it is the most important question. :-)

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.