fix(watch): check-update walks the corpus, not just the pending flag#1935
Open
kimdzhekhon wants to merge 1 commit into
Open
fix(watch): check-update walks the corpus, not just the pending flag#1935kimdzhekhon wants to merge 1 commit into
kimdzhekhon wants to merge 1 commit into
Conversation
check_update() only ever inspected the needs_update flag file, which is written exclusively by the `graphify watch` daemon. Anyone who doesn't run that daemon got silent `exit 0` from `graphify check-update` no matter how far the corpus had drifted since the last extract — new files (never in the manifest at all) and deleted files were both invisible. Wire detect_incremental(kind="ast") into check_update using the same persisted --exclude patterns as a real rebuild (_read_build_excludes), so it now reports new/changed and deleted file counts against the manifest. Also make success non-silent: an unambiguous "Up to date" line now distinguishes a real clean check from a check that couldn't run (e.g. no manifest yet). Fixes Graphify-Labs#1765.
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.
Summary
check_update()only ever inspectedgraphify-out/needs_update, a flag written exclusively by thegraphify watchdaemon. Anyone not running that daemon got a silentexit 0fromgraphify check-updateregardless of how far the corpus had drifted — including brand-new files that never had a manifest row to begin with.detect_incremental(kind="ast")intocheck_update, using the same persisted--excludepatterns a real rebuild uses (_read_build_excludes), so it now reports actual new/changed and deleted file counts diffed against the manifest.Up to dateline, so "checked and clean" is now distinguishable from "couldn't check" (e.g. no manifest yet).Fixes #1765.
Test plan
test_check_update_reports_new_file_absent_from_manifest— reproduces the reported bug (a file created after the last extract, with no manifest row, is now detected)test_check_update_reports_up_to_date_when_manifest_matches_corpus— confirms the new explicit up-to-date messagetest_check_update_no_flag_returns_trueto match new behavioruv run pytest tests/test_watch.py -q -k check_update— 5 passeduv run pytest tests/ -q— full suite: 3266 passed (5 pre-existing failures unrelated to this change, missing optionalopenaidependency in this environment)