mirror of
https://github.com/flutter/packages.git
synced 2025-06-23 00:25:38 +08:00
[ci] Add initial LUCI legacy analysis (#4428)
Adds new legacy analysis targets to LUCI in bringup mode. Also updates the repo tooling to use a Flutter->Dart version mapping instead of having to separately maintain a Dart version, now that we already have such a map in the tool anyway. Part of https://github.com/flutter/flutter/issues/114373
This commit is contained in:
18
.ci.yaml
18
.ci.yaml
@ -228,6 +228,24 @@ targets:
|
||||
channel: stable
|
||||
version_file: flutter_stable.version
|
||||
|
||||
# Analyze with the previous stable (N-1) and the stable before that (N-2). The
|
||||
# versions in `channel` should be updated after a new major stable release.
|
||||
- name: Linux analyze_legacy N-1
|
||||
bringup: true # New target
|
||||
recipe: packages/packages
|
||||
timeout: 30
|
||||
properties:
|
||||
target_file: analyze_legacy.yaml
|
||||
channel: "3.7.12"
|
||||
|
||||
- name: Linux analyze_legacy N-2
|
||||
bringup: true # New target
|
||||
recipe: packages/packages
|
||||
timeout: 30
|
||||
properties:
|
||||
target_file: analyze_legacy.yaml
|
||||
channel: "3.3.10"
|
||||
|
||||
- name: Linux_android custom_package_tests master
|
||||
recipe: packages/packages
|
||||
timeout: 30
|
||||
|
23
.ci/scripts/analyze_legacy.sh
Executable file
23
.ci/scripts/analyze_legacy.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/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
|
||||
|
||||
# Allow analyzing packages that use a dev dependency with a higher minimum
|
||||
# Flutter/Dart version than the package itself. Non-client code doesn't need to
|
||||
# work in legacy versions.
|
||||
#
|
||||
# This requires the --lib-only flag below.
|
||||
./script/tool_runner.sh remove-dev-dependencies
|
||||
|
||||
# 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.
|
||||
./script/tool_runner.sh analyze --lib-only \
|
||||
--skip-if-not-supporting-flutter-version="$CHANNEL" \
|
||||
--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 .
|
0
.ci/scripts/dart_unit_tests_pathified.sh
Normal file → Executable file
0
.ci/scripts/dart_unit_tests_pathified.sh
Normal file → Executable file
@ -12,4 +12,4 @@ tasks:
|
||||
# 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
|
||||
script: .ci/scripts/analyze_pathified.sh
|
||||
|
11
.ci/targets/analyze_legacy.yaml
Normal file
11
.ci/targets/analyze_legacy.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
tasks:
|
||||
- name: prepare tool
|
||||
script: .ci/scripts/prepare_tool.sh
|
||||
# Does a sanity check that packages at least pass analysis on the N-1 and N-2
|
||||
# versions of Flutter stable if the package 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.
|
||||
# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#supported-flutter-versions
|
||||
- name: analyze - legacy
|
||||
script: .ci/scripts/analyze_legacy.sh
|
@ -10,7 +10,7 @@ tasks:
|
||||
args: ["license-check"]
|
||||
always: true
|
||||
# The major and minor version here should match the lowest version analyzed
|
||||
# in legacy version analysis (currently .cirrus.yaml legacy_version_analyze).
|
||||
# in legacy version analysis (.ci.yaml analyze_legacy).
|
||||
- name: pubspec validation
|
||||
script: script/tool_runner.sh
|
||||
args:
|
||||
|
@ -96,10 +96,8 @@ task:
|
||||
# Change the arguments to pubspec-check when changing these values.
|
||||
env:
|
||||
CHANNEL: "3.7.12"
|
||||
DART_VERSION: "2.17.6"
|
||||
env:
|
||||
CHANNEL: "3.3.10"
|
||||
DART_VERSION: "2.18.6"
|
||||
package_prep_script:
|
||||
# Allow analyzing packages that use a dev dependency with a higher
|
||||
# minimum Flutter/Dart version than the package itself.
|
||||
@ -107,7 +105,7 @@ task:
|
||||
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" --skip-if-not-supporting-dart-version="$DART_VERSION" --custom-analysis=script/configs/custom_analysis.yaml
|
||||
- ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml
|
||||
- name: readme_excerpts
|
||||
env:
|
||||
CIRRUS_CLONE_SUBMODULES: true
|
||||
|
@ -44,7 +44,9 @@ final Map<Version, Version> _dartSdkForFlutterSdk = <Version, Version>{
|
||||
Version(3, 0, 0): Version(2, 17, 0),
|
||||
Version(3, 0, 5): Version(2, 17, 6),
|
||||
Version(3, 3, 0): Version(2, 18, 0),
|
||||
Version(3, 3, 10): Version(2, 18, 6),
|
||||
Version(3, 7, 0): Version(2, 19, 0),
|
||||
Version(3, 7, 12): Version(2, 19, 6),
|
||||
Version(3, 10, 0): Version(3, 0, 0),
|
||||
};
|
||||
|
||||
|
@ -90,19 +90,13 @@ abstract class PackageLoopingCommand extends PackageCommand {
|
||||
argParser.addOption(
|
||||
_skipByFlutterVersionArg,
|
||||
help: 'Skip any packages that require a Flutter version newer than '
|
||||
'the provided version.',
|
||||
);
|
||||
argParser.addOption(
|
||||
_skipByDartVersionArg,
|
||||
help: 'Skip any packages that require a Dart version newer than '
|
||||
'the provided version.',
|
||||
'the provided version, or a Dart version newer than the '
|
||||
'corresponding Dart version.',
|
||||
);
|
||||
}
|
||||
|
||||
static const String _skipByFlutterVersionArg =
|
||||
'skip-if-not-supporting-flutter-version';
|
||||
static const String _skipByDartVersionArg =
|
||||
'skip-if-not-supporting-dart-version';
|
||||
|
||||
/// Packages that had at least one [logWarning] call.
|
||||
final Set<PackageEnumerationEntry> _packagesWithWarnings =
|
||||
@ -267,9 +261,9 @@ abstract class PackageLoopingCommand extends PackageCommand {
|
||||
final Version? minFlutterVersion = minFlutterVersionArg.isEmpty
|
||||
? null
|
||||
: Version.parse(minFlutterVersionArg);
|
||||
final String minDartVersionArg = getStringArg(_skipByDartVersionArg);
|
||||
final Version? minDartVersion =
|
||||
minDartVersionArg.isEmpty ? null : Version.parse(minDartVersionArg);
|
||||
final Version? minDartVersion = minFlutterVersion == null
|
||||
? null
|
||||
: getDartSdkForFlutterSdk(minFlutterVersion);
|
||||
|
||||
final DateTime runStart = DateTime.now();
|
||||
|
||||
|
@ -373,15 +373,16 @@ void main() {
|
||||
test('skips unsupported Dart versions when requested', () async {
|
||||
final RepositoryPackage excluded = createFakePackage(
|
||||
'excluded_package', packagesDir,
|
||||
dartConstraint: '>=2.17.0 <4.0.0');
|
||||
dartConstraint: '>=2.18.0 <4.0.0');
|
||||
final RepositoryPackage included =
|
||||
createFakePackage('a_package', packagesDir);
|
||||
|
||||
final TestPackageLoopingCommand command = createTestCommand(
|
||||
packageLoopingType: PackageLoopingType.includeAllSubpackages,
|
||||
hasLongOutput: false);
|
||||
final List<String> output = await runCommand(command,
|
||||
arguments: <String>['--skip-if-not-supporting-dart-version=2.14.0']);
|
||||
final List<String> output = await runCommand(command, arguments: <String>[
|
||||
'--skip-if-not-supporting-flutter-version=3.0.0' // Flutter 3.0.0 -> Dart 2.17.0
|
||||
]);
|
||||
|
||||
expect(
|
||||
command.checkedPackages,
|
||||
@ -396,7 +397,7 @@ void main() {
|
||||
containsAllInOrder(<String>[
|
||||
'${_startHeadingColor}Running for a_package...$_endColor',
|
||||
'${_startHeadingColor}Running for excluded_package...$_endColor',
|
||||
'$_startSkipColor SKIPPING: Does not support Dart 2.14.0$_endColor',
|
||||
'$_startSkipColor SKIPPING: Does not support Dart 2.17.0$_endColor',
|
||||
]));
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user