| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
ci: Support --target_arch option in prepare_package.dart (#190960) Adds a `--target_arch=<x64|arm64>` option to `dev/bots/prepare_package.dart` to support cross-packaging SDK archives for a target architecture different from the host architecture. When target arch is specified, we set `FLUTTER_HOST_ARCH` in the environment of each subprocess spawned by the packaging script. This is picked up by `update_dart_sdk.sh` and `update_dart_sdk.ps1` when choosing which Dart SDK to download, and by `OperatingSystemUtils.hostPlatform` when the tool picks which host engine artifacts to cache. Those run from `bin/flutter` before the flutter tool exists, so the environment is the only means we have to pass this setting. This patch allows arm64 macOS CI hosts to download and cache x64 host engine artifacts when cross-packaging x64 Flutter SDK release archives on an arm64 host (or theoretically vice-versa, but we'll never do that) in the `packaging/packaging` recipe in `packaging.py`. It's worth noting that the scripts and tool this drives are the ones in the branch being packaged, not the ones this script was run from, so `--target_arch` depends on that branch having cherry-picks to handle both `FLUTTER_HOST_ARCH` support in `bin/internal/update_dart_sdk.{sh,ps1}` (#190421) and the `--host-arch` option of `flutter precache` (#190480). See: https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/packaging/packaging.py Issue: https://github.com/flutter/flutter/issues/189144 <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 27 天前 | |
Fix parsing of --enable-hcpp-and-surface-control switch and add --no-enable-hcpp tests (#192202) ## Description This PR fixes an issue where passing `--no-enable-hcpp` failed to disable SurfaceControl on Android, and adds integration tests to positively validate that `--no-enable-hcpp` disables HCPP and falls back to legacy platform view rendering. ### Background & Root Cause In PR #190623, `enableHcpp` in the Flutter tool was converted from a non-nullable `bool` to a nullable `bool?` to support overriding manifest metadata via CLI (`--enable-hcpp` vs `--no-enable-hcpp`). This led to `device.dart` forwarding `--ez enable-hcpp-and-surface-control false` as an intent extra when `--no-enable-hcpp` was passed. In turn, `FlutterShellArgs` converted this extra to the command-line flag `--enable-hcpp-and-surface-control=false`. However, the engine's switch parser in `switches.cc` checked: ```cpp settings.enable_surface_control = command_line.HasOption(FlagForSwitch(Switch::EnableAndroidHcppAndSurfaceControl)); ``` Because `fml::CommandLine::HasOption` only checks whether the switch key is present regardless of its assigned value, `--enable-hcpp-and-surface-control=false` evaluated to `true`, keeping SurfaceControl enabled even when `--no-enable-hcpp` was passed. ### Changes This PR is split into two commits: 1. **Commit 1 (`97a2282ef03`)**: Add integration / driver tests in `run_android_engine_tests.dart` and `upgrade_legacy_pv_types_main_test.dart` to positively test that `--no-enable-hcpp` disables HCPP and falls back to legacy platform view rendering (`Using legacy platform view rendering strategy.`). 2. **Commit 2 (`a00f2c65372`)**: Update `switches.cc` to inspect the switch value using `command_line.GetOptionValue(...)`, verifying that it is empty (flag without value) or `"true"`. Add unit tests in `switches_unittests.cc` covering `--enable-hcpp-and-surface-control=true`, `--enable-hcpp-and-surface-control`, `--enable-hcpp-and-surface-control=false`, and absence of the flag. --- > [!NOTE] > This pull request was generated with Gemini / AI assistance for transparency. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 5 天前 | |
Remove legacy gen_defaults analyze checks (#191629) Related to https://github.com/flutter/flutter/issues/184950 This PR is to remove the legacy `gen-defaults-names` and `gen-defaults-up-to-date` analyze checks from Flutter CI. These checks validate `dev/tools/gen_defaults`, which has become legacy and only targets the frozen SDK Material library under `packages/flutter/lib/src/material`. Material development has moved to the standalone `material_ui` packages in `flutter/packages`, and we introduced new `gen_defaults` script in flutter/packages, so these check for old script is not useful at all. This PR also removes the now-unused helper methods and their test coverage. TODO: the old `gen_defaults` tool should eventually be deprecated and removed. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. | 14 天前 | |
fix: documentation around led launch broken (#171983) When we removed is_fusion, this document was left with a dangling "led edit -pa". Removed. | 1 年前 | |
Migrate to listen package (#189111) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> as title will publish stable for listen package once this is approved ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 8 天前 | |
Roll pub packages (#188764) This PR was generated by `flutter update-packages --force-upgrade`. | 2 个月前 | |
[analysis] Upgrade package:analyzer to 14.3.0 and enable custom plugin compilation (#191590) ## Description Upgrades `package:analyzer` to `14.2.0` and `_fe_analyzer_shared` to `106.0.0` in the root `pubspec.yaml`, pulling in modern transitive dependencies (`analysis_server_plugin: 0.3.21`, `analyzer_plugin: 0.14.15`, `dart_style: 3.1.12`, and `analyzer_testing: 0.4.0`). ### Key Changes: - **Dependency Upgrades**: Bumped `package:analyzer` to `14.2.0` and updated lockfiles. - **Update Packages Command**: Added `dev/flutter_analyzer_plugin` to `_updatePubspec` in `packages/flutter_tools/lib/src/commands/update_packages.dart` and added hermetic test coverage in `update_packages_test.dart`. - **Plugin Migration & Base Class**: - Introduced `FlutterAnalysisRule` in `dev/flutter_analyzer_plugin/lib/src/flutter_analysis_rule.dart` which intercepts `registerNodeProcessors` and automatically skips rule and visitor registration for read-only Material and Cupertino implementations and tests. - Migrated all 17 `dev/flutter_analyzer_plugin` rules to extend `FlutterAnalysisRule` and implement `registerCustomNodeProcessors`. - Migrated rules and test fixtures to Analyzer 14 AST patterns and `package:analyzer_testing`. - Added unit test suite `dev/flutter_analyzer_plugin/test/flutter_analysis_rule_test.dart` verifying path filtering behavior. - **Rule Scopes & Improvements**: - `no_sync_async_star`: Restricted to `packages/` and `examples/`, excluding test files. - `no_test_imports`: Restricted to `packages/` to avoid flagging runner helpers. - `integration_test_timeouts`: Restricted to `dev/` directory. - `deprecation_syntax`: Excluded `analyze-test-input` fixtures. - `skip_test_comments`: Expanded ignore scan window across multi-line argument nodes. - **Snippets Migration**: Migrated `dev/snippets` AST visitors and mock filesystem resource provider to Analyzer 14. - **SDK Compatibility**: Added `dependency_overrides: analysis_server_plugin: ^0.3.21` to subpackage `analysis_options.yaml` files to allow isolated plugin runners to resolve on development/master Dart SDKs that specify unreleased protocol constraints. - **Linter Fixes**: - Replaced `scope.catchError` with `scope.then(..., onError: ...)` in `packages/flutter_tools/lib/src/desktop_device.dart`. - Added missing `@protected` annotations to non-material public `State` subtypes in `packages/flutter/lib` (`form.dart`, `raw_tooltip.dart`). - **CI Tuning**: - Added heartbeat progress output every 30s during analysis passes in `dev/bots/analyze.dart` and `dev/devicelab/lib/tasks/analysis.dart`. - Updated `Linux analyzer_benchmark` in `.ci.yaml` to set `device_type: none`, routing to 32 GB RAM VM drone bots. ## Tests - Added unit tests in `packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart`. - Added unit tests in `dev/flutter_analyzer_plugin/test/flutter_analysis_rule_test.dart`. - Ran all 65 unit tests in `dev/flutter_analyzer_plugin` (all pass). - Ran all 18 unit tests in `dev/snippets` (all pass). - Ran `flutter analyze --flutter-repo` (0 issues found). | 6 天前 | |
Move `examples/api` to `packages/flutter/examples/api` and fix CI errors (#190481) This PR moves API examples from `<root>/examples/api` to `<root>/packages/flutter/examples/api`. This change is required because the standard dartdoc directive `{@example}` requires API examples to reside within the package directory. For more details, see issue https://github.com/flutter/flutter/issues/189629 (item 1 under "What's needed"). ### Summary of changes Moved all API example files to `packages/flutter/examples/api`. Updated related scripts and CI configurations to reflect the new directory structure. - Most changes involve simple path updates from `examples/api` to `packages/flutter/examples/api`. - Some adjustments were more complex because the examples, which previously resided in a single `<root>/examples` directory, are now split across two separate locations. Existing paths in `"See code in "` directives are retained. These paths are now treated as relative to the package root rather than the repository root. For example, the following API doc comment remains valid despite the file move: ```dart /// Class definition. /// /// {@tool sample} /// An example. /// /// ** See code in examples/api/lib/widgets/foo/foo.0.dart ** /// {@end-tool} ``` Three API doc tests are now marked as `reduced-test-set` because they're now facing additional analysis for being under `packages/flutter`. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 1 个月前 | |
Modernize framework lints (#179089) WIP Commits separated as follows: - Update lints in analysis_options files - Run `dart fix --apply` - Clean up leftover analysis issues - Run `dart format .` in the right places. Local analysis and testing passes. Checking CI now. Part of https://github.com/flutter/flutter/issues/178827 - Adoption of flutter_lints in examples/api coming in a separate change (cc @loic-sharma) ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 9 个月前 | |
Move `examples/api` to `packages/flutter/examples/api` and fix CI errors (#190481) This PR moves API examples from `<root>/examples/api` to `<root>/packages/flutter/examples/api`. This change is required because the standard dartdoc directive `{@example}` requires API examples to reside within the package directory. For more details, see issue https://github.com/flutter/flutter/issues/189629 (item 1 under "What's needed"). ### Summary of changes Moved all API example files to `packages/flutter/examples/api`. Updated related scripts and CI configurations to reflect the new directory structure. - Most changes involve simple path updates from `examples/api` to `packages/flutter/examples/api`. - Some adjustments were more complex because the examples, which previously resided in a single `<root>/examples` directory, are now split across two separate locations. Existing paths in `"See code in "` directives are retained. These paths are now treated as relative to the package root rather than the repository root. For example, the following API doc comment remains valid despite the file move: ```dart /// Class definition. /// /// {@tool sample} /// An example. /// /// ** See code in examples/api/lib/widgets/foo/foo.0.dart ** /// {@end-tool} ``` Three API doc tests are now marked as `reduced-test-set` because they're now facing additional analysis for being under `packages/flutter`. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 1 个月前 | |
Make the AbsorbPointer sample show the difference from IgnorePointer (#188940) The `AbsorbPointer` sample shows two overlapping buttons in a `Stack`, but neither button gives any visible feedback when tapped, so the sample doesn't let you observe what `AbsorbPointer` actually does — and as https://github.com/flutter/flutter/issues/87936 points out, it especially doesn't show how it differs from `IgnorePointer`. This implements the design discussed on the issue (keep the existing example, add an `IgnorePointer` counterpart so the side-by-side makes the distinction observable — suggested by @victorsanni): - The sample now shows the original crossed-buttons stack twice, side by side: one overlay wrapped in `AbsorbPointer`, the other in `IgnorePointer`, with a visible "Taps received" counter under each stack. - Tapping the overlapping region on the `AbsorbPointer` side does nothing — the `AbsorbPointer` absorbs the pointer events itself, so neither its child button nor the button behind it receives the tap. Tapping the same region on the `IgnorePointer` side increments the counter of the button behind — the `IgnorePointer` is invisible to hit testing, so the event goes through to the next target in the stack. - The `{@tool dartpad}` blurb on the `AbsorbPointer` class docs is updated to describe the comparison. - The sample test now asserts the observable tap behavior on both sides (including that the uncovered part of the button behind the `AbsorbPointer` still receives taps), replacing the previous mouse-cursor-only check. Fixes https://github.com/flutter/flutter/issues/87936 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Victor Sanni <victorsanniay@gmail.com> | 10 天前 | |
[cross_imports] navigator_restoration_test.dart (#190996) This PR fixes cross imports in navigator_restoration_test.dart and adds a missing property to TestWidgetsApp used in said test Part of https://github.com/flutter/flutter/issues/177415 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 26 天前 | |
Harden dev tooling scripts against command injection and log leaks (#186076) ## Description This PR hardens several developer and CI scripts against command injection, URL-splitting, and information disclosure. These were flagged as high-severity vulnerabilities by static analysis. Fixes applied: * Properly quoted `$STAGING_DIR`, `${log_file}`, `$WRAPPER_TEMP_DIR`, and `$WRAPPER_SRC_URL` in Bash scripts to prevent arbitrary command injection. | 3 个月前 | |
Move `examples/api` to `packages/flutter/examples/api` and fix CI errors (#190481) This PR moves API examples from `<root>/examples/api` to `<root>/packages/flutter/examples/api`. This change is required because the standard dartdoc directive `{@example}` requires API examples to reside within the package directory. For more details, see issue https://github.com/flutter/flutter/issues/189629 (item 1 under "What's needed"). ### Summary of changes Moved all API example files to `packages/flutter/examples/api`. Updated related scripts and CI configurations to reflect the new directory structure. - Most changes involve simple path updates from `examples/api` to `packages/flutter/examples/api`. - Some adjustments were more complex because the examples, which previously resided in a single `<root>/examples` directory, are now split across two separate locations. Existing paths in `"See code in "` directives are retained. These paths are now treated as relative to the package root rather than the repository root. For example, the following API doc comment remains valid despite the file move: ```dart /// Class definition. /// /// {@tool sample} /// An example. /// /// ** See code in examples/api/lib/widgets/foo/foo.0.dart ** /// {@end-tool} ``` Three API doc tests are now marked as `reduced-test-set` because they're now facing additional analysis for being under `packages/flutter`. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 1 个月前 | |
ci: update dartdoc from 9.0.6 to 9.0.9 (#192405) A bug in `dartdoc` 9.0.6 is causing a RangeError during `_stripDocImports` during `@docImport` processing. The changelog indicates this was fixed in 9.0.8. https://github.com/dart-lang/dartdoc/blob/main/CHANGELOG.md#908 Not rolling to 9.0.9 since that introduces new dependency constraints. <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above, or I'm just desperate to get the tree green. - [X] I updated/added relevant in-code documentation (doc comments with `///`). - [X] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 21 小时前 | |
Report individual test results to LUCI ResultDB (#190254) Framework test shards previously only surfaced a single pass/fail status at the shard level, so the "Test Results" tab for a build in LUCI was effectively empty. This reports each individual test case to the build's ResultDB invocation, so the tab lists every test that ran. This PR populates the "test results" tab with actual information about the tests. Example: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20framework_tests_widgets/109467/test-results | 27 天前 | |
Remove some refs to package:intl (#188504) `package:intl` cannot be used to create fixed timestamps. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 2 个月前 | |
ci: Support --target_arch option in prepare_package.dart (#190960) Adds a `--target_arch=<x64|arm64>` option to `dev/bots/prepare_package.dart` to support cross-packaging SDK archives for a target architecture different from the host architecture. When target arch is specified, we set `FLUTTER_HOST_ARCH` in the environment of each subprocess spawned by the packaging script. This is picked up by `update_dart_sdk.sh` and `update_dart_sdk.ps1` when choosing which Dart SDK to download, and by `OperatingSystemUtils.hostPlatform` when the tool picks which host engine artifacts to cache. Those run from `bin/flutter` before the flutter tool exists, so the environment is the only means we have to pass this setting. This patch allows arm64 macOS CI hosts to download and cache x64 host engine artifacts when cross-packaging x64 Flutter SDK release archives on an arm64 host (or theoretically vice-versa, but we'll never do that) in the `packaging/packaging` recipe in `packaging.py`. It's worth noting that the scripts and tool this drives are the ones in the branch being packaged, not the ones this script was run from, so `--target_arch` depends on that branch having cherry-picks to handle both `FLUTTER_HOST_ARCH` support in `bin/internal/update_dart_sdk.{sh,ps1}` (#190421) and the `--host-arch` option of `flutter precache` (#190480). See: https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/packaging/packaging.py Issue: https://github.com/flutter/flutter/issues/189144 <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 27 天前 | |
Bump minimum Dart SDK version constraint to 3.11.0-0 [testing skill] (#188357) This bumps Dart across the repo to 3.11, with a few exceptions. I am authoring a skill (tbd) and script (https://github.com/flutter/flutter/pull/187800) to do this in the future. After this, I will be moving us to 3.12 to continue to iterate on the skill and script before proposing to check them in. There are some places where the Dart version has deviated from the consistent standard across the repo. I have considered changing these as out of scope for this PR since they are broken when changed. We should consider updating them to reflect a uniform version for the repo. They made for interesting edge cases in the script and skill development. 🙂 - flutter/dev/integration_tests/widget_preview_scaffold/pubspec. yaml - This is on Dart 3.12. It cannot be changed since the source code has already adopted 3.12 language features - All of these integration tests have a range set (>=3.5.0-0 <4.0.0), and resolve to 3.13 in CI: - flutter/dev/integration_tests/data_asset_app/pubspec.yaml - flutter/dev/integration_tests/data_asset_package/pubspec.yaml - flutter/dev/integration_tests/record_use_test_app/pubspec.yaml - flutter/dev/integration_tests/record_use_test_package/pubspec. yaml - flutter/dev/integration_tests/hybrid_android_views/pubspec. yaml ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 2 个月前 | |
Add await or ignore to future-returning methods defined in Dart SDK (#184229) Fixes https://github.com/flutter/flutter/issues/184317 Part of https://github.com/flutter/flutter/pull/181513 | 5 个月前 | |
Modernize framework lints (#179089) WIP Commits separated as follows: - Update lints in analysis_options files - Run `dart fix --apply` - Clean up leftover analysis issues - Run `dart format .` in the right places. Local analysis and testing passes. Checking CI now. Part of https://github.com/flutter/flutter/issues/178827 - Adoption of flutter_lints in examples/api coming in a separate change (cc @loic-sharma) ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 9 个月前 | |
Test reporter (#28297) * Wrap test.main with a custom processor * Report test results to bigquery table | 7 年前 | |
Move tool host_cross_arch tests into different shards (#189470) The intention of the tool_host_cross_arch_tests shard was to run architecture-specific tests that should be run on ARM and Intel. Since we are deprecating Intel Macs and they will only be run on one architecture, ARM, remove the shard entirely. Keep the builder and test runner around as a no-op so nothing breaks in releases. We can remove them totally (builder, TESTOWNER, test runner, etc) once this code reaches stable. https://github.com/flutter/flutter/issues/188328 First part of https://github.com/flutter/flutter/issues/189302 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md | 1 个月前 | |
Report individual test results to LUCI ResultDB (#190254) Framework test shards previously only surfaced a single pass/fail status at the shard level, so the "Test Results" tab for a build in LUCI was effectively empty. This reports each individual test case to the build's ResultDB invocation, so the tab lists every test that ran. This PR populates the "test results" tab with actual information about the tests. Example: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20framework_tests_widgets/109467/test-results | 27 天前 | |
Clean up avoid_type_to_string suppressions (#186869) Fixes https://github.com/flutter/flutter/issues/185310. Issue: Several `avoid_type_to_string` suppressions were either avoidable or undocumented. The Flutter tool crash analytics path still needs a best-effort concrete exception category for unknown error types, so replacing the type with a generic category loses useful crash signal. Fix: - Keeps tool crash analytics on `error.runtimeType.toString()` with a local comment explaining why that suppression is intentional. - Makes `PreparePackageException` and `UnpublishException` final and uses `$PreparePackageException` / `$UnpublishException` so their string output follows future class renames. - Leaves GitHub crash template sanitization on stable categories where privacy/sanitization matters. - Adds focused coverage for the bot exception `toString()` output. Tests: - `./bin/dart format --output=none --set-exit-if-changed packages/flutter_tools/lib/runner.dart packages/flutter_tools/test/general.shard/runner/runner_test.dart` - `./bin/flutter analyze dev/bots/prepare_package/common.dart dev/bots/unpublish_package.dart packages/flutter_tools/lib/runner.dart packages/flutter_tools/lib/src/reporting/github_template.dart dev/bots/test/prepare_package_test.dart dev/bots/test/unpublish_package_test.dart packages/flutter_tools/test/general.shard/runner/runner_test.dart packages/flutter_tools/test/general.shard/github_template_test.dart` - `./bin/flutter test packages/flutter_tools/test/general.shard/runner/runner_test.dart packages/flutter_tools/test/general.shard/github_template_test.dart` - `./bin/flutter test packages/flutter_tools/test/general.shard/github_template_test.dart` - `./bin/dart test dev/bots/test/prepare_package_test.dart` - `./bin/dart test dev/bots/test/unpublish_package_test.dart` - `git diff --check` Risk: Low. The PR removes avoidable suppressions, keeps the one remaining suppression explicit, and preserves useful crash analytics signal where the tool is not obfuscated. | 3 个月前 | |
Report individual test results to LUCI ResultDB (#190254) Framework test shards previously only surfaced a single pass/fail status at the shard level, so the "Test Results" tab for a build in LUCI was effectively empty. This reports each individual test case to the build's ResultDB invocation, so the tab lists every test that ran. This PR populates the "test results" tab with actual information about the tests. Example: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20framework_tests_widgets/109467/test-results | 27 天前 |
Flutter's Build Infrastructure
This directory exists to support building Flutter on our build infrastructure.
Flutter build results are available at: https://flutter-dashboard.appspot.com.
Flutter infra requires special permissions to retrigger builds on the
build dashboard. File a team-infra
issue to request permission.
The LUCI-based
bots run the test.dart script for each PR and submission. This
does testing for the tools, for the framework, and (for submitted changes only)
rebuilds and updates the main branch API docs staging site.
For tagged dev and beta builds, it also builds and deploys the gallery app to
the app stores. It is configured by two .ci.yaml files:
- framework:
.ci.yaml - engine:
engine/src/flutter/.ci.yaml
The build dashboard includes post-commit testing run on physical devices. See //dev/devicelab for more information.
LUCI (Layered Universal Continuous Integration)
A set of infra scripts
run on Windows, Linux, and Mac machines. The configuration for how many
machines and what kind are managed internally by Google. File a team-infra issue
to request new machine types to be added. Both of these technologies are highly
specific to the LUCI project, which is the successor
to Chromium's infra and the foundation to Flutter's infrastructure.
Prerequisites
To work on this infrastructure you will need:
- depot_tools
- Python package installer:
sudo apt-get install python-pip - Python coverage package (only needed for
training_simulation):sudo pip install coverage
To run prepare_package.dart locally:
- Make sure the
depot_toolsis in yourPATH. If you're on Windows, you also need an environment variable calledDEPOT_TOOLSwith the path todepot_toolsas value. - Run
gsutil.py config(orpython3 %DEPOT_TOOLS%\gsutil.pyon Windows) to authenticate with your auth token. - Create a local temp directory.
cdinto it. - Run
dart [path to your normal Flutter repo]/dev/bots/prepare_package.dart --temp_dir=. --revision=[revision to package] --branch=[branch to deploy to] --publish. - If you're running into
gsutilpermission issues, check with @Hixie to make sure you have the right push permissions.
Editing a recipe
Flutter has several recipes depending on the test. The recipes share common
actions through recipe_modules. Searching the builder config in infra
will indicate the recipe used for a test.
Recipes are just Python with some limitations on what can be imported. They are documented by the luci/recipes-py GitHub project.
The typical cycle for editing a recipe is:
- Check out the recipes project using
git clone https://flutter.googlesource.com/recipes. - Make your edits (probably to files in
//recipes/recipes). - Update the tests. Run
recipes.py test trainto update the existing expected output to match the new output. Verify completely new test cases by altering theGenTestsmethod of the recipe. The recipe is required to have 100% test coverage. - Run
led get-builder 'luci.flutter.staging:BUILDER_NAME' | led edit -pa git_ref='refs/pull/<PR number>/head' | led edit -pa git_url='https://github.com/flutter/<repo>' | led edit-recipe-bundle | led launch, whereBUILDER_NAMEis the builder name (e.g.Linux Engine), andgit_ref/git_urlis the ref/url of the intended changes to build.- If
ledfails, ensure that yourdepot_toolscheckout is up to date.
- If
- To submit a CL, you need a local branch first (
git checkout -b [some branch name]). - Upload the patch (
git commit,git cl upload), and open the outputted URL to the CL. - Use "Find owners" to get reviewers for the CL
Android Tools
The Android SDK and NDK used by Flutter's Chrome infra bots are stored in Google
Cloud. During the build, a bot runs the download_android_tools.py script that
downloads the required version of the Android SDK into dev/bots/android_tools.
To check which components are currently installed, download the current SDK
stored in Google Cloud using the download_android_tools.py script, then
dev/bots/android_tools/sdk/tools/bin/sdkmanager --list. If you find that some
components need to be updated or installed, follow the steps below:
How to update Android SDK on Google Cloud Storage
-
Run Android SDK Manager and update packages
$ dev/bots/android_tools/sdk/tools/android update sdkUseandroid.baton Windows. -
Use the UI to choose the packages you want to install and/or update.
-
Run
dev/bots/android_tools/sdk/tools/bin/sdkmanager --update. On Windows, runsdkmanager.batinstead. If the process fails with an error saying that it is unable to move files (Windows makes files and directories read-only when another process is holding them open), make a copy of thedev/bots/android_tools/sdk/toolsdirectory, run thesdkmanager.batfrom the copy, and use the--sdk_rootoption pointing atdev/bots/android_tools/sdk. -
Run
dev/bots/android_tools/sdk/tools/bin/sdkmanager --licensesand accept the licenses for the newly installed components. It also helps to run this command a second time and make sure that it prints "All SDK package licenses accepted". -
Run upload_android_tools.py -t sdk
$ dev/bots/upload_android_tools.py -t sdk
How to update Android NDK on Google Cloud Storage
-
Download a new NDK binary (e.g. android-ndk-r10e-linux-x86_64.bin)
-
cd dev/bots/android_tools
$ cd dev/bots/android_tools -
Remove the old ndk directory
$ rm -rf ndk -
Run the new NDK binary file
$ ./android-ndk-r10e-linux-x86_64.bin -
Rename the extracted directory to ndk
$ mv android-ndk-r10e ndk -
Run upload_android_tools.py -t ndk
$ cd ../..$ dev/bots/upload_android_tools.py -t ndk
Flutter codelabs build test
The Flutter codelabs exercise Material Components in the form of a demo application. The code for the codelabs is similar to, but distinct from, the code for the Shrine demo app in Flutter Gallery.
The Flutter codelabs build test ensures that the final version of the Material Components for Flutter Codelabs can be built. This test serves as a smoke test for the Flutter framework and should not fail. If it does, please address any issues in your PR and rerun the test. If you feel that the test failing is not a direct result of changes made in your PR or that breaking this test is absolutely necessary, escalate this issue by submitting an issue to the MDC-Flutter Team.
Unpublishing published archives
Flutter downloadable archives are built for each release by our continuous
integration systems using the prepare_package.dart
script, but if something goes very wrong, and a release is published that wasn't
intended to be published, the unpublish_package.dart
script may be used to remove the package or packages from the channels in which
they were published.
For example To remove a published package corresponding to the git hash
d444a455de87a2e40b7f576dc12ffd9ab82fd491, first do a dry run of the script to
see what it will do:
dart ./unpublish_package.dart --temp_dir=/tmp/foo --revision d444a455de87a2e40b7f576dc12ffd9ab82fd491
And once you've verified the output of the dry run to be sure it is what you want to do, run:
dart ./unpublish_package.dart --confirm --temp_dir=/tmp/foo --revision d444a455de87a2e40b7f576dc12ffd9ab82fd491
and it will perform the actions. You will of course need to have access
to the cloud storage server and have gsutil installed to perform this
operation. Only runs on Linux or macOS systems.
See dart ./unpublish_package.dart --help for more details.
Once the package is unpublished, it will not be available from the website for download, and will not be rebuilt (even though there is a tagged revision in the repo still) unless someone forces the packaging build to run again at that revision to rebuild the package.