Skip to content

Conversation

szokeasaurusrex
Copy link
Member

@szokeasaurusrex szokeasaurusrex commented Sep 12, 2025

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

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/update-toolchain-action branch 2 times, most recently from b6b64c1 to 8e765eb Compare September 12, 2025 15:47
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/update-toolchain-action branch from 8e765eb to 2484d23 Compare September 12, 2025 16:00
Copy link

linear bot commented Sep 12, 2025

@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review September 12, 2025 16:15
@szokeasaurusrex szokeasaurusrex requested a review from a team as a code owner September 12, 2025 16:15
// Update rust-toolchain.toml
const fs = require('fs');
const content = fs.readFileSync('rust-toolchain.toml', 'utf8');
const updated = content.replace(/channel = "[\d.]+"/, `channel = "${newVersion}"`);
Copy link

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.

Fix in Cursor Fix in Web

Copy link
Member Author

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

@lcian
Copy link
Member

lcian commented Sep 15, 2025

@szokeasaurusrex I'm ready to approve this but I see CI is failing here for some reason. Might be a flake?
Other than that, would it make sense for the action to also run a cargo clippy --fix or similar, to also auto fix any new lints?

@szokeasaurusrex
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants