[tool] Pin platform below 3.2.0 to fix repo-wide analyze failure - #12785
Draft
danielleon-cmd wants to merge 2 commits into
Draft
[tool] Pin platform below 3.2.0 to fix repo-wide analyze failure#12785danielleon-cmd wants to merge 2 commits into
danielleon-cmd wants to merge 2 commits into
Conversation
package:platform 3.2.0 redesigned Platform (and the legacy FakePlatform/ LocalPlatform) as final classes, so script/tool's test/mocks.dart, which does `class MockPlatform extends Mock implements Platform`, no longer compiles: "The class 'Platform' can't be implemented outside of its library because it's a final class." Since script/tool backs the repo's own "analyze repo tools" postsubmit task, this has been failing on every commit to main for the last two weeks, showing up as a persistent tree-status failure unrelated to any individual PR's own changes. platform 3.1.6 (the version just below 3.2.0) still has the classic abstract Platform API that MockPlatform relies on, so pinning below 3.2.0 is the minimal fix; migrating the ~31 test files that use MockPlatform to the new platform API (FakePlatform/TestNativePlatform) is a larger, separate effort. Verified: `dart analyze` (was 1 error, now none) and `dart test` (1235 tests, all passing) in script/tool.
Closed
14 tasks
Resolves conflicting fixes for the same platform 3.2.0 breakage: main already landed the full migration (a26b623, "[tool] Adopt platform 3.2.0 (flutter#12789)"), which properly updates MockPlatform -> TestNativePlatform across script/tool instead of pinning the dependency backward. Took main's side entirely on both conflicting hunks (pubspec.yaml, CHANGELOG.md); this branch's own fix is now superseded and its diff against main is empty.
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.
package:platform3.2.0 redesignedPlatform(and the legacyFakePlatform/LocalPlatform) asfinal classes.script/tool/test/mocks.dartdoesclass MockPlatform extends Mock implements Platform, which no longer compiles under 3.2.0:script/tool's constraint (platform: ^3.0.2) allows 3.2.0, so this broke on the nextpub getpicking it up. Sincescript/toolbacks the repo's own "analyze repo tools" postsubmit task, this has failed on every commit tomainfor about two weeks, surfacing as a persistenttree-statusfailure unrelated to each individual PR's own changes.platform3.1.6 (the version just below 3.2.0) still has the classicabstract class PlatformAPI thatMockPlatformrelies on, so pinning below 3.2.0 is the minimal fix. Migrating the ~31 test files that useMockPlatformto the newplatformAPI (FakePlatform/TestNativePlatform) is a larger, separate effort better done deliberately rather than as a drive-by fix.Tracked internally at https://cloudsufi.atlassian.net/browse/FPOCTSMP-35
FPOCTSMP-35
Pre-Review Checklist
[shared_preferences]NEXTsection —script/tool's version bumps are cut separately from individual PRs, as its pre-existingNEXTentries show).///). — not applicable, no public API surface changed.dart analyze/dart testsuite itself going from failing to passing (see test plan).Test plan
dart pub getinscript/tool— resolvesplatformto3.1.6(was3.2.0)dart analyzeinscript/tool— no issues found (was 1 error)dart testinscript/tool— all 1235 tests passNote: The Flutter team is currently trialing Gemini Code Assist for GitHub. Comments from
gemini-code-assist[bot]aren't authoritative Flutter-team feedback; I'll wait for a human reviewer's guidance on which automated comments (if any) should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩