Commit 3224de1
feat(rust): scaffold Cargo workspace and Rust CI (#1263)
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>1 parent 0d5d389 commit 3224de1
9 files changed
Lines changed: 142 additions & 0 deletions
File tree
- .github/workflows
- crates
- mergify-cli
- src
- mergify-core
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
47 | 73 | | |
48 | 74 | | |
49 | 75 | | |
| |||
89 | 115 | | |
90 | 116 | | |
91 | 117 | | |
| 118 | + | |
92 | 119 | | |
93 | 120 | | |
94 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments