Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(integrations/cloud_filter): use explicit stat instead of Entry::metadata in fetch_placeholders #5416

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integrations/cloud_filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl Filter for CloudFilter {
})?
.filter_map(|e| async {
let entry = e.ok()?;
let metadata = entry.metadata();
let metadata = self.op.stat(entry.path()).await.ok()?;
let entry_remote_path = PathBuf::from(entry.path());
let relative_path = entry_remote_path
.strip_prefix(&remote_path)
Expand Down
4 changes: 2 additions & 2 deletions integrations/cloud_filter/tests/behavior/fetch_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ pub fn test_fetch_data() -> Result<(), Failed> {

assert_eq!(
expected_content,
file_content(&path).expect("file hash"),
"file hash",
file_content(&path).expect("file content"),
"file content",
)
}
Ok(())
Expand Down
3 changes: 2 additions & 1 deletion integrations/cloud_filter/tests/behavior/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ pub fn file_content(path: impl Display) -> anyhow::Result<String> {
let content = powershell_script::run(&format!("Get-Content \"{path}\""))
.context("run powershell")?
.stdout()
.unwrap_or_default();
.unwrap_or_default()
.replace("\r\n", "\n"); // powershell returns CRLF, but the fixtures use LF
Ok(content)
}

Expand Down
Loading