-
Notifications
You must be signed in to change notification settings - Fork 15
feat: implement paths for Pipeline
#53
base: main
Are you sure you want to change the base?
Conversation
oops, i made conflicts! |
Fixing them! |
f15b70a
to
2b5732c
Compare
crates/cli/src/git.rs
Outdated
pub async fn git_changed_files() -> Result<Vec<String>> { | ||
let output = Command::new("git") | ||
.args(["status", "--ignored=no", "--short"]) | ||
.output() | ||
.await?; | ||
|
||
if !output.status.success() { | ||
return Err(anyhow::anyhow!( | ||
"Failed to get git changed files: {}", | ||
String::from_utf8_lossy(&output.stderr) | ||
)); | ||
}; | ||
|
||
let changed_files = String::from_utf8(output.stdout)? | ||
.lines() | ||
.map(|row| row.trim().split(' ').last().unwrap().to_string()) | ||
.collect(); | ||
|
||
Ok(changed_files) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grant0417 is this CLI run on the backend too? If the answer is affirmative this fn won't work as it tries to detect uncommited changes. It should work correctly in local environment however, I am testing it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this run on the backend as well. We might need to pass more info do you can diff between the from and to branch
c2159c5
to
990bafb
Compare
std::env::var("CICADA_GIT_BASE"), | ||
std::env::var("CICADA_GIT_HEAD"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two new variables should address the problem. The CICADA_GIT_BASE
should contain the hash of the latest commit on which cicada was run (for the same branch/pr), while CICADA_GIT_HEAD
should be the hash of the commit that triggered the run.
No description provided.