-
Notifications
You must be signed in to change notification settings - Fork 0
feat(dart): extract Flutter package graph and client HTTP #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0942733
feat(dart): extract Flutter package graph, tests plan dart, and clien…
jonathanong 50449f4
fix(dart): keep HTTP helpers within clippy argument and line limits
jonathanong 8788269
fix(dart): run nested tests in-package and honor HTTP prefixes
jonathanong a4366f3
fix(dart): parse quoted pubspec names, raw URIs, and extension types
jonathanong c40ac97
docs(dart): keep Mix and nested dart test commands after the Elixir r…
jonathanong cf99e4c
fix(dart): keep test files under the 500-line cap after the Elixir re…
jonathanong e7b5724
fix(dart): rustfmt rebase merges and move native-framework classifica…
jonathanong bb7eaff
fix(dart): accept raw import URIs and strip URI fragments
jonathanong 7578b3e
fix(dart): count Dart in the tests-graph runner preparation plan
jonathanong 8bc09bc
fix(dart): skip interpolated HTTP URIs, suffix receivers, and query-s…
jonathanong 6ca172e
fix(dart): use then_some for static HTTP path filtering
jonathanong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
40 changes: 40 additions & 0 deletions
40
crates/no-mistakes/src/codebase/dependencies/graph/edge_dart_http.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| fn collect_dart_http_call_edges( | ||
| root: &Path, | ||
| all_files: &[PathBuf], | ||
| config_options: &GraphConfigOptions, | ||
| route_defs: &[(PathBuf, String)], | ||
| interner: &PathInterner, | ||
| ) -> Vec<Edge> { | ||
| if config_options.dart_packages.is_empty() { | ||
| return Vec::new(); | ||
| } | ||
| let roots = | ||
| crate::codebase::lang_frontends::configured_roots(root, &config_options.dart_packages); | ||
| let dart_files: Vec<PathBuf> = all_files | ||
| .iter() | ||
| .filter(|path| path.extension().and_then(|ext| ext.to_str()) == Some("dart")) | ||
| .filter(|path| roots.iter().any(|package_root| path.starts_with(package_root))) | ||
| .cloned() | ||
| .collect(); | ||
| if dart_files.is_empty() { | ||
| return Vec::new(); | ||
| } | ||
| let store = crate::codebase::ts_source::SourceStore::new(std::sync::Arc::new( | ||
| crate::codebase::ts_source::FileInventory::from_paths(&dart_files), | ||
| )); | ||
| let prefixes = resolved_backend_prefixes(config_options); | ||
| dart_files | ||
| .par_iter() | ||
| .flat_map(|caller| { | ||
| let Ok(source) = store.read_path(caller) else { | ||
| return Vec::new(); | ||
| }; | ||
| let calls: Vec<_> = crate::codebase::lang_frontends::extract_http_paths(&source) | ||
|
jonathanong marked this conversation as resolved.
|
||
| .into_iter() | ||
| .filter(|path| prefixes.iter().any(|prefix| path.starts_with(prefix))) | ||
| .map(|path| crate::codebase::ts_http_calls::HttpCall { path, line: 0 }) | ||
| .collect(); | ||
|
jonathanong marked this conversation as resolved.
|
||
| http_edges_for_calls(caller, &calls, route_defs, interner) | ||
| }) | ||
| .collect() | ||
| } | ||
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a graph requests both Dart language edges and HTTP edges,
collect_language_frontend_edgesfirst reads every configured Dart file through the request's memoizedSourceStore, but this collector then constructs a separate store and physically reads the same files again. This defeats the request-level single-read guarantee, doubles Dart source I/O on full graph and test-impact builds, and can make the HTTP edges observe different contents if a file changes during the request. Pass the prepared or visible-snapshot source store into this collector instead of creating a new one.Useful? React with 👍 / 👎.