TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do you work with Dependabot?

43 点作者 dynamite-ready将近 3 年前
I like the idea of Dependabot. A to that actively tracks down dependency updates can be useful. Where I work, we have a daily CI job that creates a PR for each new dependency and runs a build in both our UI (JavaScript) and API (Python) projects. If the build passes, &quot;Happy Days&quot;, we can merge the PR, and the app is all the more secure and effective for it.<p>What I&#x27;ve noticed in practice however, is that occasionally, this process will allow an upgrade to a dependency that will pass the automated build and test step, but introduce the wildest runtime error into the application. Usually at the time when we aim to deliver something.<p>Dependency &#x27;spam&#x27; is also a very real issue - https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27929596 - the daily deluge of often insignificant updates is a trudge to deal with, especially when coupled with the risk of these sly runtime errors.<p>Dependabot is a great idea, but no-one appears to have anything bad, or practical, to say against it. But it does clearly have flaws.<p>I don&#x27;t think I&#x27;d want to switch the bot off, but I would be interested in hearing how other people get on with the tool.<p>Thanks. :]

23 条评论

dignati将近 3 年前
&gt; What I&#x27;ve noticed in practice however, is that occasionally, this process will allow an upgrade to a dependency that will pass the automated build and test step, but introduce the wildest runtime error into the application. Usually at the time when we aim to deliver something.<p>Sounds like dependabot is very useful for uncovering insufficient test coverage or missing integration tests :)
评论 #32436507 未加载
jraph将近 3 年前
A more useful bot would be named Undependabot. Cuts complexity caused by the dependency bloat by suggesting to remove random dependencies and linking to <a href="http:&#x2F;&#x2F;vanilla-js.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;vanilla-js.com&#x2F;</a>. Flags any PR that introduces new dependencies, and computes the cost in time and money these new dependencies should cost in the long term, and the time and bandwidth usage it adds to each (CI) build. Adds badges to developers and teams that reduce their dependencies or have few or none. Rejects any PR introducing (transitive) dependencies to packages from jonschlinkert.
评论 #32438323 未加载
ncphillips将近 3 年前
Same feelings. I like the idea but in practice I don’t trust it.<p>Or rather, I don’t trust package maintainers to adhere to semver. I prefer to manually go through dependencies updating one at a time and reading the change logs. I usually do this in batch. Peace of mind is worth more than the hour saved every week or two.<p>I do really like the tool that flags security issues with packages though.
评论 #32437668 未加载
评论 #32436989 未加载
geoffharcourt将近 3 年前
I&#x27;ve been using Depfu for a while and I think it handles some of the biggest pain points with Dependency spam.<p>- Package releases don&#x27;t get PRs in their first 24 hours unless they are for security issues, so you don&#x27;t get noise if there&#x27;s a yank or a quick patch for a bug in the latest release<p>- You can set development (or production!) packages to only update once a week<p>- Packages that are known to have a very frequent release cadence (AWS SDK subcomponents, looking at you)_get pushed to a much slower PR pace so that you only update them 2x&#x2F;month, etc.<p>- This might be fixed now, but it had much nicer auto-merge behavior for releases that passed CI.<p>- With Yarn, it can run `yarn-deduplicate` after updates to trim down shared dependency bloat.<p>FWIW we still use Dependabot for security patches only because they seem to get picked up a few hours earlier. We also have much tighter lock rules on some JS packages which seem to make breaking changes on patch&#x2F;minor releases.
kristiandupont将近 3 年前
My strategy is to blindly merge developer dependencies like linter tools etc., with the rationale that if CI succeeds, the dependency didn&#x27;t break anything. Obviously, that is not completely guaranteed but the risk feels small enough that it&#x27;s acceptable.<p>Any update to production dependencies I will want to test manually unless it happens to be a part of the code where I feel exceptionally confident in our test coverage.
hackandtrip将近 3 年前
Did anyone try Renovatebot[1]? It should be OpenSource and endorsed from OpenSSF and Google. Main advantages I see is batched updates, which reduce a bit the dependency update spam.<p>1: <a href="https:&#x2F;&#x2F;renovatebot.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;renovatebot.com&#x2F;</a>
cpswan将近 3 年前
My main gripe is that Dependabot can end up raising multiple PRs for the same dependency bump in the same repo (especially with Dockerfiles). I really wish I could tell it to do rollups e.g. `@dependabot rollup #1234 #1235 #1236` or something like that.<p>To save having to do multiple rounds of merge PR, rebase next PR, wait for CI... I end up doing my own rollup PRs by merging the various Dependabot branches. At least Dependabot is smart enough to close all of the original PRs when the rollup is merged.
评论 #32439088 未加载
mschwaig将近 3 年前
I have not used Dependabot myself, but I wrote a tool that runs in a nightly CI job and creates or updates a single PR per repo with all of the dependency updates. You can then merge those with the push of a button. I think that&#x27;s better than the more granular approach of having one PR per update.<p>This still lets me know when an update to ANY internal or external dependency will break the build, so that I can take a look.<p>My tool only works with Nix Flakes, so it updates dependencies of Nix packages, but you often have other language-specific package managment tools wrapped inside of Nix (e.g. nix calling cargo) and I think it would be a cool extension to add a configuarable language-specific shell command where the results of running that command are added to that single PR as well. That could document the exact update workflow a dev should go through while also regularly exercising it.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;serokell&#x2F;update-daemon" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;serokell&#x2F;update-daemon</a> is a better tool than mine that does the same thing and I have been thinking about adding the feature there. I&#x27;d be interested in discussing that idea further, maybe I&#x27;ll open an issue for that.
Raed667将近 3 年前
At a previous job, we loved the idea of depandabot but in practice it didn&#x27;t match the way we work or review PRs. And as you said, just because a test passed doesn&#x27;t mean that the update is 100% safe.<p>So instead, we identified our critical dependencies, then included dependencies update task to the list of tech-debt tasks we handle every week manually.
评论 #32436450 未加载
codelion将近 3 年前
To address this issue we designed a static analysis that can check if the upgrade is likely to break the application. Here are some details of the work- “Effective Static Checking of Library Updates” <a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;abs&#x2F;10.1145&#x2F;3236024.3275535" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;abs&#x2F;10.1145&#x2F;3236024.3275535</a><p>When using the analysis a PR for upgrading the dependencies would look like this - <a href="https:&#x2F;&#x2F;github.com&#x2F;tmroberts56&#x2F;java-maven&#x2F;pull&#x2F;3" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tmroberts56&#x2F;java-maven&#x2F;pull&#x2F;3</a>
viraptor将近 3 年前
&gt; occasionally, this process will allow an upgrade to a dependency that will pass the automated build and test step, but introduce the wildest runtime error into the application<p>That will then happen whether you use dependabot or another approach. If you don&#x27;t test this manually and don&#x27;t have enough test coverage, you will fail there eventually.<p>Dependabot helps you fail here early when you have N packages that changed and it&#x27;s easy to figure out what happened, rather than wait until you&#x27;re upgrading 10*N packages together and have to isolate things manually.
chrismorgan将近 3 年前
I’ve only really experienced Dependabot for <i>libraries</i>, rather than applications, and in that context I don’t really understand why it exists or why people use it.<p>If you’re making a library and it bumps the lower version bounds of your dependencies, it’s doing something that’s actively slightly harmful. It’d be fine to notify you about major&#x2F;incompatible version bumps, <i>maybe</i> even try them to see if they work (though certainly don’t apply the change automatically—a major version bump on a dependency is regularly a breaking change even if your tests still pass). But minor&#x2F;patch&#x2F;compatible releases that are already accepted by the version specifier? You shouldn’t be bumping those. Test against them if you like, <i>maybe</i> update your testing lockfile, but generally speaking the versions of libraries are an <i>application</i> concern, and your library <i>should not</i> be trying to dictate it.<p>(I must admit that the whole concept of compatible ranges is in practice slightly broken through and through, though it seldom causes trouble. I would love to have tooling that actively minimised dependency versions: “1.2.3? Turns out the newest functionality you’re depending on is from 1.1.0, so I’ll reduce the spec to ‘1.1’.” This would, of course, need to be paired with checking that you don’t accidentally use newer functionality—at the least, running your tests on minimum versions, preferably stronger API checks. Overall it’s the sort of thing that is difficult to make robust by any means in the likes of JavaScript and Python, but which could sanely be done in Rust, and there’s enough interest that I think something will probably happen within the next decade.)<p>But applications? Sure, this is where Dependabot has an actual sane purpose. But presuming people tend to have it configured in similar ways to how they configure it in libraries… ugh. I’d still rather just do roughly what it does manually from time to time.
drawkbox将近 3 年前
Software went from DLL Hell [1] to Dependency Hell [2]. Only now there is a dependency war so it is much more dangerous, and so many more dependencies.<p>Dependabot has to be used because of the threats. However everyone automating and moving to latest is also a threat. SolarWinds&#x2F;VMWare&#x2F;USGov hack [3] was all related to CI builds and automated &quot;trust&quot;, ended up infecting tens of thousands of systems that thought they were secure with SOC2. SOC2 ends up making enterprises &quot;trust&quot; many third parties. What happens when dependabot is an attack vector as well...<p>The log4j&#x2F;Log4Shell [4] issue shows how long exploits can go on without detection or automated fixes. Node is filled with dependency issues and that is just the known exploits besides all the &quot;telemetry&quot;. [5]<p>Any third party or dependency is a potential attack vector, and dependency saturation is adding lots of tedium to shipping. So much time goes to just updating libs it is a bit of a tragic comedy.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;DLL_Hell" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;DLL_Hell</a><p>[2] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dependency_hell" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dependency_hell</a><p>[3] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;2020_United_States_federal_government_data_breach" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;2020_United_States_federal_gov...</a><p>[4] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Log4Shell" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Log4Shell</a><p>[5] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Npm_(software)#Notable_breakages" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Npm_(software)#Notable_breakag...</a>
fmorel将近 3 年前
We don&#x27;t use it on our Node app because it would be too noisy. Another noisy library was the AWS SDK for .NET. In that case, I actually use a wildcard version range `3.7.*` to always have the latest patch release and cut down on Dependabot noise.<p>We have it on for everything else (.NET&#x2F;Nuget, Ruby, Docker, GitHub Actions, Git Submodule). It&#x27;s great at keeping us up to date with little effort. For major (and some minor) releases, I&#x27;ll read release notes to see if there&#x27;s anything to watch out for.<p>It&#x27;s especially useful for updating the git repo we use as a submodule in 5 other repos. Submodules were a source of frequent merge conflicts before as different developers updated it in their PRs. Now we pretty much don&#x27;t think about it, and Dependabot keeps it up to date with our latest database models and shared libraries.<p>edit: We have it set to weekly for everything but the submodule, which is daily.
marekdedic将近 3 年前
I use it in 2 different ways depending on the project.<p>1) For more important projects I have high test coverage (over 95%) and integration tests. In this setting, I have dependabot set to check once a week and the PRs get automatically merged if everything works. I have never had a problem with this setup, if the update breaks something, the tests fail and I get to fix it manually.<p>2) For less important projects without CD, I usually merge dev dependencies and minor versions by hand if there isn&#x27;t something obviously wrong in the CI. Yeah, there&#x27;s a risk it breaks something, but I can fix that before a release - obviously these are projects that only get worked on occasionally. Major versions I usually check manually before merging.<p>I think the ultimate answer is good testing as part of CI. Either you trust your tests and then I think it&#x27;s ok to auto-merge, or you don&#x27;t and then all bets are of...
eurasiantiger将近 3 年前
Someone knowledgeable of the codebase reviews changelogs of individual packages. They merge all simple cases and flag any breaking changes and anything that affects features used in the codebase. These can then be tested&#x2F;fixed by others not so deeply familiar with the codebase, which fuels knowledge transfer.
tolkienfanatic将近 3 年前
For people complaining that Dependabot is too noisy, it is easy to configure it to only open PRs for major versions.<p>I am a big fan of Dependabot, but maximizing its effective is highly dependent on the culture of the team&#x2F;codebase.
TruthWillHurt将近 3 年前
I set it up on a repo, then delete emails I recieve from it.
评论 #32436695 未加载
shaftoe444将近 3 年前
Dependabot made me move some side projects away from React cos it really highlighted how many dependencies I was bringing in without realising.
andrew_将近 3 年前
Disabling it on a repository is one of the first things I do. I tend not to like how noisy it is on Node project. Instead, I have scheduled tasks which audit periodically.
antifa将近 3 年前
It would be really helpful if dependabot mentioned how much bigger my build size would be relative to the main branch.
oweiler将近 3 年前
Dependabot only works reliably with lots of integration tests.
blibble将近 3 年前
I ignore everything it says, for me it&#x27;s just noise