Repository navigation
fix(pregate): Dart import graph and test lanes - #3285
arlophoenix wants to merge 17 commits into
Conversation
…ckage: URIs resolve through every pubspec.yaml Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ep paths resolve against working-directory Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…en pinned; +N -M verdicts; missing SDK is incomplete Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and device-test paths Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A .dart test with no pubspec.yaml above it is unclaimed (incomplete), not handed to the detected runner. Runnable groups run even when another package's SDK is missing: a failure still fails, an otherwise green run is incomplete for the rest. DART_DIRECTIVE_RUN is linear (indented continuation lines only, bounded body). The Dart verdict line is read first only for dart/flutter runners. Pubspecs sharing a name keep every root. Coverage rows for working-directory guards, quoted pubspec names, the read cap and the unpinned missing-SDK hint. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ge root Co-Authored-By: Claude Opus 5.5 <[email protected]>
An ambiguous package: import selects every same-name copy, a leading BOM no longer hides a Dart file's directives, and parseSummary drops colour codes and treats a carriage return as a line end. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A package: import prefers the importer's actual package, so a same-name ancestor no longer steals it. Comments are blanked before the directive scan, so a ';' in a comment cannot truncate a conditional import. 'sdk: flutter' under any dependency name, in flow style too, selects flutter test. A workflow step whose working-directory cannot be resolved leaves the lane's test set unknown (may run any test), and a step that cds claims its paths both under the directory and repo-relative. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… heartbeats Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ge cases A workflow run command is walked through its literal cd/pushd segments, so a test path resolves against the directory current where it is named; a non-literal or escaping cd leaves the lane's test set unknown. A blank or comment-only line continues a multi-line Dart directive, a pubspec's leading BOM no longer hides its name, and a quoted sdk key still selects flutter test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…end at ')' A root package.json script run from a sub-directory leaves the lane's test set unknown instead of resolving its paths against that directory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thanks @arlophoenix — this is excellent work, and the Dart lanes are landing in #3306, squashed with you as co-author. Review (gstack /review plus an outside voice on another model family) found two places where selection could quietly shrink, which I fixed on top in #3306 rather than send back: a |
|
Thanks @arlophoenix. Your Dart/Flutter pregate work (Dart lane, |
…init drafts from the repo (#3266-#3269) (#3306) * fix(pregate): Dart import graph and test lanes (#3285) Port of arlophoenix's #3285. The import graph reads Dart import/export/part directives and resolves package: URIs through every tracked pubspec.yaml; _test.dart files under test/ are tests. lanes runs each Dart package's selected tests from its own root with flutter test or dart test (through fvm when the package pins it). flutter/dart/melos/very_good CI jobs are lanes, and run-step test paths resolve against working-directory and literal cd. A missing Dart SDK or a .dart file outside any package leaves the lane incomplete with a fix line; device tests (integration_test/, test_driver/) are not unit lanes. Co-authored-by: arlophoenix <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(pregate): a --base that names a commit gets a branch fix, not an impossible fetch (#3269) gstack-pregate --base <sha> refused with "fix: git fetch origin <sha> --depth=1". That fetch can never create origin/<sha>: a short SHA fails with "couldn't find remote ref", and a full SHA only reaches FETCH_HEAD. A fork clone hits the same wall with --base upstream/main. When origin/<base> does not resolve but <base> names a commit here and no local branch (a SHA, a tag, another remote's ref), the refusal now says --base takes a branch name on origin and suggests origin/HEAD's branch. A local branch, or a name that resolves nowhere, keeps the fetch fix: that is the unfetched or shallow checkout it repairs. Same code, same exit 3, and pin files are still read only from the reviewed origin/<base>. Fixes #3269 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(pregate): Django, asset and tool-config lanes; init drafts from the repo (#3266, #3267, #3268) - Django: settings modules, settings strings, include(), app migrations, admin, templates, static files and project templates get framework edges (lib/pregate/django.ts). - Assets, stylesheets and dotfile tool config take a no-tests empty lane; licence text under any name is documentation. - gstack-pregate init drafts languages, runner notes and nearest-test dependencies; never writes []. - Review fixes on the #3285 port: untracked shell scopes leave a lane unknown; Dart directives read to their semicolon; nested comments. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(pregate): init draft API is exercised directly, so init-draft.ts has a lane Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): restore the history a truncated rewrite dropped Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(pregate): outside-voice review fixes for the non-JS lanes - Tool config is an allowlist: unknown dotfiles (.rspec, .husky hooks) and stylesheets still need a lane; snapshot, golden and fixture trees and .gstack/ are never inert. - Django edges need Django evidence (manage.py or code importing django) and settings assignments in code, not strings or comments. - A cd after ||, &, control flow or braces leaves a lane unknown. - Dart directives allow metadata and quoted semicolons. - init drafts at most 256 dependencies (the schema limit); the rest are TODO. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(windows): pregate-dart and pregate-non-js join the POSIX-run pregate fixtures Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: release v1.91.161.0 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: arlophoenix <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Co-authored-by: y$un_ <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Part 1 of 3 split from #3193 at maintainer request.
Why (in your own words)
gstack-pregatecan now select and run the tests a Flutter or Dart change touches. On main, every touched_test.dartfile failslaneswith "has no test lane", so a Dart repo can't pass the tests stage at all. With this branch, the import graph reads Dartimport/export/partdirectives, andpackage:URIs resolve through every trackedpubspec.yaml.lanesruns each Dart package's selected tests from that package's root, usingfvm flutter testwhen the package pins fvm and plainflutter testordart testotherwise. CI jobs that runflutter test,dart test, melos or very_good count as lanes, and their test paths resolve against the step'sworking-directoryand any literalcd.The runner sits on main's
supervise()path.--timeoutkeeps main's documented per-runner-process meaning, so a timed-out package is incomplete and the next package still runs; the old branch's shared deadline across packages was dropped. Pregate never passes a lane it couldn't run. A Dart SDK missing from PATH, or a.dartfile with nopubspec.yamlabove it, leaves the lane incomplete with a fix line, and the packages that can run still do, so a real failure still fails. An all-skipped Dart run (+0 ~N) is ZERO-RUN. Device tests (integration_test/,test_driver/) are not unit lanes. The fix text names the"**/integration_test/**": []declaration in.gstack/pregate.json.This does not make flutter-bbtm green. bbtm keeps
.gstack/gitignored and has Actions off, so its ubuntu lanes stay requires-remote, and its ship receipts also need piece 2 (user-owned policy andlocal).Live evidence
flutter-bbtm, run in a throwaway
git clone --sharedwith a branch offdevelopthat touches one widget test:gstack-pregate --stage tests --allow-repo-commands --base develop.Before (upstream/main):
After (this branch):
A Dart test outside any package (fixture, no
pubspec.yaml):On bbtm's real tree the graph recognises 1033 tests and builds in about 210 ms.
lib/theme.dartselects 822 tests, andpackages/cache/lib/cache.dartselects 782 across packages throughpackage:cache.Scope
lib/pregate/import-graph.ts: Dart directives,package:resolution and_test.dartrecognition.lib/pregate/checks/lanes.ts: Dart run groups, fvm, verdict parsing and incomplete plans.lib/pregate/workflows.ts: Dart CI test commands, andworking-directory/cdpath resolution.lib/pregate/checks/strays.ts: Dart root manifests are not strays.docs/pregate.mdanddocs/troubleshooting.md.test/pregate-dart.test.ts(new) and a fixture helper error message.dart test(non-Flutter) package; the runner choice and verdict parsing are unit-tested only.lib/pregate/*. None were run, and no prompt or skill template changed.Liveness proof (required for external contributors)
Checklist
GSTACK PRtyped live into a real surface) or PR author is @garrytan (owner exemption)Not addressed
remote_gate's command for a requires-remote obligation still names only the detected JS/Python runner, not the Dart command, for Dart selections.flutter testanddart testmay runpub getimplicitly when a package's resolution is stale. That can fetch from pub.dev, and if it rewrites a tracked file the tree-change guard reports the lane incomplete.lib/theme.dart→ 822 tests) run as oneflutter testper package and may need a higher--timeout.local) and 3 (diff-scope and review/ship stack detection) are separate PRs.Test plan
test/pregate-dart.test.ts21/21, plus pregate-import-graph-paths 12/12, pregate-manifest-paths 4/4, pregate-bats-nested 6/6, troubleshooting-anchors 205/205 and touchfiles 69/69;bun run typecheckcleanbun run test, not run (shared machine)bun run eval:bg:pr), deferred as above🤖 Generated with Claude Code