From 548a2c875779032dd722fbb99adb93f861e79cd9 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 12 Aug 2022 09:56:44 -0700 Subject: [PATCH 01/10] format --- .../integration_test/google_maps_plugin_test.mocks.dart | 4 ++-- .../image_picker/test/image_picker_test.mocks.dart | 4 ++-- .../test/android_webview_test.mocks.dart | 4 ++-- .../test/webview_android_widget_test.mocks.dart | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart index 744552f45d4d..18012f471a53 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart @@ -25,8 +25,8 @@ class _FakeStreamController_0 extends _i1.Fake class _FakeLatLngBounds_1 extends _i1.Fake implements _i3.LatLngBounds {} -class _FakeScreenCoordinate_2 extends _i1.Fake implements _i3.ScreenCoordinate { -} +class _FakeScreenCoordinate_2 extends _i1.Fake + implements _i3.ScreenCoordinate {} class _FakeLatLng_3 extends _i1.Fake implements _i3.LatLng {} diff --git a/packages/image_picker/image_picker/test/image_picker_test.mocks.dart b/packages/image_picker/image_picker/test/image_picker_test.mocks.dart index 641a104a33c5..a79d076dd42c 100644 --- a/packages/image_picker/image_picker/test/image_picker_test.mocks.dart +++ b/packages/image_picker/image_picker/test/image_picker_test.mocks.dart @@ -22,8 +22,8 @@ import 'package:mockito/mockito.dart' as _i1; class _FakeLostData_0 extends _i1.Fake implements _i2.LostData {} -class _FakeLostDataResponse_1 extends _i1.Fake implements _i2.LostDataResponse { -} +class _FakeLostDataResponse_1 extends _i1.Fake + implements _i2.LostDataResponse {} /// A class which mocks [ImagePickerPlatform]. /// diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart index db877e5870b6..8a1778e43ca1 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart @@ -22,8 +22,8 @@ import 'test_android_webview.pigeon.dart' as _i5; // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types -class _FakeDownloadListener_0 extends _i1.Fake implements _i2.DownloadListener { -} +class _FakeDownloadListener_0 extends _i1.Fake + implements _i2.DownloadListener {} class _FakeJavaScriptChannel_1 extends _i1.Fake implements _i2.JavaScriptChannel {} diff --git a/packages/webview_flutter/webview_flutter_android/test/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/webview_android_widget_test.mocks.dart index 04c2d778ed19..e17b31b3d857 100644 --- a/packages/webview_flutter/webview_flutter_android/test/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/webview_android_widget_test.mocks.dart @@ -28,8 +28,8 @@ class _FakeWebStorage_1 extends _i1.Fake implements _i2.WebStorage {} class _FakeWebView_2 extends _i1.Fake implements _i2.WebView {} -class _FakeDownloadListener_3 extends _i1.Fake implements _i2.DownloadListener { -} +class _FakeDownloadListener_3 extends _i1.Fake + implements _i2.DownloadListener {} class _FakeJavascriptChannelRegistry_4 extends _i1.Fake implements _i3.JavascriptChannelRegistry {} From 72a879d5f187777ab51500b03c8bb56d1b3d9171 Mon Sep 17 00:00:00 2001 From: Chris Yang Date: Fri, 12 Aug 2022 10:56:22 -0700 Subject: [PATCH 02/10] roll flutter master version --- .ci/flutter_master.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index 9c00d6d8d192..0e1912635f02 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -9ad052a57e0f08f05c8f126f80b59dc06e2b81af +a0f1c670ed90ee1dbb656ad2b9c469bfbd529f19 From 9f2b6fe4367363f5e4a996b69629eaa72ef3b3d8 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 13 Aug 2022 10:53:46 -0400 Subject: [PATCH 03/10] Script debugging --- .cirrus.yml | 321 ------------------ .../tool/lib/src/version_check_command.dart | 2 + 2 files changed, 2 insertions(+), 321 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3d0c525a5c42..312c025bb1b1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -80,27 +80,6 @@ task: namespace: default matrix: ### Platform-agnostic tasks ### - - name: Linux plugin_tools_tests - script: - - cd script/tool - - dart pub run test - - name: publishable - env: - CHANGE_DESC: "$TMPDIR/change-description.txt" - version_check_script: - # For pre-submit, pass the PR label, as well as the PR description or - # incremental commit message (for Dependabot checks), to the script to - # allow for version check overrides. - # For post-submit, ignore platform version breaking version changes and - # missing version/CHANGELOG detection since the overrides aren't - # available outside of the context of the PR. - - if [[ $CIRRUS_PR == "" ]]; then - - ./script/tool_runner.sh version-check --ignore-platform-interface-breaks - - else - - echo "$CIRRUS_CHANGE_MESSAGE" > "$CHANGE_DESC" - - ./script/tool_runner.sh version-check --check-for-missing-changes --change-description-file="$CHANGE_DESC" --pr-labels="$CIRRUS_PR_LABELS" - - fi - publish_check_script: ./script/tool_runner.sh publish-check - name: format always: format_script: ./script/tool_runner.sh format --fail-on-change @@ -114,303 +93,3 @@ task: - ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml license_script: dart $PLUGIN_TOOL license-check dependabot_script: dart $PLUGIN_TOOL dependabot-check - - name: federated_safety - # This check is only meaningful for PRs, as it validates changes - # rather than state. - only_if: $CIRRUS_PR != "" - script: ./script/tool_runner.sh federation-safety-check - - name: dart_unit_tests - env: - matrix: - CHANNEL: "master" - CHANNEL: "stable" - test_script: - - ./script/tool_runner.sh test - - name: analyze - env: - matrix: - CHANNEL: "master" - CHANNEL: "stable" - analyze_tool_script: - - cd script/tool - - dart analyze --fatal-infos - analyze_script: - # DO NOT change the custom-analysis argument here without changing the Dart repo. - # See the comment in script/configs/custom_analysis.yaml for details. - - ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml - pathified_analyze_script: - # Re-run analysis with path-based dependencies to ensure that publishing - # the changes won't break analysis of other packages in the respository - # that depend on it. - - ./script/tool_runner.sh make-deps-path-based --target-dependencies-with-non-breaking-updates - # This uses --run-on-dirty-packages rather than --packages-for-branch - # since only the packages changed by 'make-deps-path-based' need to be - # checked. - - dart $PLUGIN_TOOL analyze --run-on-dirty-packages --log-timing --custom-analysis=script/configs/custom_analysis.yaml - # Restore the tree to a clean state, to avoid accidental issues if - # other script steps are added to this task. - - git checkout . - # Does a sanity check that plugins at least pass analysis on the N-1 and N-2 - # versions of Flutter stable if the plugin claims to support that version. - # This is to minimize accidentally making changes that break old versions - # (which we don't commit to supporting, but don't want to actively break) - # without updating the constraints. - # Note: The versions below should be manually updated after a new stable - # version comes out. - - name: legacy-version-analyze - depends_on: analyze - env: - matrix: - CHANNEL: "2.10.5" - CHANNEL: "2.8.1" - package_prep_script: - # Allow analyzing plugins that use a Pigeon version with a higher - # minimum Flutter/Dart version than the plugin itself. - - ./script/tool_runner.sh remove-dev-dependencies - analyze_script: - # Only analyze lib/; non-client code doesn't need to work on - # all supported legacy version. - - ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml - # Does a sanity check that plugins pass analysis with the lowest possible - # versions of all dependencies. This is to catch cases where we add use of - # new APIs but forget to update minimum versions of dependencies to when - # those APIs are introduced. - - name: downgraded_analyze - depends_on: analyze - analyze_script: - - ./script/tool_runner.sh analyze --downgrade - - name: readme_excerpts - env: - CIRRUS_CLONE_SUBMODULES: true - script: ./script/tool_runner.sh update-excerpts --fail-on-change - ### Web tasks ### - - name: web-build_all_plugins - env: - BUILD_ALL_ARGS: "web" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - << : *BUILD_ALL_PLUGINS_APP_TEMPLATE - ### Linux desktop tasks ### - - name: linux-build_all_plugins - env: - BUILD_ALL_ARGS: "linux" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - setup_script: - - flutter config --enable-linux-desktop - << : *BUILD_ALL_PLUGINS_APP_TEMPLATE - - name: linux-platform_tests - # Don't run full platform tests on both channels in pre-submit. - skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' - env: - matrix: - CHANNEL: "master" - CHANNEL: "stable" - build_script: - - flutter config --enable-linux-desktop - - ./script/tool_runner.sh build-examples --linux - native_test_script: - - ./script/tool_runner.sh native-test --linux --no-integration - drive_script: - - xvfb-run ./script/tool_runner.sh drive-examples --linux - -# Heavy-workload Linux tasks. -# These use machines with more CPUs and memory, so will reduce parallelization -# for non-credit runs. -task: - << : *FLUTTER_UPGRADE_TEMPLATE - gke_container: - dockerfile: .ci/Dockerfile - builder_image_name: docker-builder-linux # gce vm image - builder_image_project: flutter-cirrus - cluster_name: test-cluster - zone: us-central1-a - namespace: default - cpu: 4 - memory: 12G - matrix: - ### Android tasks ### - - name: android-platform_tests - # Don't run full platform tests on both channels in pre-submit. - skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' - env: - matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 5" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 5" - PLUGIN_SHARDING: "--shardIndex 2 --shardCount 5" - PLUGIN_SHARDING: "--shardIndex 3 --shardCount 5" - PLUGIN_SHARDING: "--shardIndex 4 --shardCount 5" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] - GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[c84a06b85f9c906705732aea6142ef6f63ff1a6f07372dc36880a9d0c2c4b9cb35b2e35cd19edc6285167c2a5cc075ec] - build_script: - # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they - # might include non-ASCII characters which makes Gradle crash. - # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 - - export CIRRUS_CHANGE_MESSAGE="" - - export CIRRUS_COMMIT_MESSAGE="" - - ./script/tool_runner.sh build-examples --apk - lint_script: - # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they - # might include non-ASCII characters which makes Gradle crash. - # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 - - export CIRRUS_CHANGE_MESSAGE="" - - export CIRRUS_COMMIT_MESSAGE="" - - ./script/tool_runner.sh lint-android # must come after build-examples - native_unit_test_script: - # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they - # might include non-ASCII characters which makes Gradle crash. - # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 - - export CIRRUS_CHANGE_MESSAGE="" - - export CIRRUS_COMMIT_MESSAGE="" - # Native integration tests are handled by firebase-test-lab below, so - # only run unit tests. - # Must come after build-examples. - - ./script/tool_runner.sh native-test --android --no-integration --exclude script/configs/exclude_native_unit_android.yaml - firebase_test_lab_script: - # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they - # might include non-ASCII characters which makes Gradle crash. - # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 - - export CIRRUS_CHANGE_MESSAGE="" - - export CIRRUS_COMMIT_MESSAGE="" - - if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then - - echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json - - ./script/tool_runner.sh firebase-test-lab --device model=redfin,version=30 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml - - else - - echo "This user does not have permission to run Firebase Test Lab tests." - - fi - # Upload the full lint results to Cirrus to display in the results UI. - always: - android-lint_artifacts: - path: "**/reports/lint-results-debug.xml" - type: text/xml - format: android-lint - - name: android-build_all_plugins - env: - BUILD_ALL_ARGS: "apk" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - << : *BUILD_ALL_PLUGINS_APP_TEMPLATE - ### Web tasks ### - - name: web-platform_tests - env: - matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - CHROME_NO_SANDBOX: true - CHROME_DIR: /tmp/web_chromium/ - CHROME_EXECUTABLE: $CHROME_DIR/chrome-linux/chrome - install_script: - # Install a pinned version of Chromium and its corresponding ChromeDriver. - # Setting CHROME_EXECUTABLE above causes this version to be used for tests. - - ./script/install_chromium.sh "$CHROME_DIR" - chromedriver_background_script: - - cd "$CHROME_DIR" - - ./chromedriver/chromedriver --port=4444 - build_script: - - ./script/tool_runner.sh build-examples --web - drive_script: - - ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml - -# ARM macOS tasks. -task: - << : *MACOS_ARM_TEMPLATE - << : *FLUTTER_UPGRADE_TEMPLATE - matrix: - ### iOS tasks ### - - name: ios-build_all_plugins - env: - BUILD_ALL_ARGS: "ios --no-codesign" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - << : *BUILD_ALL_PLUGINS_APP_TEMPLATE - ### macOS desktop tasks ### - - name: macos-platform_tests - # Don't run full platform tests on both channels in pre-submit. - skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' - env: - matrix: - CHANNEL: "master" - CHANNEL: "stable" - PATH: $PATH:/usr/local/bin - build_script: - - flutter config --enable-macos-desktop - - ./script/tool_runner.sh build-examples --macos - xcode_analyze_script: - - ./script/tool_runner.sh xcode-analyze --macos - xcode_analyze_deprecation_script: - # Ensure we don't accidentally introduce deprecated code. - - ./script/tool_runner.sh xcode-analyze --macos --macos-min-version=12.3 - native_test_script: - - ./script/tool_runner.sh native-test --macos - drive_script: - - ./script/tool_runner.sh drive-examples --macos --exclude=script/configs/exclude_integration_macos.yaml - -# Intel macOS tasks. -task: - << : *MACOS_INTEL_TEMPLATE - << : *FLUTTER_UPGRADE_TEMPLATE - matrix: - ### iOS+macOS tasks *** - # TODO(stuartmorgan): Move this to ARM once google_maps_flutter has ARM - # support. `pod lint` makes a synthetic target that doesn't respect the - # pod's arch exclusions, so fails to build. - - name: darwin-lint_podspecs - script: - - ./script/tool_runner.sh podspecs - ### iOS tasks ### - # TODO(stuartmorgan): Swap this and ios-build_all_plugins once simulator - # tests are reliable on the ARM infrastructure. See discussion at - # https://github.com/flutter/plugins/pull/5693#issuecomment-1126011089 - - name: ios-platform_tests - # Don't run full platform tests on both channels in pre-submit. - skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' - env: - PATH: $PATH:/usr/local/bin - matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" - PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] - create_simulator_script: - - xcrun simctl list - - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-15-0 | xargs xcrun simctl boot - build_script: - - ./script/tool_runner.sh build-examples --ios - xcode_analyze_script: - - ./script/tool_runner.sh xcode-analyze --ios - xcode_analyze_deprecation_script: - # Ensure we don't accidentally introduce deprecated code. - - ./script/tool_runner.sh xcode-analyze --ios --ios-min-version=13.0 - native_test_script: - - ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest" - drive_script: - # `drive-examples` contains integration tests, which changes the UI of the application. - # This UI change sometimes affects `xctest`. - # So we run `drive-examples` after `native-test`; changing the order will result ci failure. - - ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml - ### macOS desktop tasks ### - # macos-platform_tests builds all the plugins on M1, so this build is run - # on Intel to give us build coverage of both host types. - - name: macos-build_all_plugins - env: - BUILD_ALL_ARGS: "macos" - matrix: - CHANNEL: "master" - CHANNEL: "stable" - setup_script: - - flutter config --enable-macos-desktop - << : *BUILD_ALL_PLUGINS_APP_TEMPLATE diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 2e5f1efd7934..8854deb4a216 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -191,6 +191,8 @@ class VersionCheckCommand extends PackageLoopingCommand { _gitVersionFinder = await retrieveVersionFinder(); _mergeBase = await _gitVersionFinder.getBaseSha(); _changedFiles = await _gitVersionFinder.getChangedFiles(); + + print('Labels found: $_prLabels'); } @override From 076ddaf93393155e02bf56beccef6013f97abdaf Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 13 Aug 2022 10:58:20 -0400 Subject: [PATCH 04/10] Restore the right CI step for debugging --- .cirrus.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 312c025bb1b1..745e5f451253 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -80,16 +80,20 @@ task: namespace: default matrix: ### Platform-agnostic tasks ### - - name: format - always: - format_script: ./script/tool_runner.sh format --fail-on-change - pubspec_script: ./script/tool_runner.sh pubspec-check - readme_script: - - ./script/tool_runner.sh readme-check - # Re-run with --require-excerpts, skipping packages that still need - # to be converted. Once https://github.com/flutter/flutter/issues/102679 - # has been fixed, this can be removed and there can just be a single - # run with --require-excerpts and no exclusions. - - ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml - license_script: dart $PLUGIN_TOOL license-check - dependabot_script: dart $PLUGIN_TOOL dependabot-check + - name: publishable + env: + CHANGE_DESC: "$TMPDIR/change-description.txt" + version_check_script: + # For pre-submit, pass the PR label, as well as the PR description or + # incremental commit message (for Dependabot checks), to the script to + # allow for version check overrides. + # For post-submit, ignore platform version breaking version changes and + # missing version/CHANGELOG detection since the overrides aren't + # available outside of the context of the PR. + - if [[ $CIRRUS_PR == "" ]]; then + - ./script/tool_runner.sh version-check --ignore-platform-interface-breaks + - else + - echo "$CIRRUS_CHANGE_MESSAGE" > "$CHANGE_DESC" + - ./script/tool_runner.sh version-check --check-for-missing-changes --change-description-file="$CHANGE_DESC" --pr-labels="$CIRRUS_PR_LABELS" + - fi + publish_check_script: ./script/tool_runner.sh publish-check From 851f937b2f7b0f4dee23d8742d1670b4f0bd073c Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 13 Aug 2022 11:03:11 -0400 Subject: [PATCH 05/10] More debugging --- script/tool/lib/src/version_check_command.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 8854deb4a216..4ca6982571d3 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -514,7 +514,9 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. /// Returns the labels associated with this PR, if any, or an empty set /// if that flag is not provided. Set _getPRLabels() { + print('getting PR labels'); final String labels = getStringArg(_prLabelsArg); + print('found string: "$labels" (${argResults!.wasParsed(_prLabelsArg)})'); if (labels.isEmpty) { return {}; } From 86e034931ad120d8859aaee8ab1bbe99bbca02f4 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 13 Aug 2022 11:09:23 -0400 Subject: [PATCH 06/10] Move debugging to .cirrus.yml for simplicity --- .cirrus.yml | 2 ++ script/tool/lib/src/version_check_command.dart | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 745e5f451253..e004fc4a24fa 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -83,6 +83,8 @@ task: - name: publishable env: CHANGE_DESC: "$TMPDIR/change-description.txt" + debug_script: + - echo "Labels: $CIRRUS_PR_LABELS" version_check_script: # For pre-submit, pass the PR label, as well as the PR description or # incremental commit message (for Dependabot checks), to the script to diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 4ca6982571d3..2e5f1efd7934 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -191,8 +191,6 @@ class VersionCheckCommand extends PackageLoopingCommand { _gitVersionFinder = await retrieveVersionFinder(); _mergeBase = await _gitVersionFinder.getBaseSha(); _changedFiles = await _gitVersionFinder.getChangedFiles(); - - print('Labels found: $_prLabels'); } @override @@ -514,9 +512,7 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. /// Returns the labels associated with this PR, if any, or an empty set /// if that flag is not provided. Set _getPRLabels() { - print('getting PR labels'); final String labels = getStringArg(_prLabelsArg); - print('found string: "$labels" (${argResults!.wasParsed(_prLabelsArg)})'); if (labels.isEmpty) { return {}; } From 0912d54e3a51170ca2d67b1688e9d31088a65b08 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 15 Aug 2022 14:08:04 -0400 Subject: [PATCH 07/10] Revert "Move debugging to .cirrus.yml for simplicity" This reverts commit 86e034931ad120d8859aaee8ab1bbe99bbca02f4. --- .cirrus.yml | 2 -- script/tool/lib/src/version_check_command.dart | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index e004fc4a24fa..745e5f451253 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -83,8 +83,6 @@ task: - name: publishable env: CHANGE_DESC: "$TMPDIR/change-description.txt" - debug_script: - - echo "Labels: $CIRRUS_PR_LABELS" version_check_script: # For pre-submit, pass the PR label, as well as the PR description or # incremental commit message (for Dependabot checks), to the script to diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 2e5f1efd7934..4ca6982571d3 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -191,6 +191,8 @@ class VersionCheckCommand extends PackageLoopingCommand { _gitVersionFinder = await retrieveVersionFinder(); _mergeBase = await _gitVersionFinder.getBaseSha(); _changedFiles = await _gitVersionFinder.getChangedFiles(); + + print('Labels found: $_prLabels'); } @override @@ -512,7 +514,9 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. /// Returns the labels associated with this PR, if any, or an empty set /// if that flag is not provided. Set _getPRLabels() { + print('getting PR labels'); final String labels = getStringArg(_prLabelsArg); + print('found string: "$labels" (${argResults!.wasParsed(_prLabelsArg)})'); if (labels.isEmpty) { return {}; } From 3d707f1406e2b02de6cfc9abb37aca87559fd65f Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 15 Aug 2022 14:08:07 -0400 Subject: [PATCH 08/10] Revert "More debugging" This reverts commit 851f937b2f7b0f4dee23d8742d1670b4f0bd073c. --- script/tool/lib/src/version_check_command.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 4ca6982571d3..8854deb4a216 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -514,9 +514,7 @@ ${indentation}The first version listed in CHANGELOG.md is $fromChangeLog. /// Returns the labels associated with this PR, if any, or an empty set /// if that flag is not provided. Set _getPRLabels() { - print('getting PR labels'); final String labels = getStringArg(_prLabelsArg); - print('found string: "$labels" (${argResults!.wasParsed(_prLabelsArg)})'); if (labels.isEmpty) { return {}; } From da50fcdd66a785bd306774faa722370a7e41b75c Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 15 Aug 2022 14:08:08 -0400 Subject: [PATCH 09/10] Revert "Restore the right CI step for debugging" This reverts commit 076ddaf93393155e02bf56beccef6013f97abdaf. --- .cirrus.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 745e5f451253..312c025bb1b1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -80,20 +80,16 @@ task: namespace: default matrix: ### Platform-agnostic tasks ### - - name: publishable - env: - CHANGE_DESC: "$TMPDIR/change-description.txt" - version_check_script: - # For pre-submit, pass the PR label, as well as the PR description or - # incremental commit message (for Dependabot checks), to the script to - # allow for version check overrides. - # For post-submit, ignore platform version breaking version changes and - # missing version/CHANGELOG detection since the overrides aren't - # available outside of the context of the PR. - - if [[ $CIRRUS_PR == "" ]]; then - - ./script/tool_runner.sh version-check --ignore-platform-interface-breaks - - else - - echo "$CIRRUS_CHANGE_MESSAGE" > "$CHANGE_DESC" - - ./script/tool_runner.sh version-check --check-for-missing-changes --change-description-file="$CHANGE_DESC" --pr-labels="$CIRRUS_PR_LABELS" - - fi - publish_check_script: ./script/tool_runner.sh publish-check + - name: format + always: + format_script: ./script/tool_runner.sh format --fail-on-change + pubspec_script: ./script/tool_runner.sh pubspec-check + readme_script: + - ./script/tool_runner.sh readme-check + # Re-run with --require-excerpts, skipping packages that still need + # to be converted. Once https://github.com/flutter/flutter/issues/102679 + # has been fixed, this can be removed and there can just be a single + # run with --require-excerpts and no exclusions. + - ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml + license_script: dart $PLUGIN_TOOL license-check + dependabot_script: dart $PLUGIN_TOOL dependabot-check From 180d4dc02a531f7dc2eb7e0ed23ef6c95db3ec14 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 15 Aug 2022 14:08:09 -0400 Subject: [PATCH 10/10] Revert "Script debugging" This reverts commit 9f2b6fe4367363f5e4a996b69629eaa72ef3b3d8. --- .cirrus.yml | 321 ++++++++++++++++++ .../tool/lib/src/version_check_command.dart | 2 - 2 files changed, 321 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 312c025bb1b1..3d0c525a5c42 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -80,6 +80,27 @@ task: namespace: default matrix: ### Platform-agnostic tasks ### + - name: Linux plugin_tools_tests + script: + - cd script/tool + - dart pub run test + - name: publishable + env: + CHANGE_DESC: "$TMPDIR/change-description.txt" + version_check_script: + # For pre-submit, pass the PR label, as well as the PR description or + # incremental commit message (for Dependabot checks), to the script to + # allow for version check overrides. + # For post-submit, ignore platform version breaking version changes and + # missing version/CHANGELOG detection since the overrides aren't + # available outside of the context of the PR. + - if [[ $CIRRUS_PR == "" ]]; then + - ./script/tool_runner.sh version-check --ignore-platform-interface-breaks + - else + - echo "$CIRRUS_CHANGE_MESSAGE" > "$CHANGE_DESC" + - ./script/tool_runner.sh version-check --check-for-missing-changes --change-description-file="$CHANGE_DESC" --pr-labels="$CIRRUS_PR_LABELS" + - fi + publish_check_script: ./script/tool_runner.sh publish-check - name: format always: format_script: ./script/tool_runner.sh format --fail-on-change @@ -93,3 +114,303 @@ task: - ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml license_script: dart $PLUGIN_TOOL license-check dependabot_script: dart $PLUGIN_TOOL dependabot-check + - name: federated_safety + # This check is only meaningful for PRs, as it validates changes + # rather than state. + only_if: $CIRRUS_PR != "" + script: ./script/tool_runner.sh federation-safety-check + - name: dart_unit_tests + env: + matrix: + CHANNEL: "master" + CHANNEL: "stable" + test_script: + - ./script/tool_runner.sh test + - name: analyze + env: + matrix: + CHANNEL: "master" + CHANNEL: "stable" + analyze_tool_script: + - cd script/tool + - dart analyze --fatal-infos + analyze_script: + # DO NOT change the custom-analysis argument here without changing the Dart repo. + # See the comment in script/configs/custom_analysis.yaml for details. + - ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml + pathified_analyze_script: + # Re-run analysis with path-based dependencies to ensure that publishing + # the changes won't break analysis of other packages in the respository + # that depend on it. + - ./script/tool_runner.sh make-deps-path-based --target-dependencies-with-non-breaking-updates + # This uses --run-on-dirty-packages rather than --packages-for-branch + # since only the packages changed by 'make-deps-path-based' need to be + # checked. + - dart $PLUGIN_TOOL analyze --run-on-dirty-packages --log-timing --custom-analysis=script/configs/custom_analysis.yaml + # Restore the tree to a clean state, to avoid accidental issues if + # other script steps are added to this task. + - git checkout . + # Does a sanity check that plugins at least pass analysis on the N-1 and N-2 + # versions of Flutter stable if the plugin claims to support that version. + # This is to minimize accidentally making changes that break old versions + # (which we don't commit to supporting, but don't want to actively break) + # without updating the constraints. + # Note: The versions below should be manually updated after a new stable + # version comes out. + - name: legacy-version-analyze + depends_on: analyze + env: + matrix: + CHANNEL: "2.10.5" + CHANNEL: "2.8.1" + package_prep_script: + # Allow analyzing plugins that use a Pigeon version with a higher + # minimum Flutter/Dart version than the plugin itself. + - ./script/tool_runner.sh remove-dev-dependencies + analyze_script: + # Only analyze lib/; non-client code doesn't need to work on + # all supported legacy version. + - ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml + # Does a sanity check that plugins pass analysis with the lowest possible + # versions of all dependencies. This is to catch cases where we add use of + # new APIs but forget to update minimum versions of dependencies to when + # those APIs are introduced. + - name: downgraded_analyze + depends_on: analyze + analyze_script: + - ./script/tool_runner.sh analyze --downgrade + - name: readme_excerpts + env: + CIRRUS_CLONE_SUBMODULES: true + script: ./script/tool_runner.sh update-excerpts --fail-on-change + ### Web tasks ### + - name: web-build_all_plugins + env: + BUILD_ALL_ARGS: "web" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + << : *BUILD_ALL_PLUGINS_APP_TEMPLATE + ### Linux desktop tasks ### + - name: linux-build_all_plugins + env: + BUILD_ALL_ARGS: "linux" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + setup_script: + - flutter config --enable-linux-desktop + << : *BUILD_ALL_PLUGINS_APP_TEMPLATE + - name: linux-platform_tests + # Don't run full platform tests on both channels in pre-submit. + skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' + env: + matrix: + CHANNEL: "master" + CHANNEL: "stable" + build_script: + - flutter config --enable-linux-desktop + - ./script/tool_runner.sh build-examples --linux + native_test_script: + - ./script/tool_runner.sh native-test --linux --no-integration + drive_script: + - xvfb-run ./script/tool_runner.sh drive-examples --linux + +# Heavy-workload Linux tasks. +# These use machines with more CPUs and memory, so will reduce parallelization +# for non-credit runs. +task: + << : *FLUTTER_UPGRADE_TEMPLATE + gke_container: + dockerfile: .ci/Dockerfile + builder_image_name: docker-builder-linux # gce vm image + builder_image_project: flutter-cirrus + cluster_name: test-cluster + zone: us-central1-a + namespace: default + cpu: 4 + memory: 12G + matrix: + ### Android tasks ### + - name: android-platform_tests + # Don't run full platform tests on both channels in pre-submit. + skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' + env: + matrix: + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 5" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 5" + PLUGIN_SHARDING: "--shardIndex 2 --shardCount 5" + PLUGIN_SHARDING: "--shardIndex 3 --shardCount 5" + PLUGIN_SHARDING: "--shardIndex 4 --shardCount 5" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] + GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[c84a06b85f9c906705732aea6142ef6f63ff1a6f07372dc36880a9d0c2c4b9cb35b2e35cd19edc6285167c2a5cc075ec] + build_script: + # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they + # might include non-ASCII characters which makes Gradle crash. + # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 + - export CIRRUS_CHANGE_MESSAGE="" + - export CIRRUS_COMMIT_MESSAGE="" + - ./script/tool_runner.sh build-examples --apk + lint_script: + # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they + # might include non-ASCII characters which makes Gradle crash. + # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 + - export CIRRUS_CHANGE_MESSAGE="" + - export CIRRUS_COMMIT_MESSAGE="" + - ./script/tool_runner.sh lint-android # must come after build-examples + native_unit_test_script: + # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they + # might include non-ASCII characters which makes Gradle crash. + # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 + - export CIRRUS_CHANGE_MESSAGE="" + - export CIRRUS_COMMIT_MESSAGE="" + # Native integration tests are handled by firebase-test-lab below, so + # only run unit tests. + # Must come after build-examples. + - ./script/tool_runner.sh native-test --android --no-integration --exclude script/configs/exclude_native_unit_android.yaml + firebase_test_lab_script: + # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they + # might include non-ASCII characters which makes Gradle crash. + # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935 + - export CIRRUS_CHANGE_MESSAGE="" + - export CIRRUS_COMMIT_MESSAGE="" + - if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then + - echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json + - ./script/tool_runner.sh firebase-test-lab --device model=redfin,version=30 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml + - else + - echo "This user does not have permission to run Firebase Test Lab tests." + - fi + # Upload the full lint results to Cirrus to display in the results UI. + always: + android-lint_artifacts: + path: "**/reports/lint-results-debug.xml" + type: text/xml + format: android-lint + - name: android-build_all_plugins + env: + BUILD_ALL_ARGS: "apk" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + << : *BUILD_ALL_PLUGINS_APP_TEMPLATE + ### Web tasks ### + - name: web-platform_tests + env: + matrix: + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + CHROME_NO_SANDBOX: true + CHROME_DIR: /tmp/web_chromium/ + CHROME_EXECUTABLE: $CHROME_DIR/chrome-linux/chrome + install_script: + # Install a pinned version of Chromium and its corresponding ChromeDriver. + # Setting CHROME_EXECUTABLE above causes this version to be used for tests. + - ./script/install_chromium.sh "$CHROME_DIR" + chromedriver_background_script: + - cd "$CHROME_DIR" + - ./chromedriver/chromedriver --port=4444 + build_script: + - ./script/tool_runner.sh build-examples --web + drive_script: + - ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml + +# ARM macOS tasks. +task: + << : *MACOS_ARM_TEMPLATE + << : *FLUTTER_UPGRADE_TEMPLATE + matrix: + ### iOS tasks ### + - name: ios-build_all_plugins + env: + BUILD_ALL_ARGS: "ios --no-codesign" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + << : *BUILD_ALL_PLUGINS_APP_TEMPLATE + ### macOS desktop tasks ### + - name: macos-platform_tests + # Don't run full platform tests on both channels in pre-submit. + skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' + env: + matrix: + CHANNEL: "master" + CHANNEL: "stable" + PATH: $PATH:/usr/local/bin + build_script: + - flutter config --enable-macos-desktop + - ./script/tool_runner.sh build-examples --macos + xcode_analyze_script: + - ./script/tool_runner.sh xcode-analyze --macos + xcode_analyze_deprecation_script: + # Ensure we don't accidentally introduce deprecated code. + - ./script/tool_runner.sh xcode-analyze --macos --macos-min-version=12.3 + native_test_script: + - ./script/tool_runner.sh native-test --macos + drive_script: + - ./script/tool_runner.sh drive-examples --macos --exclude=script/configs/exclude_integration_macos.yaml + +# Intel macOS tasks. +task: + << : *MACOS_INTEL_TEMPLATE + << : *FLUTTER_UPGRADE_TEMPLATE + matrix: + ### iOS+macOS tasks *** + # TODO(stuartmorgan): Move this to ARM once google_maps_flutter has ARM + # support. `pod lint` makes a synthetic target that doesn't respect the + # pod's arch exclusions, so fails to build. + - name: darwin-lint_podspecs + script: + - ./script/tool_runner.sh podspecs + ### iOS tasks ### + # TODO(stuartmorgan): Swap this and ios-build_all_plugins once simulator + # tests are reliable on the ARM infrastructure. See discussion at + # https://github.com/flutter/plugins/pull/5693#issuecomment-1126011089 + - name: ios-platform_tests + # Don't run full platform tests on both channels in pre-submit. + skip: $CIRRUS_PR != '' && $CHANNEL == 'stable' + env: + PATH: $PATH:/usr/local/bin + matrix: + PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4" + PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550] + create_simulator_script: + - xcrun simctl list + - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-15-0 | xargs xcrun simctl boot + build_script: + - ./script/tool_runner.sh build-examples --ios + xcode_analyze_script: + - ./script/tool_runner.sh xcode-analyze --ios + xcode_analyze_deprecation_script: + # Ensure we don't accidentally introduce deprecated code. + - ./script/tool_runner.sh xcode-analyze --ios --ios-min-version=13.0 + native_test_script: + - ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest" + drive_script: + # `drive-examples` contains integration tests, which changes the UI of the application. + # This UI change sometimes affects `xctest`. + # So we run `drive-examples` after `native-test`; changing the order will result ci failure. + - ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml + ### macOS desktop tasks ### + # macos-platform_tests builds all the plugins on M1, so this build is run + # on Intel to give us build coverage of both host types. + - name: macos-build_all_plugins + env: + BUILD_ALL_ARGS: "macos" + matrix: + CHANNEL: "master" + CHANNEL: "stable" + setup_script: + - flutter config --enable-macos-desktop + << : *BUILD_ALL_PLUGINS_APP_TEMPLATE diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart index 8854deb4a216..2e5f1efd7934 100644 --- a/script/tool/lib/src/version_check_command.dart +++ b/script/tool/lib/src/version_check_command.dart @@ -191,8 +191,6 @@ class VersionCheckCommand extends PackageLoopingCommand { _gitVersionFinder = await retrieveVersionFinder(); _mergeBase = await _gitVersionFinder.getBaseSha(); _changedFiles = await _gitVersionFinder.getChangedFiles(); - - print('Labels found: $_prLabels'); } @override