-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tasks): add commit sha to snapshots to make sure submodules are…
… not outdated closes #2819
- Loading branch information
Showing
26 changed files
with
111 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use std::{ | ||
env, | ||
fs::{self, File}, | ||
io::Write, | ||
path::Path, | ||
process::Command, | ||
}; | ||
|
||
pub struct Snapshot { | ||
sha: String, | ||
} | ||
|
||
impl Snapshot { | ||
/// # Panics | ||
/// | ||
/// * Git operation fails | ||
pub fn new(git_repo_path: &Path) -> Self { | ||
let path = git_repo_path.to_str().unwrap(); | ||
let output = Command::new("git") | ||
.args(["-C", path, "rev-parse", "--short", "HEAD"]) | ||
.output() | ||
.unwrap() | ||
.stdout; | ||
let sha = String::from_utf8(output).unwrap().trim().to_string(); | ||
Self { sha } | ||
} | ||
|
||
/// # Panics | ||
/// | ||
/// * File operation fails | ||
pub fn save(&self, path: &Path, content: &str) { | ||
if path.exists() { | ||
let file = fs::read_to_string(path).unwrap(); | ||
if let Some(old_sha) = file.lines().next().unwrap().strip_prefix("commit: ") { | ||
let outdated = self.sha != old_sha && env::var("UPDATE_SNAPSHOT").is_err(); | ||
assert!( | ||
!outdated, | ||
"\nRepository is outdated, please run `just submodules` to update it.\n" | ||
); | ||
} | ||
} | ||
|
||
let mut file = File::create(path).unwrap(); | ||
let content = format!("commit: {}\n\n{content}", self.sha); | ||
file.write_all(content.as_bytes()).unwrap(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
codegen_babel Summary: | ||
AST Parsed : 2099/2099 (100.00%) | ||
Positive Passed: 2099/2099 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 78d1d3a7 | ||
|
||
codegen_misc Summary: | ||
AST Parsed : 16/16 (100.00%) | ||
Positive Passed: 16/16 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 17ba9aea47 | ||
|
||
codegen_test262 Summary: | ||
AST Parsed : 45836/45836 (100.00%) | ||
Positive Passed: 45836/45836 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
minifier_babel Summary: | ||
AST Parsed : 1638/1638 (100.00%) | ||
Positive Passed: 1638/1638 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 17ba9aea47 | ||
|
||
minifier_test262 Summary: | ||
AST Parsed : 45836/45836 (100.00%) | ||
Positive Passed: 45836/45836 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
parser_babel Summary: | ||
AST Parsed : 2093/2099 (99.71%) | ||
Positive Passed: 2086/2099 (99.38%) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 78d1d3a7 | ||
|
||
parser_misc Summary: | ||
AST Parsed : 16/16 (100.00%) | ||
Positive Passed: 16/16 (100.00%) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
prettier_babel Summary: | ||
AST Parsed : 2099/2099 (100.00%) | ||
Positive Passed: 1893/2099 (90.19%) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 78d1d3a7 | ||
|
||
prettier_misc Summary: | ||
AST Parsed : 16/16 (100.00%) | ||
Positive Passed: 9/16 (56.25%) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
transformer_babel Summary: | ||
AST Parsed : 2099/2099 (100.00%) | ||
Positive Passed: 2099/2099 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 78d1d3a7 | ||
|
||
transformer_misc Summary: | ||
AST Parsed : 16/16 (100.00%) | ||
Positive Passed: 16/16 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 17ba9aea47 | ||
|
||
transformer_test262 Summary: | ||
AST Parsed : 45836/45836 (100.00%) | ||
Positive Passed: 45836/45836 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 64d2eeea7b | ||
|
||
transformer_typescript Summary: | ||
AST Parsed : 5243/5243 (100.00%) | ||
Positive Passed: 5243/5243 (100.00%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
Passed: 308/362 | ||
|
||
# All Passed: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
Passed: 1/3 | ||
|
||
# All Passed: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
Passed: 2/2 | ||
|
||
# All Passed: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
commit: 4bd1b2c2f1 | ||
|
||
Passed: 0/0 | ||
|
||
# All Passed: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters