-
-
Notifications
You must be signed in to change notification settings - Fork 234
ci(rust): Auto-update rust-toolchain.toml #2746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
b6b64c1
to
8e765eb
Compare
8e765eb
to
2484d23
Compare
// Update rust-toolchain.toml | ||
const fs = require('fs'); | ||
const content = fs.readFileSync('rust-toolchain.toml', 'utf8'); | ||
const updated = content.replace(/channel = "[\d.]+"/, `channel = "${newVersion}"`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Regex Fails for Non-Numeric Rust Channels
The regex for updating rust-toolchain.toml
is very specific, only matching numeric channels with double quotes and exact spacing. This means it might silently fail to update the file for common non-numeric channels (e.g., "stable") or if the file uses different formatting, leading to empty pull requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay, as our rust-toolchain.toml is formatted predictably
@szokeasaurusrex I'm ready to approve this but I see CI is failing here for some reason. Might be a flake? |
Yeah, test failures are unrelated, they were also failing on master last week. It seems to be failing consistently though, not a flake. Gonna investigate this. Autofixing new lints sounds like a good idea though! But maybe I'll make another PR to add that |
Automatically make PRs to bump the Rust toolchain version pinned in
rust-toolchain.toml
.The PRs will look like #2748, which was generated against #2747, which builds on top of this PR.
Fixes CLI-167