Skip to content

Commit

Permalink
rust-project: Warn on unowned files
Browse files Browse the repository at this point in the history
Summary: Log a warning message if we can't determine the owner of a file passed to `develop`, but _is_ in fbsource (i.e., we already log if buck can't determine an owner because it's outside of the repo, but now we also log if it's in the repo but unowned).

Reviewed By: Wilfred

Differential Revision: D57947948

fbshipit-source-id: 1fd06b41341503b58e39748e994cd14f18880a6c
  • Loading branch information
darichey authored and facebook-github-bot committed Jun 1, 2024
1 parent bdedc54 commit 681c0d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion integrations/rust-project/src/cli/develop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Develop {
}

pub fn resolve_file_owners(&self, files: &[PathBuf]) -> FxHashMap<PathBuf, Vec<Target>> {
match self.buck.query_owner(&files) {
let owners = match self.buck.query_owner(&files) {
Ok(owners) => owners,
Err(_) => {
let mut owners = FxHashMap::default();
Expand All @@ -187,7 +187,15 @@ impl Develop {

owners
}
};

for (file, targets) in owners.iter() {
if targets.is_empty() {
warn!(file = ?file, "Buck returned zero targets for this file.");
}
}

owners
}

pub(crate) fn run(&self, targets: Vec<Target>) -> Result<JsonProject, anyhow::Error> {
Expand Down

0 comments on commit 681c0d2

Please sign in to comment.