Repository navigation
Conversation
…d test
extract_liquid() returns OS-native path strings in target_file (matching all other extractors in graphify), so Windows paths use backslash separators and failed the raw '.endswith("assets/x.js")' check in test_js_liquid_keeps_liquid_references.
Compare path components via PureWindowsPath/PurePosixPath so both POSIX and Windows separators match cleanly, and add a cross-platform regression test that reproduces the Windows separator failure on any host OS.
Fixes Graphify-Labs#5579
Co-Authored-By: Gemini <[email protected]>
|
Thanks for the pull request, @m3lonxd. 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 
2 possible issues to check · High impact
The test now matches Liquid reference paths by trailing path components and adds coverage for Windows-style separators.
2 possible issues we couldn't confirm
- The path check treats every backslash as a separator, so a POSIX target_file containing a literal backslash can be misread ·
tests/test_liquid_extractor.py:991 - The Windows-separator test replaces
extract_liquidthroughsys.modules[__name__], which can fail if pytest does not register this test m ·tests/test_liquid_extractor.py:1025
They don't change the score.
Code graph · 115 functions depend on this change
- 1 of 652 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed 6cd33c7
Extractor accuracy (Swift #5641, Apex #5627, Python #5647, TypeScript #5604/#5614/#5612, Bash caller-var #5602), GitHub Actions run-step extraction (#5603), incremental correctness (#5634/#5638/#5636), symlink and semantic-cache fixes (#5617/#5618), export/report hardening and perf (#5643/#5644/#5645/#5646/#5619/#5620/#5621), and CLI/docs/skill/install work (#5629/#5628/#5626/#5624/#5623/#5625/#5642/#5583). AST cache schema 59 to 60; Swift/Apex/Python/Bash/GHA inputs re-extract on first build. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed in v0.9.124 (just released to PyPI), cherry-picked with your authorship preserved so it shows under your name in the history. Thanks @m3lonxd for the portable JS-Liquid target-path comparison — verified green in the full suite and, where applicable, smoke-tested against the published package. 🙏 |
What does this PR do?
Closes #5579
extract_liquid()returns OS-native path strings inedge[target_file](consistent withsource_fileand every other extractor ingraphify), so on Windowstarget_fileuses backslash separators (e.g....\assets\x.js).test_js_liquid_keeps_liquid_referencesassertede[target_file].endswith(assets/x.js), causing a false test failure on Windows even though the reference edge was present.This PR updates
test_js_liquid_keeps_liquid_referencesto matchtarget_filesuffix components viaPurePosixPath/PureWindowsPath(via_target_matches_relative()), and addstest_js_liquid_keeps_liquid_references_handles_windows_separatorsto prove the pre-fix failure cross-platform on POSIX and Windows hosts.Type of change
Verification & Invariants
Preserves the existing extractor invariant that individual extractors emit OS-native
str(path)values forsource_fileandtarget_file, whileextract()normalizessource_fileto POSIX after path resolution.Verified the new regression test fails against pre-fix
test_js_liquid_keeps_liquid_references(failing onendswith(assets/x.js)when given Windows backslash separators) and passes with the fix.No generated skill files or AST cache schemas are affected.
Read the CONTRIBUTING.md guide.
Reproduced the issue and identified the invariant.
Made the smallest fix necessary.
Added a regression test (if bug fix) or isolated boundary test.
Kept the PR description synchronized with the final implementation.
Documented any limitations / unsupported cases explicitly.
How was this tested?
Graphify-specific checklist
uv run python -m tools.skillgen --bless) when changing their source fragments. (N/A — test-only change)