Skip to content

Add trust gate flags for "flutter analyze" - #196415

Merged
srawlins merged 6 commits into
flutter:masterfrom
srawlins:flutter-flags
Nov 26, 2026
Merged

srawlins merged 6 commits into
flutter:masterfrom
srawlins:flutter-flags

Conversation

@srawlins

@srawlins srawlins commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes https://github.com/flutter/dash-devexp-internal/issues/151

Recently the Dart SDK shipped similar changes, dart-lang/sdk@f7b03f3. So, in this change we mirror those.

  • Analyzer plugins which are not trusted are not executed during flutter analyze (dart analyze)
  • Plugins are, by default, not trusted.
  • Exact plugin contents can be trusted via --trust-plugins. If plugin contents change, those new contents are, by default, not trusted.
  • Plugin sources (a pub.dev source, a git repo, or an absolute path) can be trusted via --always-trust-plugins.
  • If flutter analyze finds untrusted plugins which are requested to run, it will print a message. This message can be suppressed with --never-trust-plugins.
  • Plugin trust can be overridden with --plugins (runs all plugins).
  • --no-plugins remains the option to disable analyzer plugins.
  • Plugins are trusted in CI environments.

Pre-launch Checklist

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Nov 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the --trust-plugins, --always-trust-plugins, and --never-trust-plugins flags to the analyze command, allowing users to control analyzer plugin execution trust. These flags are configured as mutually exclusive, and their values are forwarded to the Dart language server. On CI bots, plugins are now enabled by default unless --never-trust-plugins is specified. Additionally, integration and unit tests are added to verify this behavior. The review feedback identifies compilation errors in analyze_base.dart where argResults.flag is called, as the ArgResults class does not define a flag method, and suggests retrieving these values using bracket notation instead.

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Nov 12, 2026
@srawlins
srawlins requested a review from bkonyi November 12, 2026 17:10
bkonyi
bkonyi previously approved these changes Nov 24, 2026

@bkonyi bkonyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once merge conflicts are resolved :)

srawlins and others added 3 commits November 25, 2026 17:59
- Add missing `--client-id=flutter-analyze` expectations in `analyze_test.dart` and `analyze_continuously_test.dart` after merging flutter#197227.
- Convert `expectServerArgs` parameters to named parameters and rename `botProcessManager` to `localProcessManager`.
- Document the `null` behavior of `AnalysisServer.usePlugins`.
- Split `--never-trust-plugins` into its own integration test with a fresh state directory, remove the redundant mutually-exclusive-flags integration test, inline the unused `pluginBody` parameter, and comment on `FLUTTER_HOST`.
- Add `// [intended]` comments to skipped tests in `dev/integration_tests/windowing_test/test_driver/main_test.dart` surfaced by enabling `flutter_analyzer_plugin` on bots.
@bkonyi
bkonyi requested a review from jyameo November 26, 2026 18:34

@jyameo jyameo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@srawlins
srawlins added this pull request to the merge queue Nov 26, 2026
Merged via the queue into flutter:master with commit f0038a3 Nov 26, 2026
19 checks passed
@srawlins
srawlins deleted the flutter-flags branch November 26, 2026 19:46
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 27, 2026
flutter/flutter@82ec424...43150a8

2026-11-27 [email protected] Windows: fix for popup descendent of popup closing the whole tree when the 2nd popup gains focus (flutter/flutter#196911)
2026-11-27 [email protected] Roll Skia from d693d85a4b77 to fe34f20b9689 (1 revision) (flutter/flutter#197491)
2026-11-27 [email protected] Roll Dart SDK from 691817e0ec3b to 5c3e102fc422 (1 revision) (flutter/flutter#197489)
2026-11-27 [email protected] Roll Fuchsia Linux SDK from 0bgCrr76CM4IqPO0v... to cBAjguERWwvY6tFtz... (flutter/flutter#197488)
2026-11-27 [email protected] [flutter_tools] Delete AppContext and legacy test context shims (flutter/flutter#197412)
2026-11-26 [email protected] Revert: [tool][engine] Enable experimental VM service by default (flutter/flutter#197481)
2026-11-26 [email protected] iOS: Remove engine includes from the platform views controller headers (flutter/flutter#197429)
2026-11-26 [email protected] [tool][engine] Enable experimental VM service by default (flutter/flutter#190100)
2026-11-26 [email protected] Add trust gate flags for "flutter analyze" (flutter/flutter#196415)
2026-11-26 [email protected] Roll Dart SDK from 7fcaf46b0308 to 691817e0ec3b (1 revision) (flutter/flutter#197475)
2026-11-26 [email protected] [Windows] Fix MASM flags in Windows GN `tool("asm")` (flutter/flutter#197464)
2026-11-26 [email protected] Roll Skia from cef5963c1bb2 to d693d85a4b77 (2 revisions) (flutter/flutter#197469)
2026-11-26 [email protected] Roll Packages from 105a874 to da586f5 (3 revisions) (flutter/flutter#197471)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants