Skip to content

feat(dart): extract Flutter package graph and client HTTP - #755

Merged
jonathanong merged 11 commits into
mainfrom
lang-dart-flutter
Aug 22, 2026
Merged

feat(dart): extract Flutter package graph and client HTTP#755
jonathanong merged 11 commits into
mainfrom
lang-dart-flutter

Conversation

@jonathanong

@jonathanong jonathanong commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a Dart language frontend for configured tests.dart.packages: exact import/export/part URIs emit dart-import, capitalized types emit dart-ref, and empty package lists disable the extractor.
  • Wire tests plan dart over *_test.dart to dart test <rel-path>, with native fallback on pubspec.yaml and non-test .dart files.
  • Match literal Uri.parse("/api/...") and http.get("/api/...") calls to existing TypeScript backend routes as http edges (no Dart server graph). Fixtures live under test-cases/codebase-analysis/ so the composed fixtures/lang-frontends inventory is unchanged.

Test plan

  • cargo test -p no-mistakes --lib dart
  • cargo test -p no-mistakes --lib language_frameworks
  • CI green on rust, rust-coverage, node, docs

Made with Cursor

Shepherd Journal

  • Rejected conditional Dart import URIs: v1 extracts the primary import/export/part URI only; if (dart.library.io) branches are later work.
  • Rejected disabling Dart *_test.dart filename fallback: empty tests.dart.packages already yields no language projects, and suffix fallback matches Java/Kotlin when the dart runner is requested.
  • No code change for CodSpeed graph/extract regressions: Dart is not in the composed lang-frontends fixture; acknowledge as measurement noise vs Kotlin/Elixir inventory growth.
  • No code change for Sourcery quota, Codex usage-limit, or CodeRabbit too-many-files comments.
  • No code change for Codex usage-limit comment; waiting on CI 32565411572.
  • codecov/project/rust 'No coverage information found on head' is stale while Rust tests and coverage is still in progress; no code change until that job uploads.
  • Resolved quoted/commented pubspec names by accepting optional quotes and a trailing YAML comment on name:.
  • Resolved raw URI literals by allowing Dart's optional r prefix on Uri.parse and http.* string arguments.
  • Resolved extension type declarations by matching extension type Name in the declaration regex.
  • Rebased onto Elixir feat(elixir): extract Phoenix mappings and tests plan elixir #754 (2294f287). Dart owns EdgeKind sort keys (58, 0)/(59, 0); each_lang_map is 9 slots and framework_plans is 14.
  • Split Dart graph tests and native-framework classification so language_frontends.rs, args.rs, and native_fallback.rs stay within the 500-line test cap after landing next to Elixir.
  • Resolved raw import/export/part URIs by allowing Dart's optional r prefix on directive strings.
  • Resolved URI fragments by stripping #fragment in addition to query strings before HTTP matching.
  • Rejected Dart-specific comment stripping for # symbols: v1 uses the shared strip_comments_keep_strings helper (# is a Python/Ruby/PHP comment). Dart #load symbol literals are later; do not change the shared stripper.
  • No code change for Codex usage-limit comments.
  • Resolved FrameworkPreparationPlan tests-graph runner count 13 → 14 after landing Dart next to Elixir.
  • Resolved interpolated Dart HTTP strings, suffix receivers, and query-slash hosted URLs in dart_http.rs; rejected dart-ref stem fallback (v1 uses the shared helper like Java/Kotlin). No code change for Codex usage-limit comments.
  • codecov/project/rust 'No coverage information found on head' is stale while run 32567867710 (Rust tests and coverage) is still in progress; no code change until that job uploads.

@jonathanong
jonathanong enabled auto-merge (squash) August 22, 2026 08:40
sourcery-ai[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

This comment has been minimized.

@coderabbitai

This comment has been minimized.

@sourcery-ai

This comment has been minimized.

@codecov

This comment has been minimized.

@codspeed-hq

This comment has been minimized.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

This comment has been minimized.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

This comment has been minimized.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

jonathanong and others added 7 commits August 22, 2026 03:00
…t HTTP

Configured tests.dart.packages own dart-import/dart-ref edges, dart test
targets, and Uri.parse/http.* literals that match existing TS backend routes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Inline TS HTTP matching so Dart client calls can reuse route defs without a
nine-argument helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
Nested `dart test` targets now use `dart pub --directory` so monorepo packages run from their pubspec. Client HTTP extraction skips comments and backend-prefix misses, and grouping strips package-relative selectors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Quoted or commented `name:` lines, raw URI literals, and `extension type`
declarations are valid Dart/pubspec syntax and were dropping dart-import,
http, and dart-ref edges.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ebase

The nested-test commit still had conflict markers in the tests configuration page.

Co-authored-by: Cursor <cursoragent@cursor.com>
…base

Move Dart graph tests into the existing more-helpers module and fold Dart
into Elixir glob and native-fallback match arms.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tion

Keep native_fallback.rs under the 500-line cap by sharing the Dart-inclusive
framework match with the language fallback helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

This comment has been minimized.

Raw `import r'...'` directives and `/path#fragment` literals are valid Dart
and were dropping dart-import and http edges.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

This comment has been minimized.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

jonathanong and others added 3 commits August 22, 2026 03:19
FrameworkPreparationPlan::all includes Dart next to Elixir, so the tests-graph
demand expands to 14 runners.

Co-authored-by: Cursor <cursoragent@cursor.com>
…lash hosts

Word-boundary regexes and `$`/query-before-path guards stop phantom HttpCall
edges from string interpolation, MyUri.parse, and hosted URLs whose first `/`
is in the query.

Co-authored-by: Cursor <cursoragent@cursor.com>
Clippy flags then(|| raw) as an unnecessary lazy evaluation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

This comment has been minimized.

@jonathanong
jonathanong merged commit 48e1381 into main Aug 22, 2026
22 of 23 checks passed
@jonathanong
jonathanong deleted the lang-dart-flutter branch August 22, 2026 10:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ca172e4ea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +66 to +67
if file.ends_with(&format!("/{last}")) {
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep grouped Dart selectors package-relative

Fresh evidence after the earlier grouped-argument report is this new suffix branch: for a configured package such as packages/app, it removes test/user_test.dart from runner_args, but grouped_execution_targets still stores packages/app/test/user_test.dart in test_files. A consumer assembling the documented grouped command therefore gets dart pub --directory packages/app run test packages/app/test/user_test.dart; the selector is interpreted within that package and points to a duplicated path, so grouped CI execution cannot find the test. Normalize the grouped test_files selectors to the package-relative form as well.

Useful? React with 👍 / 👎.

Comment on lines +22 to +24
let store = crate::codebase::ts_source::SourceStore::new(std::sync::Arc::new(
crate::codebase::ts_source::FileInventory::from_paths(&dart_files),
));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reuse the prepared source store for Dart HTTP

When a graph requests both Dart language edges and HTTP edges, collect_language_frontend_edges first reads every configured Dart file through the request's memoized SourceStore, 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant