Uh oh!
There was an error while loading. Please reload this page.
[google_maps_flutter] Improve iOS shared code validation - #11070
Conversation
Improves the script that validates that the iOS implementation packages are sync based on early usage: - Skip .DS_Store files when checking shared code. - If the main validation passes, check that the other implementation packages match the shared code, since otherwise manual changes to one package and shared code will, incorrectly, pass CI due to CI skipping unchanged packages. Fixesflutter/flutter#182510
There was a problem hiding this comment.
Code Review
This pull request refactors the iOS shared code validation script by extracting the core validation logic into a reusable function _validatePackageSharedCode. It also enhances the validation process by ignoring .DS_Store files and adding a crucial check to ensure consistency across all related implementation packages, which helps prevent incorrect CI passes. The changes improve the robustness and maintainability of the validation script.
| /// Validates that the shared code in [packageRoot] matches the shared source of | ||
| /// truth. | ||
| /// | ||
| /// Returns true if the package matches the shared source of truth. | ||
| Future<bool> _validatePackageSharedCode( | ||
| Directory packageRoot, | ||
| String packageName, { | ||
| required Directory sharedSourceRoot, | ||
| required bool log, | ||
| }) async { | ||
| var hasDiffs = false; | ||
| for (final FileSystemEntity entity in sharedSourceRoot.listSync( | ||
| recursive: true, | ||
| )) { | ||
| if (entity is! File) { | ||
| continue; | ||
| } | ||
| final String relativePath = p.relative( | ||
| entity.path, | ||
| from: sharedSourceRoot.path, | ||
| ); | ||
| // The shared source README.md is not part of the shared source of truth, | ||
| // just an explanation of this source-sharing system. | ||
| if (relativePath == 'README.md') { | ||
| continue; | ||
| } | ||
| // Ignore .DS_Store files, which may be created in the shared source | ||
| // directory by the OS. | ||
| if (relativePath.endsWith('.DS_Store')) { | ||
| continue; | ||
| } | ||
| // Adjust the paths to account for the package name being part of the | ||
| // directory structure for Swift packages. | ||
| final String packagePath = p.join( | ||
| packageRoot.path, | ||
| packageRelativePathForSharedSourceRelativePath(packageName, relativePath), | ||
| ); | ||
| if (log) { | ||
| print('Validating $relativePath'); | ||
| } | ||
| final packageFile = File(packagePath); | ||
| if (!packageFile.existsSync()) { | ||
| if (log) { | ||
| print(' File $relativePath does not exist in $packageName'); | ||
| } | ||
| hasDiffs = true; | ||
| continue; | ||
| } | ||
| final String expectedContents = normalizedFileContents(entity); | ||
| final String contents = normalizedFileContents(packageFile); | ||
| if (contents != expectedContents) { | ||
| if (log) { | ||
| print(' File $relativePath does not match expected contents:'); | ||
| await _printDiff(entity, packageFile); | ||
| } | ||
| hasDiffs = true; | ||
| } | ||
| } | ||
| return !hasDiffs; | ||
| } |
There was a problem hiding this comment.
There was a problem hiding this comment.
Oof, this could get old pretty fast on google_maps_flutter PRs.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
flutter/packages@9da22bf...12b43a1 2026-02-20 rick.hohler@gmail.com [webview_flutter_wkwebview] Fix crash when calling setOnConsoleMessage multiple times (flutter/packages#10922) 2026-02-20 engine-flutter-autoroll@skia.org Manual roll Flutter from c023e5b to 91b2d41 (31 revisions) (flutter/packages#11088) 2026-02-20 kallentu@google.com [rfw] Remove old TODOs for code block languages. (flutter/packages#11080) 2026-02-20 matt.boetger@gmail.com [google_maps_flutter] Remove usesCleartextTraffic (flutter/packages#11079) 2026-02-20 stuartmorgan@google.com [google_maps_flutter] Improve iOS shared code validation (flutter/packages#11070) 2026-02-20 mdebbar@google.com Revert "#167410: _initCalled completed twice (#9694)" (flutter/packages#11084) 2026-02-20 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump androidx.activity:activity from 1.12.2 to 1.12.4 in /packages/image_picker/image_picker_android/android (flutter/packages#11033) 2026-02-20 matt.boetger@gmail.com [interactive_media_ads] Remove usesCleartextTraffic (flutter/packages#11065) 2026-02-19 matt.boetger@gmail.com [image_picker] Remove usesCleartextTraffic (flutter/packages#11076) 2026-02-19 matt.boetger@gmail.com [quick_actions_android] Remove deprecated usesCleartextTraffic (flutter/packages#11063) 2026-02-19 matt.boetger@gmail.com [quick_actions] Remove usesCleartextTraffic (flutter/packages#11064) 2026-02-19 matt.boetger@gmail.com [google_maps_flutter_android] Remove usesCleartextTraffic (flutter/packages#11078) 2026-02-19 louisehsu@google.com [google_maps_flutter_ios] Migrate to UIScene (flutter/packages#11001) 2026-02-19 matt.boetger@gmail.com [image_picker_android] Remove deprecated usesCleartextTraffic (flutter/packages#11059) 2026-02-19 matt.boetger@gmail.com [file_selector_android] Remove deprecated usesCleartextTraffic (flutter/packages#11057) 2026-02-19 matt.boetger@gmail.com [webview_flutter_android] Remove usesCleartextTraffic (flutter/packages#11066) 2026-02-19 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump exoplayer_version from 1.9.1 to 1.9.2 in /packages/video_player/video_player_android/android (flutter/packages#10985) 2026-02-19 stuartmorgan@google.com [google_maps_flutter] Fix add-marker crash on Android (flutter/packages#11061) 2026-02-19 42980667+srivats22@users.noreply.github.com #167410: _initCalled completed twice (flutter/packages#9694) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…er#182758) flutter/packages@9da22bf...12b43a1 2026-02-20 rick.hohler@gmail.com [webview_flutter_wkwebview] Fix crash when calling setOnConsoleMessage multiple times (flutter/packages#10922) 2026-02-20 engine-flutter-autoroll@skia.org Manual roll Flutter from c023e5b to 91b2d41 (31 revisions) (flutter/packages#11088) 2026-02-20 kallentu@google.com [rfw] Remove old TODOs for code block languages. (flutter/packages#11080) 2026-02-20 matt.boetger@gmail.com [google_maps_flutter] Remove usesCleartextTraffic (flutter/packages#11079) 2026-02-20 stuartmorgan@google.com [google_maps_flutter] Improve iOS shared code validation (flutter/packages#11070) 2026-02-20 mdebbar@google.com Revert "flutter#167410: _initCalled completed twice (flutter#9694)" (flutter/packages#11084) 2026-02-20 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump androidx.activity:activity from 1.12.2 to 1.12.4 in /packages/image_picker/image_picker_android/android (flutter/packages#11033) 2026-02-20 matt.boetger@gmail.com [interactive_media_ads] Remove usesCleartextTraffic (flutter/packages#11065) 2026-02-19 matt.boetger@gmail.com [image_picker] Remove usesCleartextTraffic (flutter/packages#11076) 2026-02-19 matt.boetger@gmail.com [quick_actions_android] Remove deprecated usesCleartextTraffic (flutter/packages#11063) 2026-02-19 matt.boetger@gmail.com [quick_actions] Remove usesCleartextTraffic (flutter/packages#11064) 2026-02-19 matt.boetger@gmail.com [google_maps_flutter_android] Remove usesCleartextTraffic (flutter/packages#11078) 2026-02-19 louisehsu@google.com [google_maps_flutter_ios] Migrate to UIScene (flutter/packages#11001) 2026-02-19 matt.boetger@gmail.com [image_picker_android] Remove deprecated usesCleartextTraffic (flutter/packages#11059) 2026-02-19 matt.boetger@gmail.com [file_selector_android] Remove deprecated usesCleartextTraffic (flutter/packages#11057) 2026-02-19 matt.boetger@gmail.com [webview_flutter_android] Remove usesCleartextTraffic (flutter/packages#11066) 2026-02-19 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump exoplayer_version from 1.9.1 to 1.9.2 in /packages/video_player/video_player_android/android (flutter/packages#10985) 2026-02-19 stuartmorgan@google.com [google_maps_flutter] Fix add-marker crash on Android (flutter/packages#11061) 2026-02-19 42980667+srivats22@users.noreply.github.com flutter#167410: _initCalled completed twice (flutter/packages#9694) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Improves the script that validates that the iOS implementation packages are sync based on early usage: - Skip .DS_Store files when checking shared code. - If the main validation passes, check that the other implementation packages match the shared code, since otherwise manual changes to one package and shared code will, incorrectly, pass CI due to CI skipping unchanged packages. Fixesflutter/flutter#182510 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
…er#182758) flutter/packages@9da22bf...12b43a1 2026-02-20 rick.hohler@gmail.com [webview_flutter_wkwebview] Fix crash when calling setOnConsoleMessage multiple times (flutter/packages#10922) 2026-02-20 engine-flutter-autoroll@skia.org Manual roll Flutter from c023e5b to 91b2d41 (31 revisions) (flutter/packages#11088) 2026-02-20 kallentu@google.com [rfw] Remove old TODOs for code block languages. (flutter/packages#11080) 2026-02-20 matt.boetger@gmail.com [google_maps_flutter] Remove usesCleartextTraffic (flutter/packages#11079) 2026-02-20 stuartmorgan@google.com [google_maps_flutter] Improve iOS shared code validation (flutter/packages#11070) 2026-02-20 mdebbar@google.com Revert "flutter#167410: _initCalled completed twice (flutter#9694)" (flutter/packages#11084) 2026-02-20 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump androidx.activity:activity from 1.12.2 to 1.12.4 in /packages/image_picker/image_picker_android/android (flutter/packages#11033) 2026-02-20 matt.boetger@gmail.com [interactive_media_ads] Remove usesCleartextTraffic (flutter/packages#11065) 2026-02-19 matt.boetger@gmail.com [image_picker] Remove usesCleartextTraffic (flutter/packages#11076) 2026-02-19 matt.boetger@gmail.com [quick_actions_android] Remove deprecated usesCleartextTraffic (flutter/packages#11063) 2026-02-19 matt.boetger@gmail.com [quick_actions] Remove usesCleartextTraffic (flutter/packages#11064) 2026-02-19 matt.boetger@gmail.com [google_maps_flutter_android] Remove usesCleartextTraffic (flutter/packages#11078) 2026-02-19 louisehsu@google.com [google_maps_flutter_ios] Migrate to UIScene (flutter/packages#11001) 2026-02-19 matt.boetger@gmail.com [image_picker_android] Remove deprecated usesCleartextTraffic (flutter/packages#11059) 2026-02-19 matt.boetger@gmail.com [file_selector_android] Remove deprecated usesCleartextTraffic (flutter/packages#11057) 2026-02-19 matt.boetger@gmail.com [webview_flutter_android] Remove usesCleartextTraffic (flutter/packages#11066) 2026-02-19 49699333+dependabot[bot]@users.noreply.github.com [dependabot]: Bump exoplayer_version from 1.9.1 to 1.9.2 in /packages/video_player/video_player_android/android (flutter/packages#10985) 2026-02-19 stuartmorgan@google.com [google_maps_flutter] Fix add-marker crash on Android (flutter/packages#11061) 2026-02-19 42980667+srivats22@users.noreply.github.com flutter#167410: _initCalled completed twice (flutter/packages#9694) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Improves the script that validates that the iOS implementation packages are sync based on early usage: - Skip .DS_Store files when checking shared code. - If the main validation passes, check that the other implementation packages match the shared code, since otherwise manual changes to one package and shared code will, incorrectly, pass CI due to CI skipping unchanged packages. Fixesflutter/flutter#182510 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Improves the script that validates that the iOS implementation packages are sync based on early usage:
Fixesflutter/flutter#182510
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).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. ↩↩2↩3