-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Description
Yesterday we heard from the Dart team that use of the latest build_runner was being blocked on flutter/packages#10078
We landed that change to resolve the issue, but a few hours later heard the Dart team's infra was broken as a result:
flutter-analyze / flutter-analyze-trybot failures:
Analyzing go_router_builder...
warning - lib/src/type_helpers.dart:798:22 - 'formalParameters' is experimental and could be removed or changed at any time. - experimental_member_use
warning - lib/src/type_helpers.dart:801:22 - 'formalParameters' is experimental and could be removed or changed at any time. - experimental_member_use
2 issues found.
It looks like this bot is not hermetic and it can start failing without a particular reason in Dart SDK. It is very unfortunate that it is included into CQ and these failures would block Dart SDK changes from landing.
@stereotype441 diagnosed 🙏:
in versions of the analyzer prior to 8.2, we had some APIs that were marked as
@experimentaleven though they weren't really experimental, and were intended to be supported for the long term. One of those APIs was the FunctionType.formalParameters getter. In dart-lang/sdk@a3bd2ad (which shipped in analyzer 8.2), I removed all those bogus@experimentalannotations. Later, in dart-lang/sdk@533f833, I added a warning to the analyzer that fires if an@experimentalAPI gets used unintentionally. This warning is important because it unblocks new language feature development work that is currently in progress.
The problem is that the flutter-analyze and flutter-analyze-try bots are linking the go_router_builder package to a version of the analyzer prior to 8.2, but they're analyzing that package using the bleeding edge analyzer. Which means that when go_router_builder tries to use the FunctionType.formalParameters getter, it gets flagged by the warning, even though it's actually safe (because in truth, that API isn't experimental at all; it's fully supported).
The failure just started happening because the uses of FunctionType.formalParameters just got added to go_router_builder in [the original linked PR above].
We resolved the issue by adding ignores in flutter/packages#10275
There was some confusion about which to apply where since we could not reproduce the upstream issue, which analyzer version the bot was using was not what others were using.
More info:
The Dart team has a luci bot (flutter-analyze-try) that tries to analyze each pending SDK CL against bleeding edge flutter, and fires if that produces failures. Its purpose is to prevent us from accidentally landing changes into the dart SDK that would break the dart/flutter integration. But that bot can equally easily be broken if a change gets landed into flutter that would break the dart/flutter integation (which is what happened this time). To detect that scenario prior to landing a flutter change, we would need a bot that tries to analyze each pending flutter PR using the bleeding edge dart SDK.
In retrospect, how could this have gone differently, starting with the blocking issue on build_runner? Could the subsequent issues have been detected earlier before the change landed?