feat(rust): scaffold Cargo workspace and Rust CI#1263
Conversation
|
This pull request is part of a Mergify stack:
|
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
d51f97a to
3cfbdbd
Compare
Revision history
|
a651c13 to
6703ebf
Compare
3cfbdbd to
47fd5c0
Compare
47fd5c0 to
576b4cc
Compare
|
@jd this pull request is now in conflict 😩 |
576b4cc to
a5202f3
Compare
There was a problem hiding this comment.
Pull request overview
Scaffolds an initial Rust Cargo workspace for the upcoming CLI port, including a stub mergify binary, an (currently empty) shared core crate, and CI wiring to enforce Rust formatting/linting/testing/build.
Changes:
- Add a Cargo workspace (
Cargo.toml) with workspace-wide lints and release profile defaults. - Introduce two new Rust crates:
mergify-cli(stub binary) andmergify-core(shared crate placeholder). - Add a Rust CI job to run
fmt,clippy,test, andbuild --release, plus Rust toolchain configuration andtarget/ignore.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| rust-toolchain.toml | Adds Rust toolchain configuration (stable + components). |
| Cargo.toml | Defines workspace members, MSRV/edition, lints, and release profile. |
| Cargo.lock | Adds initial lockfile for the new workspace/crates. |
| crates/mergify-core/Cargo.toml | Declares the shared core crate and inherits workspace settings. |
| crates/mergify-core/src/lib.rs | Adds crate-level docs and a version constant used by the CLI stub. |
| crates/mergify-cli/Cargo.toml | Declares the CLI crate, binary name, and dependency on mergify-core. |
| crates/mergify-cli/src/main.rs | Adds the Phase 1.0 stub binary that prints an identification line. |
| .github/workflows/ci.yaml | Adds a rust job and gates merges on it. |
| .gitignore | Ignores Rust target/ build artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kozlek
left a comment
There was a problem hiding this comment.
The suggested GitHub Action is not that popular...
This one - dtolnay/rust-toolchain - is trusted by Pydantic and features much more stars.
Introduces the Rust toolchain skeleton for the upcoming port. Ships nothing functional — the binary prints an identification line and exits 0. The value of this commit is the groundwork: a reviewable workspace layout, lint/test/release pipeline wired into CI, and a clear toolchain policy so subsequent phases have a stable foundation. ## Layout ``` Cargo.toml # workspace root rust-toolchain.toml # tracks latest stable + rustfmt/clippy crates/ mergify-cli/ # [[bin]] name = "mergify"; Phase 1.0 stub mergify-core/ # shared foundations (empty today; filled in 1.2) ``` Per the design, more crates (`mergify-py-shim`, one per command group) land in later phases. The 2-crate start is deliberate: the workspace exists, the lints and profile are set workspace-wide, but there is nothing for a reviewer to miss. ## Conventions - Edition 2024, MSRV `rust-version = 1.85` (edition-2024 minimum). - ``rust-toolchain.toml`` uses ``channel = "stable"`` — tracks the current stable toolchain, not a specific pinned version. Renovate can bump it later if we want a narrower contract. - Workspace-level lints: `unsafe_code = "forbid"`, `clippy::all`, `clippy::pedantic`. A small allow-list (`module_name_repetitions`, `missing_errors_doc`, `missing_panics_doc`) kills noise that would otherwise dominate a CLI with many small modules. Revisit per-PR. - Release profile: thin LTO, single codegen unit, symbols stripped — reduces binary size for `cargo-dist` output in Phase 1.5. ## CI New `rust` job on ubuntu-24.04: ``rustup toolchain install stable`` explicitly (so the build is deterministic against whatever the runner image has cached), then ``cargo fmt --check``, ``cargo clippy -D warnings``, ``cargo test``, ``cargo build --release``. Added to ``ci-gate`` so a red Rust job blocks merge just like linters and tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Change-Id: I4b278cf7800294f4f01758618fe5c125b7bb082d
a5202f3 to
3d0f335
Compare
Merge Queue Status
This pull request spent 6 minutes 49 seconds in the queue, including 6 minutes 21 seconds running CI. Required conditions to merge
|
Introduces the Rust toolchain skeleton for the upcoming port. Ships
nothing functional — the binary prints an identification line and
exits 0. The value of this commit is the groundwork: a reviewable
workspace layout, lint/test/release pipeline wired into CI, and a
clear toolchain policy so subsequent phases have a stable foundation.
Layout
Per the design, more crates (
mergify-py-shim, one per command group)land in later phases. The 2-crate start is deliberate: the workspace
exists, the lints and profile are set workspace-wide, but there is
nothing for a reviewer to miss.
Conventions
rust-version = 1.85(edition-2024 minimum).rust-toolchain.tomluseschannel = "stable"— tracks thecurrent stable toolchain, not a specific pinned version. Renovate
can bump it later if we want a narrower contract.
unsafe_code = "forbid",clippy::all,clippy::pedantic. A small allow-list (module_name_repetitions,missing_errors_doc,missing_panics_doc) kills noise that wouldotherwise dominate a CLI with many small modules. Revisit per-PR.
reduces binary size for
cargo-distoutput in Phase 1.5.CI
New
rustjob on ubuntu-24.04:rustup toolchain install stableexplicitly (so the build is deterministic against whatever the
runner image has cached), then
cargo fmt --check,cargo clippy -D warnings,cargo test,cargo build --release. Added toci-gateso a red Rust job blocks merge just like linters andtests.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com