Skip to content
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

PM-13335 - Pin Rust version and introduce Renovate #17

Merged

Conversation

tangowithfoxtrot
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13335

📔 Objective

Add Renovate managers so we can pin the Rust and Rust nightly toolchains in our workflows.

📸 Screenshots

image

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@tangowithfoxtrot tangowithfoxtrot changed the title add rust and rust-nightly managers PM-13335 - Pin Rust version and introduce Renovate Jan 17, 2025
},
"customDatasources": {
"rust-nightly": {
"defaultRegistryUrlTemplate": "https://renovate-rust-nightly.phi-ag.workers.dev/"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using a community-made Cloudflare worker. The source for it is here.

It would probably be ideal if we hosted our own for the sake of reliability. Thoughts?

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid the nightly support? Do we really need that? Seems unadvisable, and then we avoid custom datasources.

In parallel, if custom datasources are truly needed, I would think that's an investment to be proposed with Mend themselves and for it to become a first-class datasource that I have seen added via community contributions in the past (and not some Cloudflare worker that I don't support us using or implementing).

@tangowithfoxtrot
Copy link
Contributor Author

@withinfocus I'd also prefer to avoid nightly toolchains, but the linting/formatting features we use, a tool we use to detect unused dependencies, and some rustdoc features all require usage of features that are not allowed on stable Rust toolchains.

There is an open PR for Renovate to support managing stable Rust toolchains via the rust-toolchain.toml file, but that still wouldn't handle our need for managing the nightly toolchains.

@withinfocus
Copy link
Contributor

I pinged the Renovate PR author to see if we can help there.

Given my lack of Rust experience, can you show me what a Renovate PR would look like here? I see uses of certain versions in Cargo files but also stable, and for the nightly usages it's just nightly ... I don't know what this will create really.

@tangowithfoxtrot
Copy link
Contributor Author

@withinfocus Sure! Here's a rust-nightly PR and a rust PR.

We're currently just invoking nightly as +nightly, but in order to use a pinned version, you would do this: +nightly-YYYY-MM-DD. The Renovate PRs would just update the date string for us.

Both the stable and nightly releases would be handled from a new rust-toolchain.toml file in the repo root. I probably should have mentioned that in my previous comment 😅

The rust-version defined in our Cargo file refers to the MSRV. I don't know of any hard-and-fast guidelines for how often that needs to be updated, but it seems like a value we probably wouldn't want Renovate to manage for us.

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the toolchain configuration file existence was the missing part for me; I see it on your fork.

I'm a bit hesitant to approve here, but I do see this as a workable solution for now. While the dude's CF worker might not be the most reliable, it's something Renovate is invoking and it's not really exposing us to anything, and given the frequency and how Renovate works in general with clear logs about how it's running, this will do.

I look forward to enhanced Renovate support directly though.

@tangowithfoxtrot tangowithfoxtrot merged commit c7eb274 into main Jan 21, 2025
2 checks passed
@tangowithfoxtrot tangowithfoxtrot deleted the pm-13335-pin-rust-version-and-introduce-renovate branch January 21, 2025 18:11
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