Add symmetry filter support and improve round-trip check#38
Add symmetry filter support and improve round-trip check#38makai410 wants to merge 1 commit intorust-lang:mainfrom
Conversation
There was a problem hiding this comment.
We should probably start using the new Josh CLI in josh-sync, I feel like we are reimplementing a lot of stuff in josh-sync that is already there as a single command :) In any case, if this helps your use-case, it seems fine.
I would maybe rename sym-filter to subtree-filter or something, to make it more explicit about what it does, but it doesn't matter much, sym-filter is fine too.
| } | ||
|
|
||
| pub fn try_install_josh_filter(verbose: bool) -> Option<JoshFilter> { | ||
| run_command( |
There was a problem hiding this comment.
Can you please pin the version/tag/commit SHA? I don't want josh-sync to install unpinned versions of Josh, we had enough trouble with that in the past.
| } | ||
| } | ||
|
|
||
| pub fn run_command_by_path<'a, Args: AsRef<[&'a str]>>( |
There was a problem hiding this comment.
Why was a new function needed here?
| #[serde(default, skip_serializing_if = "Vec::is_empty")] | ||
| pub post_pull: Vec<PostPullOperation>, | ||
| /// Optional symmetry filter applied to the local `HEAD` during round-trip check. | ||
| pub sym_filter: Option<String>, |
There was a problem hiding this comment.
| pub sym_filter: Option<String>, | |
| #[serde(default, skip_serializing_if = "Option::is_none")] | |
| pub sym_filter: Option<String>, |
Otherwise the config would fail to be parsed if the field is missing, I think.
Fixes: #37
To explain what the symmetry filter is, here's an example with rustc_public:
The
filteris applied to the rust-lang/rust side, whilesym-filteris applied to the rust-lang/project-stable-mir side. Ideally, both should produce the same SHA, confirming a successful round-trip.For repos doing a 1:1 mirror,
sym-filtershould be empty, in that case this PR will not download thejosh-filtertool.And basically, the round-trip check in this PR looks like: