fix(flows): normalize changed_files to absolute paths for incremental flow detection#572
Open
itxaiohanglover wants to merge 1 commit into
Open
Conversation
… flow detection git diff --name-only returns relative paths (e.g. 'src/main.py') but the graph stores absolute file_path values (e.g. '/home/user/repo/src/main.py'). The comparison ep.file_path in changed_file_set always failed, causing incremental_trace_flows to never find new entry points. Fix: normalize changed_files to absolute paths at the start of incremental_trace_flows. This fixes both the SQL query (line 473) and the set comparison (line 513). Fixes tirth8205#569
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.
Fixes #569
Problem
incremental_trace_flows()inflows.pyfilters re-detected entry points by comparingep.file_path(absolute path from graph) againstchanged_file_set(relative paths fromgit diff --name-only). This format mismatch meansep.file_path in changed_file_setis alwaysFalse, so new entry points are never found during incremental updates.The same mismatch affects the SQL query on line 473:
WHERE n.file_path IN ({placeholders})compares relative paths against absolute paths in the database.What changed
Added one line at the start of
incremental_trace_flows()to normalizechanged_filesto absolute paths:This fixes both:
ep.file_path in changed_file_setnow matchesNo existing comments modified. No behavior change when paths are already absolute.
Validation
run_postprocess_tool(non-incremental path) works correctly — this is because it doesn't filter bychanged_files