Repository navigation
Conversation
Resolve CSS imports against indexed stylesheet files or an extension-bearing asset reference. Preserve that identity through incremental extraction and both graph writers. Exercise the cycles CLI with a same-stem stylesheet and a genuine TypeScript self-import. Co-Authored-By: Codex <[email protected]>
|
Thanks for the pull request, @rvitaliy. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify review 
No issues reported · High impact
Extraction now preserves dependencies on unindexed stylesheets and removes CSS symbol-level import edges.
What this review covered
- We didn't review 1 file that isn't source code, such as docs, config, images, or generated or third-party code.
- 8 of 8 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 8017 functions depend on this change
- 3 functions became more coupled.
extract()(1453 callers),build_from_json()(357 callers),finalize_raw_graph_endpoints()(14 callers). - 665 of 665 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed 5a5faf9
This branch has not been deployed
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.
What does this PR do?
Fixes #5652. When
Card.tsximports./Card.cssand the stylesheet has no indexed file node, the old extensionless target can resolve toCard.tsxitself. This adds a spurious one-file cycle tographify cyclesand can send other importers of that stylesheet to the component.A resolved stylesheet dependency now points to its indexed CSS file node when one exists. Otherwise both graph writers retain a source-less reference keyed by the portable path, including the extension. The import keeps its source location. An incremental run can reuse the indexed stylesheet from the persisted graph, including a file with a disambiguated ID. Named JS/TS re-exports of ordinary CSS keep the file-level dependency, since the CSS extractor does not declare JavaScript named exports.
Verification & invariants
graphify extract --code-only --no-clusterand thengraphify cycles --json. Its complete cycle list must contain exactly the genuineself.tsself-import. Two different TSX files must point to the same stylesheet reference.The change applies to resolved
.cssdependencies. To refresh existing edges in a raw code graph, rungraphify extract . --code-only --no-cluster --forceonce.How was this tested?
graphify extract . --code-only --no-clusterandgraphify cycles --jsonon a separate seven-file sample. The base reports three false TSX cycles and one real TypeScript self-import. With this fix the only cycle is the real self-import.python -m pytest -q tests/test_cycles_cli.py tests/test_css_extractor.py tests/test_build.py tests/test_cross_extension_reexport_self_cycle.py tests/test_type_only_import_cycles.py tests/test_astro_import_ids.pyon Python 3.11 and 3.13.uv run --locked --all-extras ruff check .,git diff --check, anduv run --locked --all-extras graphify update ..uv run --locked --all-extras pyright --outputjsonreports the same 767 pre-existing diagnostics on the base and head, compared by file, severity, and message.tests/suite on CPython 3.14.10: 12,631 passed, 135 skipped, 2 expected failures. Ran the non-serial set withpytest tests -q --tb=short -n 6 --dist worksteal -m 'not serial', excluding the worker-size and three language-override modules from that invocation and running their non-serial cases in one process. Ranpytest tests -q --tb=short -m serialfor the serial set.