{
  "id": 20523969,
  "title": "When Upstream Disappears: Building a Dependency Safety Net with Lockfiles, Proxy Caches and Git Mirrors",
  "url": "https://urgent.news/2026/11/18/when-upstream-disappears-building-a-dependency-safety-net-with",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-18T00:58:54.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/eme_gug_0821b41b948be6516/when-upstream-disappears-building-a-dependency-safety-net-with-lockfiles-proxy-caches-and-git-5foh"
  },
  "original_language": "en",
  "account": "Upstream repositories disappearing can cause major build issues. This article explains how to create a safety net using lockfiles, proxy caches, and Git mirrors to prevent such problems.\n\nThe first layer involves using lockfiles and hashes to ensure the exact dependency versions are installed. When a developer or CI runs a command like pip install or npm install, the project pulls the dependencies directly from the upstream registry, causing the entire pipeline to halt if the upstream server goes down. To avoid this, generate a lockfile with a hash that changes only if the package's contents are altered. This way, even if the original package is removed or renamed, the installed version will match the one listed in the lockfile.\n\nThe second layer is setting up a private proxy cache for package registries. This cache stores the downloaded packages from the upstream registry, allowing the developer or CI to pull them from the local cache instead of the upstream registry. If the upstream repository removes or modifies a package, the proxy cache still contains the previous version. For npm, Verdaccio can be used to set up a private proxy cache. For Python, devpi-server can be used for the same purpose.\n\nThe third and final layer is mirroring important Git repositories. Some dependencies are not managed through package registries, such as Git submodules, Git URLs, or repositories that have been forked and modified. By creating a local mirror of these repositories, the team ensures that the exact version of the code is available, even if the upstream repository is removed or modified. The mirror can be updated on a regular schedule, and tags should not be pruned to ensure that force-pushed commits do not break the build.\n\nBy implementing these three layers, teams can significantly reduce the risk of build failures caused by upstream repository problems. The checklist provided in the article can be used to ensure that the safety net is properly set up and functioning. This approach helps to maintain a stable build process and reduces the impact of supply chain attacks on the development workflow.",
  "summary": "Tuần này trên Hacker News có tin repo ONNX Runtime của Microsoft biến mất khỏi GitHub. Chưa cần biết lý do là gì, câu hỏi mình đặt ra ngay là: nếu sáng mai một dependency quan trọng của team mình bị xóa, bị đổi tên hoặc bị chuyển sang private, thì CI còn build được không? Với nhiều team mình từng làm cùng, câu trả lời thật là không . Build chạy pip install hoặc npm install thẳng lên internet,…",
  "key_points": [
    "Use lockfiles and hashes to ensure exact dependency versions",
    "Set up private proxy cache for package registries",
    "Mirror important Git repositories to maintain code versions"
  ],
  "editors_take": "Implementing layered defenses like lockfiles and proxy caches shifts dependency management from a reliance on external availability to a model of local control and build stability.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}