add dt flutter-bisect cmd - #10017
khanak0509 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new command, dt flutter-bisect, to binary-search Flutter SDK commits and identify the first commit introducing a DevTools test regression. The changes include the command implementation, helper utilities, documentation, and unit tests. Feedback on the implementation suggests escaping dots and adding anchors to the pre-release tag regular expression, wrapping the git fetch command in a try-catch block to handle offline scenarios gracefully, and utilizing a blobless clone (--filter=blob:none) to speed up the initial Flutter repository clone.
| const _keepSdkArg = 'keep-sdk'; | ||
| const _skipVerifyArg = 'skip-verify'; | ||
|
|
||
| final _flutterPreReleaseTagRegExp = RegExp(r'[0-9]+.[0-9]+.0-[0-9]+.0.pre'); |
There was a problem hiding this comment.
[CONCERN] The regular expression uses unescaped dots (.), which match any character instead of literal dots, and lacks start/end anchors (^ and $). This could lead to incorrect matches or partial substring matches. Escaping the dots and adding anchors makes the pattern precise and robust.
| final _flutterPreReleaseTagRegExp = RegExp(r'[0-9]+.[0-9]+.0-[0-9]+.0.pre'); | |
| final _flutterPreReleaseTagRegExp = RegExp(r'^[0-9]+\.[0-9]+\.0-[0-9]+\.0\.pre$'); |
References
- Categorize maintainability issues or potential bugs as [CONCERN] per the AI Review Protocol. (link)
There was a problem hiding this comment.
leaving this as-is to match update-flutter-sdk.
| await processManager.runProcess( | ||
| CliCommand.git([ | ||
| 'clone', | ||
| '--no-checkout', | ||
| 'https://github.com/flutter/flutter', | ||
| repo.sdkDirectoryName, | ||
| ]), | ||
| workingDirectory: repo.toolDirectoryPath, | ||
| ); |
There was a problem hiding this comment.
[CONCERN] Cloning the entire Flutter repository history can be extremely slow and consume significant disk space and bandwidth. Since bisecting only requires checking out a few specific revisions, using a blobless clone (--filter=blob:none) will dramatically speed up the initial clone while still allowing arbitrary checkouts on demand.
| await processManager.runProcess( | |
| CliCommand.git([ | |
| 'clone', | |
| '--no-checkout', | |
| 'https://github.com/flutter/flutter', | |
| repo.sdkDirectoryName, | |
| ]), | |
| workingDirectory: repo.toolDirectoryPath, | |
| ); | |
| await processManager.runProcess( | |
| CliCommand.git([ | |
| 'clone', | |
| '--no-checkout', | |
| '--filter=blob:none', | |
| 'https://github.com/flutter/flutter', | |
| repo.sdkDirectoryName, | |
| ]), | |
| workingDirectory: repo.toolDirectoryPath, | |
| ); |
References
- Categorize maintainability issues or potential bugs as [CONCERN] per the AI Review Protocol. (link)
There was a problem hiding this comment.
i think we can skip for now so we match update-flutter-sdk’s clone. if cold clones are too slow we can do...
|
Hii @kenzieschmoll, @srawlins this is just a |
Fixes #9467
this PR adds
dt flutter-bisectso we can find which Flutter SDK commit broke a DevTools test. Right now after a candidate bump you have to manually checkout Flutter commits and re-run the failing test until you find the first bad one.How I implemented it:
you pass a known-good
--from, known-bad--to, and the failing--test. It usestool/flutter-sdk, verifies that--frompasses and--tofails (unless--skip-verify), then binary-searches the commit range with git checkout +flutter testat each midpoint until it finds the first bad commit. When finished it restoresflutter-candidate.txt(unless--keep-sdk). Also added--dry-runand unit tests for the binary search helper.Example:
dt flutter-bisect --from <good> --to <bad> --test path/to/failing_test.dartPre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.