Repository navigation
Conversation
|
Great catch and a correct fix — thank you for the thorough write-up and for reproducing it. We implemented this directly with two small improvements over the PR:
The fix will be in the next release. First-time contributor badge well earned — come back anytime. |
|
Thanks for the quick turnaround, and for laying out the changes so clearly. Hoisting the mkdir right after the output path is computed is the better call — it covers backup_if_protected and the labels read, not just the first write. |
|
Following up on the edge-weight idea above: I measured it on two codebases, and it gives no consistent gain over |
Fixes #934.
What
Adds
out.mkdir(parents=True, exist_ok=True)before the first write intooutin thecluster-onlycodepath (graphify/__main__.pyline 1827 onv8HEAD).Why
cluster-onlycrashes withFileNotFoundErrorwhengraphify-out/doesn't exist at invocation — a natural state when archiving a previous run before re-clustering with new flags. Theextractcodepath createsoutexplicitly (line 2935);cluster-onlyassumed it existed, which is the asymmetry causing the bug.The same pattern (
mkdir(parents=True, exist_ok=True)) is already used at ~20 sites in the same file, so this fix alignscluster-onlywith the rest of the codebase.Manual verification
Reproduced the original crash and confirmed the fix on the same React/Firebase PWA codebase that surfaced #919 / #934 (full reproducer documented in #934).
Also ran the existing test suite locally with the fix applied:
test_multilang.pyare pre-existing in my local environment (missing optionaltree-sitter-sqldependency) and fail identically with the fix reverted, so unrelated to this change.Tests
I held off adding a regression test specific to
cluster-onlybecause the codepath is currently invoked through the manual argparse-style parser inmain()rather than a directly callable function, and I wasn't sure of the preferred pattern. Happy to add an end-to-end subprocess test, or to extract the codepath into a callable first if you prefer — let me know what would fit best.First-time contributor — happy to iterate on anything.