From 89f0ed12cb9ebd870b48fa53010749a202ae06b2 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 19 Jun 2023 19:30:23 -0400 Subject: [PATCH 1/5] [ci] Add LUCI version of the analyze task WIP - testing in existing task. --- .ci.yaml | 2 +- .ci/scripts/analyze_repo_tools.sh | 8 ++++++++ .ci/scripts/pathified_analyze.sh | 17 +++++++++++++++++ .ci/targets/repo_tools_tests.yaml | 17 +++++++++++++++-- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100755 .ci/scripts/analyze_repo_tools.sh create mode 100755 .ci/scripts/pathified_analyze.sh diff --git a/.ci.yaml b/.ci.yaml index 8dc53d81b7c..adc60ca3235 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -69,7 +69,7 @@ platform_properties: } targets: - ### Linux-host tasks ### + ### Linux-host general tasks ### - name: Linux repo_tools_tests recipe: packages/packages timeout: 30 diff --git a/.ci/scripts/analyze_repo_tools.sh b/.ci/scripts/analyze_repo_tools.sh new file mode 100755 index 00000000000..df2a87c04a9 --- /dev/null +++ b/.ci/scripts/analyze_repo_tools.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +set -e + +cd script/tool +dart analyze --fatal-infos diff --git a/.ci/scripts/pathified_analyze.sh b/.ci/scripts/pathified_analyze.sh new file mode 100755 index 00000000000..2942cf7d57b --- /dev/null +++ b/.ci/scripts/pathified_analyze.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +set -e + +# Pathify the dependencies on changed packages (excluding major version +# changes, which won't affect clients). +./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 +# re-checked. +dart ./script/tool/bin/flutter_plugin_tools.dart 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 the enclosing task. +git checkout . diff --git a/.ci/targets/repo_tools_tests.yaml b/.ci/targets/repo_tools_tests.yaml index 265e74bdd06..a6c9e9067b0 100644 --- a/.ci/targets/repo_tools_tests.yaml +++ b/.ci/targets/repo_tools_tests.yaml @@ -1,5 +1,18 @@ tasks: - name: prepare tool script: .ci/scripts/prepare_tool.sh - - name: tool unit tests - script: .ci/scripts/plugin_tools_tests.sh +# Not for landing: pre-testing adding analyze. + - name: analyze repo tools + script: script/analyze_repo_tools.sh + - name: analyze + script: script/tool_runner.sh + # DO NOT change the custom-analysis argument here without changing the Dart repo. + # See the comment in script/configs/custom_analysis.yaml for details. + args: ["analyze", "--custom-analysis=script/configs/custom_analysis.yaml"] + # 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. + - name: analyze - pathified + script: script/pathified_analyze.sh +# - name: tool unit tests +# script: .ci/scripts/plugin_tools_tests.sh From 9bbd26e6a35ecc3ecc2021967d463f45107caca1 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 20 Jun 2023 08:14:16 -0400 Subject: [PATCH 2/5] Fix script paths --- .ci/targets/repo_tools_tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/targets/repo_tools_tests.yaml b/.ci/targets/repo_tools_tests.yaml index a6c9e9067b0..bc4635f404f 100644 --- a/.ci/targets/repo_tools_tests.yaml +++ b/.ci/targets/repo_tools_tests.yaml @@ -3,7 +3,7 @@ tasks: script: .ci/scripts/prepare_tool.sh # Not for landing: pre-testing adding analyze. - name: analyze repo tools - script: script/analyze_repo_tools.sh + script: .ci/script/analyze_repo_tools.sh - name: analyze script: script/tool_runner.sh # DO NOT change the custom-analysis argument here without changing the Dart repo. @@ -13,6 +13,6 @@ tasks: # the changes won't break analysis of other packages in the respository # that depend on it. - name: analyze - pathified - script: script/pathified_analyze.sh + script: .ci/script/pathified_analyze.sh # - name: tool unit tests # script: .ci/scripts/plugin_tools_tests.sh From f264c25f0cfb25a364694fbe76b9c93c4a7ae663 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 20 Jun 2023 08:21:02 -0400 Subject: [PATCH 3/5] Fix script paths again --- .ci/targets/repo_tools_tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/targets/repo_tools_tests.yaml b/.ci/targets/repo_tools_tests.yaml index bc4635f404f..870e73719f6 100644 --- a/.ci/targets/repo_tools_tests.yaml +++ b/.ci/targets/repo_tools_tests.yaml @@ -3,7 +3,7 @@ tasks: script: .ci/scripts/prepare_tool.sh # Not for landing: pre-testing adding analyze. - name: analyze repo tools - script: .ci/script/analyze_repo_tools.sh + script: .ci/scripts/analyze_repo_tools.sh - name: analyze script: script/tool_runner.sh # DO NOT change the custom-analysis argument here without changing the Dart repo. @@ -13,6 +13,6 @@ tasks: # the changes won't break analysis of other packages in the respository # that depend on it. - name: analyze - pathified - script: .ci/script/pathified_analyze.sh + script: .ci/scripts/pathified_analyze.sh # - name: tool unit tests # script: .ci/scripts/plugin_tools_tests.sh From a80d97bc17efbadc189ce3cfac464054fa7aba35 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 20 Jun 2023 08:41:32 -0400 Subject: [PATCH 4/5] Move working analyze to new script, try downgrade --- .ci.yaml | 18 ++++++++++++++++++ .ci/targets/analyze.yaml | 15 +++++++++++++++ .ci/targets/repo_tools_tests.yaml | 16 ++++------------ 3 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 .ci/targets/analyze.yaml diff --git a/.ci.yaml b/.ci.yaml index adc60ca3235..ddd79259567 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -79,6 +79,24 @@ targets: channel: master version_file: flutter_master.version + - name: Linux analyze master + bringup: true # New target + recipe: packages/packages + timeout: 30 + properties: + target_file: analyze.yaml + channel: master + version_file: flutter_master.version + + - name: Linux analyze stable + bringup: true # New target + recipe: packages/packages + timeout: 30 + properties: + target_file: analyze.yaml + channel: stable + version_file: flutter_stable.version + ### Web tasks ### - name: Linux_web web_build_all_packages master bringup: true # New target diff --git a/.ci/targets/analyze.yaml b/.ci/targets/analyze.yaml new file mode 100644 index 00000000000..25791d3c898 --- /dev/null +++ b/.ci/targets/analyze.yaml @@ -0,0 +1,15 @@ +tasks: + - name: prepare tool + script: .ci/scripts/prepare_tool.sh + - name: analyze repo tools + script: .ci/scripts/analyze_repo_tools.sh + - name: analyze + script: script/tool_runner.sh + # DO NOT change the custom-analysis argument here without changing the Dart repo. + # See the comment in script/configs/custom_analysis.yaml for details. + args: ["analyze", "--custom-analysis=script/configs/custom_analysis.yaml"] + # 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. + - name: analyze - pathified + script: .ci/scripts/pathified_analyze.sh diff --git a/.ci/targets/repo_tools_tests.yaml b/.ci/targets/repo_tools_tests.yaml index 870e73719f6..79ae190a3e1 100644 --- a/.ci/targets/repo_tools_tests.yaml +++ b/.ci/targets/repo_tools_tests.yaml @@ -1,18 +1,10 @@ tasks: - name: prepare tool script: .ci/scripts/prepare_tool.sh -# Not for landing: pre-testing adding analyze. - - name: analyze repo tools - script: .ci/scripts/analyze_repo_tools.sh - - name: analyze +# Not for landing: pre-testing adding analyze scripts. +# WIP test for downgraded_analyze + - name: analyze - downgraded script: script/tool_runner.sh - # DO NOT change the custom-analysis argument here without changing the Dart repo. - # See the comment in script/configs/custom_analysis.yaml for details. - args: ["analyze", "--custom-analysis=script/configs/custom_analysis.yaml"] - # 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. - - name: analyze - pathified - script: .ci/scripts/pathified_analyze.sh + args: ["analyze", "--downgrade", "--custom-analysis=script/configs/custom_analysis.yaml"] # - name: tool unit tests # script: .ci/scripts/plugin_tools_tests.sh From e2d7fa9b93d83ece18e44f7ccc775ac79ff8ae80 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 20 Jun 2023 11:27:58 -0400 Subject: [PATCH 5/5] Move downgrade to a new script --- .ci.yaml | 18 ++++++++++++++++++ .ci/targets/analyze_downgraded.yaml | 10 ++++++++++ .ci/targets/repo_tools_tests.yaml | 9 ++------- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 .ci/targets/analyze_downgraded.yaml diff --git a/.ci.yaml b/.ci.yaml index ddd79259567..12968d7df6c 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -97,6 +97,24 @@ targets: channel: stable version_file: flutter_stable.version + - name: Linux analyze_downgraded master + bringup: true # New target + recipe: packages/packages + timeout: 30 + properties: + target_file: analyze_downgraded.yaml + channel: master + version_file: flutter_master.version + + - name: Linux analyze_downgraded stable + bringup: true # New target + recipe: packages/packages + timeout: 30 + properties: + target_file: analyze_downgraded.yaml + channel: stable + version_file: flutter_stable.version + ### Web tasks ### - name: Linux_web web_build_all_packages master bringup: true # New target diff --git a/.ci/targets/analyze_downgraded.yaml b/.ci/targets/analyze_downgraded.yaml new file mode 100644 index 00000000000..46bc111b30c --- /dev/null +++ b/.ci/targets/analyze_downgraded.yaml @@ -0,0 +1,10 @@ +tasks: + - name: prepare tool + script: .ci/scripts/prepare_tool.sh + # Does a sanity check that packages 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 where + # those APIs are introduced. + - name: analyze - downgraded + script: script/tool_runner.sh + args: ["analyze", "--downgrade", "--custom-analysis=script/configs/custom_analysis.yaml"] diff --git a/.ci/targets/repo_tools_tests.yaml b/.ci/targets/repo_tools_tests.yaml index 79ae190a3e1..265e74bdd06 100644 --- a/.ci/targets/repo_tools_tests.yaml +++ b/.ci/targets/repo_tools_tests.yaml @@ -1,10 +1,5 @@ tasks: - name: prepare tool script: .ci/scripts/prepare_tool.sh -# Not for landing: pre-testing adding analyze scripts. -# WIP test for downgraded_analyze - - name: analyze - downgraded - script: script/tool_runner.sh - args: ["analyze", "--downgrade", "--custom-analysis=script/configs/custom_analysis.yaml"] -# - name: tool unit tests -# script: .ci/scripts/plugin_tools_tests.sh + - name: tool unit tests + script: .ci/scripts/plugin_tools_tests.sh