Skip to content

Commit 5542f51

Browse files
justinchubyCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <[email protected]> Signed-off-by: Justin Chu <[email protected]>
1 parent e60c01d commit 5542f51

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎scripts/detect_affected_models.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,16 @@ def detect_affected_models(
487487
# through to the transitive scan below.
488488
if module_name in registry_map:
489489
affected.update(registry_map[module_name])
490+
491+
# Also include directly registered model modules that import this one.
492+
# Some architectures are implemented as thin wrappers over another
493+
# model module (e.g. importing a base model class).
494+
direct_dependents = {
495+
mod for mod, deps in import_graph.items() if module_name in deps
496+
}
497+
for dep_module in direct_dependents:
498+
if dep_module in registry_map:
499+
affected.update(registry_map[dep_module])
490500
continue
491501

492502
# Transitive: find modules that import from this model file.

0 commit comments

Comments
 (0)