Skip to content

feat(rust): scaffold Cargo workspace and Rust CI#1263

Merged
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7
Apr 22, 2026
Merged

feat(rust): scaffold Cargo workspace and Rust CI#1263
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 20, 2026

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

@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(rust): scaffold Cargo workspace and Rust CI #1263 👈
2 feat(rust): add mergify-py-shim with embedded Python fallback #1272
3 feat(rust): add mergify-core foundation types (Phase 1.2a) #1280
4 feat(rust): add mergify-core::http with retry + typed errors (Phase 1.2b) #1281
5 feat(rust): port config validate to native Rust (Phase 1.3) #1282

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7 branch from d51f97a to 3cfbdbd Compare April 20, 2026 16:33
@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

Revision history

# Type Changes Reason Date
1 initial d51f97a 2026-04-20 16:33 UTC
2 rebase d51f97a → 3cfbdbd 2026-04-20 16:33 UTC
3 content 3cfbdbd → 47fd5c0 2026-04-21 08:00 UTC
4 rebase 47fd5c0 → 576b4cc 2026-04-21 09:10 UTC
5 rebase 576b4cc → a5202f3 2026-04-21 13:13 UTC
6 content a5202f3 → 3d0f335 2026-04-22 13:36 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 16:34 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 branch from a651c13 to 6703ebf Compare April 21, 2026 08:00
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7 branch from 3cfbdbd to 47fd5c0 Compare April 21, 2026 08:00
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 21, 2026 08:00 Failure
@mergify mergify Bot requested a review from a team April 21, 2026 08:06
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7 branch from 47fd5c0 to 576b4cc Compare April 21, 2026 09:10
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 21, 2026 09:11 Failure
Base automatically changed from devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 to main April 21, 2026 13:11
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

@jd this pull request is now in conflict 😩

@mergify mergify Bot added the conflict label Apr 21, 2026
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7 branch from 576b4cc to a5202f3 Compare April 21, 2026 13:13
@jd jd marked this pull request as ready for review April 21, 2026 13:14
Copilot AI review requested due to automatic review settings April 21, 2026 13:14
@mergify mergify Bot removed the conflict label Apr 21, 2026
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 21, 2026 13:14 Failure
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) and mergify-core (shared crate placeholder).
  • Add a Rust CI job to run fmt, clippy, test, and build --release, plus Rust toolchain configuration and target/ 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.

Comment thread .github/workflows/ci.yaml Outdated
Comment thread Cargo.toml
Comment thread rust-toolchain.toml
Comment thread crates/mergify-core/src/lib.rs Outdated
Comment thread crates/mergify-core/src/lib.rs Outdated
Copy link
Copy Markdown
Contributor

@kozlek kozlek left a comment

Choose a reason for hiding this comment

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

The suggested GitHub Action is not that popular...

This one - dtolnay/rust-toolchain - is trusted by Pydantic and features much more stars.

@mergify mergify Bot requested a review from a team April 21, 2026 13:30
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
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7 branch from a5202f3 to 3d0f335 Compare April 22, 2026 13:36
@mergify mergify Bot deployed to Mergify Merge Protections April 22, 2026 13:36 Active
@mergify mergify Bot requested a review from a team April 22, 2026 14:03
Copy link
Copy Markdown
Contributor

@remyduthu remyduthu left a comment

Choose a reason for hiding this comment

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

Let's gooo!

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 22, 2026

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

mergify Bot added a commit that referenced this pull request Apr 22, 2026
@mergify mergify Bot added the queued label Apr 22, 2026
mergify Bot added a commit that referenced this pull request Apr 22, 2026
@mergify mergify Bot merged commit 3224de1 into main Apr 22, 2026
13 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-rust-port/scaffold-cargo-workspace-rust-ci--4b278cf7 branch April 22, 2026 15:27
@mergify mergify Bot removed the queued label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants