(tree, parent_names=None)
| 172 | changed_set = set(changed_files) |
| 173 | modules_to_invalidate = set() |
| 174 | |
| 175 | def _find_affected(tree, parent_names=None): |
| 176 | if parent_names is None: |
| 177 | parent_names = [] |
| 178 | for mod_name, mod_info in tree.items(): |
| 179 | components = mod_info.get("components", []) |
| 180 | # Check if any component path overlaps with changed files |
| 181 | for comp in components: |
| 182 | # Component IDs may be class names, check if they match any changed file path |
| 183 | if any(changed_file in comp or comp in changed_file for changed_file in changed_set): |
| 184 | modules_to_invalidate.add(mod_name) |
| 185 | # Also invalidate parent modules |
| 186 | for parent in parent_names: |
| 187 | modules_to_invalidate.add(parent) |
| 188 | break |
| 189 | |
| 190 | children = mod_info.get("children", {}) |
| 191 | if isinstance(children, dict) and children: |
| 192 | _find_affected(children, parent_names + [mod_name]) |
| 193 | |
| 194 | _find_affected(module_tree) |
no test coverage detected