Skip to content

Commit

Permalink
chore(turbo): add debug logs when filtering with a git range (#8608)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulkar committed Jun 26, 2024
1 parent 9f9f359 commit f93894a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/turborepo-lib/src/run/scope/change_detector.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::collections::HashSet;

use tracing::debug;
use turbopath::{AbsoluteSystemPath, AnchoredSystemPathBuf};
use turborepo_repository::{
change_mapper::{ChangeMapper, DefaultPackageChangeMapper, LockfileChange, PackageChanges},
Expand Down Expand Up @@ -93,7 +94,7 @@ impl<'a> GitChangeDetector for ScopeChangeDetector<'a> {
}

let lockfile_contents = self.get_lockfile_contents(from_ref, &changed_files);

debug!("changed_files: {changed_files:?}");
match self
.change_mapper
.changed_packages(changed_files, lockfile_contents)?
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-lib/src/run/scope/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ impl<'a, T: GitChangeDetector> FilterResolver<'a, T> {
selectors.into_iter().partition::<Vec<_>, _>(|t| !t.exclude);

let mut include = if !include_selectors.is_empty() {
// TODO: add telemetry for each selector
self.filter_graph_with_selectors(include_selectors)?
} else {
self.pkg_graph
Expand Down
5 changes: 5 additions & 0 deletions crates/turborepo-repository/src/change_mapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::collections::HashSet;
pub use package::{
DefaultPackageChangeMapper, GlobalDepsPackageChangeMapper, PackageChangeMapper, PackageMapping,
};
use tracing::debug;
use turbopath::{AbsoluteSystemPath, AnchoredSystemPathBuf};
use wax::Program;

Expand Down Expand Up @@ -109,6 +110,10 @@ impl<'a, PD: PackageChangeMapper> ChangeMapper<'a, PD> {
match self.package_detector.detect_package(file) {
// Internal root dependency changed so global hash has changed
PackageMapping::Package(pkg) if root_internal_deps.contains(&pkg) => {
debug!(
"root internal dependency \"{}\" changed due to: {file:?}",
pkg.name
);
return PackageChanges::All;
}
PackageMapping::Package(pkg) => {
Expand Down

0 comments on commit f93894a

Please sign in to comment.