ci: only open a Rust toolchain PR when the version changed#485
Merged
Conversation
The nightly updater ran `nix flake update rust-overlay` unconditionally. That bumps the rust-overlay input to its newest revision every night regardless of whether the latest stable Rust actually moved, which always dirties flake.lock. As a result create-pull-request opened a fresh PR each night even when the pinned toolchain was already current. Read the currently pinned version out of rust-toolchain.toml in the check step and compare it against the latest stable, exposing a `changed` output. Gate the Earthfile and toml edits, the Nix install, the flake update, and the PR creation on that flag, so a night with no version bump touches nothing and opens no PR. Signed-off-by: Thomas Yau <thomas.yau@kape.com>
|
Code coverage summary for 036947d: ✅ Region coverage 69% passes |
kp-mariappan-ramasamy
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The nightly Rust update workflow now detects whether the latest stable Rust
actually differs from the version pinned in
rust-toolchain.tomlbefore doingany work. The check step compares the two and exposes a
changedoutput, andevery mutating step — the Earthfile and
rust-toolchain.tomledits, the Nixinstall,
nix flake update rust-overlay, and thecreate-pull-requeststep —is gated on that flag.
Motivation and Context
nix flake update rust-overlayran unconditionally, bumping therust-overlayinput to its newest revision every night regardless of whether the stable Rust
version had moved. That always dirtied
flake.lock, socreate-pull-requestopened a fresh PR each night even when the pinned toolchain was already current.
Gating on an actual version change means an unchanged night touches nothing and
opens no PR.
How Has This Been Tested?
Will manually check if there's no PR created tmr
Types of changes
Checklist:
main