Skip to content

Rust adapter: map files to Cargo packages and test targets #58

Closed

Description

@adityankale190895

Part of the Rust (Cargo) adapter: #62.

Map every Rust file to the Cargo package and target it belongs to. This is the base for everything else in the Rust adapter, and it doesn't need any dependency analysis yet.

Scope

  • In src/repo/adapters/rust.ts (new file), run cargo metadata --format-version 1 --no-deps (the Go adapter does the same with go list; see src/repo/adapters/go.ts) and read the workspace members, their manifest_path and their targets (lib, bin, test, bench, example).
  • Assign each .rs file to a package: files under a package's directory belong to it, with nested packages taking precedence.
  • Treat integration tests (tests/*.rs and test targets) as test files. Unit tests inside src/ (#[cfg(test)]) mean the whole crate runs as a test target.
  • Fill testPackages so later steps know which package owns each test.

Must fall back (blocker)

  • cargo not installed, cargo metadata failing, or a file that belongs to no package.

Done when

  • Fixtures cover a single crate, a workspace with two members, and a nested package. Tests skip cleanly when cargo isn't installed, like the Go tests do.

Safety rule: when the adapter is unsure, it adds a blockers entry so DiffCI runs the full suite. An empty graph must never look like "nothing affected".


New to DiffCI? Read the adapter guide and CONTRIBUTING.md. Sign off commits with git commit -s. Comment here to claim it, and ask questions on the issue at any point.

Activity

  1. added
    enhancement
    good first issue
    on Oct 29, 2026
  2. FredApps commented on Nov 10, 2026

    @FredApps
    Contributor

    Claiming this as the first step of #62. The mapping implementation and regression fixtures are ready for a draft PR; it stays unregistered until the dependency and execution milestones are in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    adapterenhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions