Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

feat: implement paths for Pipeline #53

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fedeci
Copy link
Contributor

@fedeci fedeci commented Apr 27, 2023

No description provided.

crates/cli/src/main.rs Outdated Show resolved Hide resolved
lib/mod.ts Outdated Show resolved Hide resolved
crates/cli/src/git.rs Outdated Show resolved Hide resolved
@grant0417
Copy link
Contributor

oops, i made conflicts!

@fedeci
Copy link
Contributor Author

fedeci commented Apr 27, 2023

Fixing them!

Comment on lines 12 to 32
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)
}

Copy link
Contributor Author

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.

Copy link
Contributor

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

Comment on lines 515 to 516
std::env::var("CICADA_GIT_BASE"),
std::env::var("CICADA_GIT_HEAD"),
Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants