diff --git a/components/polylith/diff/collect.py b/components/polylith/diff/collect.py index 9fb7e141..edd94f7d 100644 --- a/components/polylith/diff/collect.py +++ b/components/polylith/diff/collect.py @@ -5,14 +5,16 @@ from polylith import repo, workspace -def _parse_brick_name(folder: str, changed_file: Path) -> str: +def _parse_folder_parts(folder: str, changed_file: Path) -> str: file_path = Path(changed_file.as_posix().replace(folder, "")) return next(p for p in file_path.parts if p != file_path.root) def _get_changed(folder: str, changed_files: List[Path]) -> set: - return {_parse_brick_name(folder, f) for f in changed_files if folder in f.as_posix()} + return { + _parse_folder_parts(folder, f) for f in changed_files if folder in f.as_posix() + } def _get_changed_bricks( diff --git a/components/polylith/diff/report.py b/components/polylith/diff/report.py index 86ed53e6..b29f8671 100644 --- a/components/polylith/diff/report.py +++ b/components/polylith/diff/report.py @@ -78,7 +78,7 @@ def _changed_projects( projects_data: List[dict], brick_type: str, bricks: List[str] ) -> set: res = { - p["name"]: set(p.get(brick_type, [])).intersection(bricks) + p["path"].name: set(p.get(brick_type, [])).intersection(bricks) for p in projects_data }