CI: Narrow affected-models detection by resolving __init__.py re-exports - #182
Merged
Conversation
added 2 commits
April 21, 2026 17:49
…infrastructure paths
Performance Comparison
|
|
The author of this PR, tadani3, is not an activated member of this organization on Codecov. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens CI affected-model detection by improving import-graph precision, especially for packages that act as re-export hubs (e.g., mobius.components), so CI runs model tests for the models actually impacted by a change.
Changes:
- Treat
src/mobius/tasks/astraceable(import-graph traced) instead of always triggeringrun_all. - Add
__init__.pyre-export resolution:from mobius.components import Xis attributed to the underlying defining module forXwhen resolvable. - Update detector unit tests to reflect the new task classification and run-all behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/detect_affected_models.py | Implements re-export resolution for from pkg import sym and reclassifies tasks/ as traceable. |
| scripts/detect_affected_models_test.py | Updates unit tests for the new tasks/ classification and detector behavior. |
rui-ren
approved these changes
Apr 21, 2026
justinchuby
approved these changes
Apr 21, 2026
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Tommaso Adani <83273681+tadani3@users.noreply.github.com>
…t resolution tests
tadani3
enabled auto-merge (squash)
April 21, 2026 19:00
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Tommaso Adani <83273681+tadani3@users.noreply.github.com>
…rt' and 'import from'' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Tommaso Adani <83273681+tadani3@users.noreply.github.com>
tadani3
disabled auto-merge
April 21, 2026 20:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI: Narrow affected-models detection by resolving init.py re-exports
Changes
src/mobius/tasks/reclassified fromshared_infra→traceable.Task files no longer trigger
run_allunconditionally; they are now tracedthrough the import graph.
__init__.pyhubs. A new_build_reexport_map()walks every
__init__.pyand builds a(package, symbol) → source_modulemap.
_parse_imports()resolvesfrom mobius.components import Footo theactual source module (
mobius.components._attention) instead of recording adependency on the package itself. The package name is only added when a
symbol can't be resolved (wildcards, missing entries).
The result: changes to a re-export hub (e.g.
components/__init__.py) nolonger invalidate every importer — only models whose actually-used symbol's
source changed are affected.
Before vs. after (Gemma4 + Qwen test scenario)
Same input file list:
run_allfalsegemma4,gemma4_text)falseVerification
All 49 tests in
scripts/detect_affected_models_test.pypass.Caveat