Skip to content

Add initial Rust commit validator - #1

Closed
Mshehu5 wants to merge 4 commits into
fungi-protocol:mainfrom
Mshehu5:commit-validation
Closed

Mshehu5 wants to merge 4 commits into
fungi-protocol:mainfrom
Mshehu5:commit-validation

Conversation

@Mshehu5

@Mshehu5 Mshehu5 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

This PR sets up the Rust project and implements the first commit-validation MVP. The CLI accepts a Git revision range, runs nix flake check on each commit in order, and stops on the first failure. tests for the main validation flow and minimum CI.

@yuval-block yuval-block left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

only skimmed, didn't scrutinize

  • please make main.rs a thin wrapper around a testable lib.rs
  • use jj-lib, gitoxide or gitlib2 (different tradeoffs we can discuss) instead of parsing git cli output
  • avoid stringly typed data in rust, main advantage over say python is we can define clean algebraic data types for everything
  • avoid external commands for things like mktemp, equivalent rust code will be cleaner and more portable & reliable
  • split flake.nix into separate flake parts, flake.nix itself should be minimal composition of parts coming from the repo
  • use crane and rust-overlay
  • avoid README.md for now let's first figure out what we want the code to be then document it

@Mshehu5
Mshehu5 force-pushed the commit-validation branch 2 times, most recently from f2cff7d to bdcf212 Compare September 17, 2026 20:58
@Mshehu5

Mshehu5 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Addressed comment

Comment thread src/lib.rs Resolved
Comment thread tests/cli.rs Resolved
Comment thread Cargo.toml Outdated
edition = "2024"
description = "Run Nix flake checks for every commit in a revision range"
license = "MIT"
repository = "https://github.com/Mshehu5/validate-commits"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The repository field points to the personal fork https://github.com/Mshehu5/validate-commits instead of the canonical project repository fungi-protocol/validate-commits that this PR targets, so crate metadata directs tooling and users to a fork rather than the project home.

Comment thread tests/cli.rs Outdated
}
}

fn history_commit(fixture: &Fixture, message: &str, parents: &[ObjectId]) -> ObjectId {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

history_commit and assert_symmetric_difference are added but no #[test] in this file calls either helper, so cargo test emits dead_code warnings on every build and the symmetric-difference (A...B / Spec::Merge) coverage they were written for never executes.

Comment thread .github/workflows/ci.yml
contents: read

jobs:
checks:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The checks job sets no timeout-minutes, so a hung step (e.g. a stalled nix flake check build or substituter) runs until GitHub's hosted-runner default of 360 minutes cancels it; an explicit bound would cap wasted runner time.

@Mshehu5

Mshehu5 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

replaced by #4

@Mshehu5 Mshehu5 closed this Oct 14, 2026
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.

3 participants