Repository navigation
fix(index): re-extract unchanged files after an extractor change - #804
Merged
Merged
Conversation
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
The fingerprint
cora indexstores per file, and compares to decide whether to skip it, is nowv{EXTRACTOR_VERSION}:{mtime}:{size}instead of{mtime}:{size}.EXTRACTOR_VERSION(1 for now, insrc/index/mod.rs) is bumped whenever an extractor starts to record symbols or edges it did not record before, or stops recording wrong ones.Why
A file whose
mtime:sizematched was skipped, whatever extractor wrote its symbols, so an upgrade that improves an extractor never reached the files that had not changed until someone rancora index --rebuild. This was measured: with a new extractor in place,cora dead-codeon this repository reported the same 43 symbols before and after. Two extractor fixes (Ruby nesting in #801, function references and serde attributes in #802) depend on it. After this change the firstcora indexafter such an upgrade re-extracts every file once (about 0.5 s for this repository) and later runs skip unchanged files as before. Closes #803.Testing
mtime:sizeform is fully re-extracted on the next run and skipped on the one after.cargo test --features tree-sitter: 1549 passed, 0 failed;cargo fmt --all -- --checkand clippy with-D warningsclean; Cora review of the staged diff: no findings.