Repository navigation
rust: check Cargo.lock downgrades with a pinned action - #375
Conversation
Rolv-Apneseth
left a comment
There was a problem hiding this comment.
Won't block, but thoughts on having this be a standalone action? Like https://github.com/Garfield1002/cargo-no-downgrades, though I guess we probably don't want to trust that one ourselves. So maybe we host one in https://github.com/bootc-dev/actions?
|
Or maybe we could trust that action if we pin by sha? Their approach with using |
|
Hmm, this seems like something to fix in renovate/dependabot?
(Thanks for bringing that up, I would love to have more usage of that in the coreos/ org)
Probably yeah, I glanced at the code and it's small and looks sane, but I'd like to understand better how the downgrade happened in the first place |
When I was looking at this earlier I saw quite a few issues open against cargo related to this, e.g. |
|
Hey, thanks for the feedback all! @cgwalters The release branch was cut from main when On renovate/dependabot — agree they'd help keep main fresh, but I don't think they'd catch this specific case. The downgrade happened because of branch-cut timing, not because a dep went stale. rust-lang/cargo#13942 has some good context on why the resolver behaves this way. @Rolv-Apneseth good call on Happy to drop this if you think there's a better place to catch it — just wanted to make sure we had a safety net for this failure mode. |
@prestist I don't think we should drop it, I just meant maybe we can have an action hosted there and use it here. Or use the action I linked if we don't think it's worth hosting our own. I'd personally lean towards using the existing one as long as we pin it. |
|
Agreed, no reason to duplicate work, if it exists might as well consume it lol |
ea167ba to
f1477d9
Compare
|
No reply yet on Garfield1002/cargo-no-downgrades#1 (comment), we might need to patch + host ourselves I suppose. |
|
We have now forked and patched the action so we do not need to wait for an upstream response on Garfield1002/cargo-no-downgrades#1. The fixes are on The fork catches dependency switches even when both versions remain locked, and fixes SemVer prerelease ordering. All 38 regression tests pass, including the original coreos-installer rand downgrade; fork CI is green. Local rendering, renderer tests, and actionlint also pass with the new pin. This is temporary: we can switch back to a verified upstream commit once equivalent fixes land. I have left this PR as a draft because the separate-workflow/label-concurrency and custom-repository coverage work described above is still outstanding. Update: this PR is now squashed into one commit. Both its commit and the fork fix commit include |
Use a SHA-pinned patched cargo-no-downgrades fork to detect dependency downgrades, including switches hidden by multiple locked versions. Allow intentional downgrades with a label and skip repositories without a base lockfile while upstream issue #1 is unresolved. Assisted-by: OpenCode (AI tooling)
f8112f5 to
eee9b20
Compare
Summary
Use a temporary patched fork of Garfield1002/cargo-no-downgrades while upstream issue #1 remains unresolved.
The action now comes from prestist/cargo-no-downgrades, branch
fix-downgrade-detection, pinned to the full commit SHAe34e8a1894e48119667dbe321f2059d60aaf4d6erather than a moving branch or the inherited upstream tag. The template identifies the branch and links the upstream issue so we can switch back to a verified upstream SHA once equivalent fixes land.Fork fixes
rand 0.9.5to0.8.8while both versions remain locked, including when the installer release version changes.alpha.2 < alpha.10.Remaining work before merging
This PR remains a draft for the remaining integration work; the upstream action blocker is addressed by the temporary fork.
Validation
6235c0ad53f66273bee3a357d5687e97afeca635and42716b7da1f17ca686c04ac40b5ee4a40427396f. Self-comparisons and the corrected release lockfile pass.