Refine Dependabot config to not update rust-toolchain #1364
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
X
indtolnay/rust-toolchain@X
is a tag, it specifies a particular version of the actual Rust toolchain to use. It is also sometimes used with a branch such asmaster
(to then specify the version as an option rather than in the action version) orstable
, but branches are ineligible for Dependabot version updates and also would not ordinarily require them since they move much more readily than tags. All current uses ofdtolnay/rust-toolchain
fall into one of those cases, and therefore it is not necessary for Dependabot version updates to cover it:Therefore, this tells Dependabot to ignore
dtolnay/rust-toolchain
for the purpose of version updates.Dependabot version updates and Dependabot security updates are separate, but some parts of a
dependabot.yml
file, when present, can affect Dependabot security updates. As commented with details, I have done this in a way that should avoid causing it to be ignored for security updates.push
andpull_request
that run with the same privileges of the user who can cause the triggering event to occur), and I believe the action itself does not get advisories for those versions.Ignoring
dtolnay/rust-toolchain
addresses the problem identified in #1362 (review) without requiring any decreased use of actions to install dependencies, modification of how the actions' versions or options are given, or@dependabot ignore
commands.There might be a benefit to merging this PR before #1362. Assuming I have managed to write the configuration here correctly, it would then be possible to observe that Dependabot no longer attempts the version update on
dtolnay/rust-toolchain
. It might be necessary--and even if not, a good idea--to run@dependabot recreate
on that PR after merging this (unless Dependabot closes that PR and makes a new one).Although Dependabot automatically rebases PRs under many circumstances, and furthermore in most cases you should prefer
@dependabot rebase
to@dependabot recreate
, the latter is needed to cause Dependabot to discard commits you have manually added. Usually one would not wish to do that, but in this case it would make it possible to observe whether Dependabot avoids making the change that the current manually added commit undoes.Since Dependabot alerts provide information about known security advisories and associated updates without requiring any pull requests to be opened automatically--and offer a button that, when clicked, attempts to create an update PR--I recommend having Dependabot alerts enabled for all dependency types, which will be the case if they are enabled in https://github.com/Byron/gitoxide/settings/security_analysis. (They might already been enabled. I cannot tell if those are enabled or not, since I don't have access to that page on repositories I don't own.)
It might also be worthwhile to allow Dependabot to create security updates, since this will happen immediately, whereas I believe
cargo deny
is only running when a push or pull request triggers it. I am not advocating thatcargo deny
not be used, only that Dependabot security updates also be considered. These are separate from Dependabot version updates and much lower in volume. It is also recently a stable feature in Dependabot to group multiple security updates in a pull request.Of course, applying only security updates would, over time, lead to a
Cargo.lock
with old versions that might benefit from being newer even for non-security reasons. Updating and pushing it based on the results ofcargo deny
updates everything in it, which could be considered a benefit. Another approach could be to bring back Dependabot version updates forcargo
dependencies, but group them all together to get just one PR at a time, and set their cadence tomonthly
. This would be safe even without usingcargo deny
(though that could also be used), so long as Dependabot security updates are enabled, because security alerts and security updates would still occur immediately rather than on the version updates cadence.