Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove throwOnPluginPubspecError flag for plugin validation #144214

Merged
merged 6 commits into from
Mar 7, 2024

Conversation

Gustl22
Copy link
Contributor

@Gustl22 Gustl22 commented Feb 27, 2024

Part of #137040 and #80374

The flag throwOnPluginPubspecError never actually was enabled during production in #79669, but only in some dart plugin tests. And in the tests the case of the error when enabling the flag was not explicitly tested. The only thing tested was, that it is not thrown when disabled.

As explained here the only case, where this error could be thrown is, when a dart implementation and a native inline implementation are provided simultaneously. But throwing an exception there is a wrong behavior, as both can coexist in a plugin package, thus in the pubspec file.

Disabling the flag means, that the error is not thrown and not shown to the user. This is the case in production (contrary to the dart plugin tests), which acts like these plugin cases of implementations are just skipped. And this is what actually should be done.

In conclusion, I think the case of coexisting dart and native implementation in pubspec was just overlooked and therefore this error validation was introduced, which is not necessary or even valid.

For more discussion, see: https://discord.com/channels/608014603317936148/608022056616853515/1200194937791205436

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 27, 2024
@Gustl22 Gustl22 changed the title fix: Remove throwOnPluginPubspecError flag for plugins fix: Remove throwOnPluginPubspecError flag for plugins Feb 27, 2024
@Gustl22 Gustl22 changed the title fix: Remove throwOnPluginPubspecError flag for plugins fix: Remove throwOnPluginPubspecError flag for plugin validation Feb 27, 2024
@Gustl22 Gustl22 changed the title fix: Remove throwOnPluginPubspecError flag for plugin validation refactor: Remove throwOnPluginPubspecError flag for plugin validation Feb 27, 2024
@@ -139,7 139,6 @@ void main() {
appDependencies: directDependencies,
),
],
throwOnPluginPubspecError: false,
Copy link
Contributor Author

@Gustl22 Gustl22 Feb 27, 2024

Choose a reason for hiding this comment

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

Note that this test failed before, when setting throwOnPluginPubspecError: true, which should not be the case.
This test was introduced by myself by purpose in #142035 to show the misbehavior of the flag.

appDependencies: directDependencies,
),
],
throwOnPluginPubspecError: false,
Copy link
Contributor Author

@Gustl22 Gustl22 Feb 27, 2024

Choose a reason for hiding this comment

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

Note that this test always succeeded, when setting throwOnPluginPubspecError either to true or to false, which makes this test kind of "useless", because there's no such valid case, which could actually raise the error.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM. My recollection is that this was disabled pretty much immediately because the logic wasn't actually right.

I think the only case I've seen in recent memory where an error message would have been useful is the case where a desktop plugin doesn't get autoregistration because of a lack of implements, but even that is unlikely to be useful going forward since new plugins are unlikely to support older than Flutter 2.11.

Given that, just removing it as cruft seems like the right choice.

@Gustl22
Copy link
Contributor Author

Gustl22 commented Feb 29, 2024

I appreciate your speedy review and taking the time!

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

(un)-ship it!

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 7, 2024
Copy link
Contributor

auto-submit bot commented Mar 7, 2024

auto label is removed for flutter/flutter/144214, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 7, 2024
@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 7, 2024
@auto-submit auto-submit bot merged commit dc6f94a into flutter:master Mar 7, 2024
120 checks passed
@Gustl22 Gustl22 deleted the 80374-refactor-3 branch March 8, 2024 00:09
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Mar 8, 2024
flutter/flutter@471a828...7c89ec8

2024-03-08 [email protected] Remove `toString()` overrides in `dart:ui`/`package:flutter` in profile/release mode on wasm/vm targets (flutter/flutter#144763)
2024-03-08 [email protected] Roll Flutter Engine from 80cd7981043f to bbb1ed00af49 (3 revisions) (flutter/flutter#144813)
2024-03-08 65758246 [email protected] Update documentation of `AlertDialog`'s default `TextStyle` for Material 3 (flutter/flutter#144697)
2024-03-08 [email protected] Roll Flutter Engine from 175069397a40 to 80cd7981043f (5 revisions) (flutter/flutter#144804)
2024-03-07 [email protected] Enable asset transformation for `flutter run -d <browser>` and `flutter test` (flutter/flutter#144734)
2024-03-07 [email protected] Roll Flutter Engine from ec4f9af3d53b to 175069397a40 (2 revisions) (flutter/flutter#144799)
2024-03-07 [email protected] refactor: Remove `throwOnPluginPubspecError` flag for plugin validation (flutter/flutter#144214)
2024-03-07 [email protected] Roll Flutter Engine from 305333c50191 to ec4f9af3d53b (1 revision) (flutter/flutter#144797)
2024-03-07 [email protected] Roll Flutter Engine from c2863530ce39 to 305333c50191 (1 revision) (flutter/flutter#144793)
2024-03-07 [email protected] Fixed -> DropdownMenu throws exception when it is in any scrollable lâ�¦ (flutter/flutter#140566)
2024-03-07 [email protected] Roll Flutter Engine from 9e8ccaa3842e to c2863530ce39 (2 revisions) (flutter/flutter#144792)
2024-03-07 [email protected] Roll Flutter Engine from 12828950890a to 9e8ccaa3842e (1 revision) (flutter/flutter#144784)
2024-03-07 [email protected] Marks Mac_x64 module_test_ios to be flaky (flutter/flutter#144681)
2024-03-07 [email protected] [flutter_tools] add custom tool analysis to analyze.dart, lint Future.catchError (flutter/flutter#140122)
2024-03-07 [email protected] Roll Flutter Engine from f8c3b2db8cd1 to 12828950890a (1 revision) (flutter/flutter#144775)

If this roll has caused a breakage, revert this CL and stop the roller
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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
flutter/flutter@471a828...7c89ec8

2024-03-08 [email protected] Remove `toString()` overrides in `dart:ui`/`package:flutter` in profile/release mode on wasm/vm targets (flutter/flutter#144763)
2024-03-08 [email protected] Roll Flutter Engine from 80cd7981043f to bbb1ed00af49 (3 revisions) (flutter/flutter#144813)
2024-03-08 65758246 [email protected] Update documentation of `AlertDialog`'s default `TextStyle` for Material 3 (flutter/flutter#144697)
2024-03-08 [email protected] Roll Flutter Engine from 175069397a40 to 80cd7981043f (5 revisions) (flutter/flutter#144804)
2024-03-07 [email protected] Enable asset transformation for `flutter run -d <browser>` and `flutter test` (flutter/flutter#144734)
2024-03-07 [email protected] Roll Flutter Engine from ec4f9af3d53b to 175069397a40 (2 revisions) (flutter/flutter#144799)
2024-03-07 [email protected] refactor: Remove `throwOnPluginPubspecError` flag for plugin validation (flutter/flutter#144214)
2024-03-07 [email protected] Roll Flutter Engine from 305333c50191 to ec4f9af3d53b (1 revision) (flutter/flutter#144797)
2024-03-07 [email protected] Roll Flutter Engine from c2863530ce39 to 305333c50191 (1 revision) (flutter/flutter#144793)
2024-03-07 [email protected] Fixed -> DropdownMenu throws exception when it is in any scrollable lâ�¦ (flutter/flutter#140566)
2024-03-07 [email protected] Roll Flutter Engine from 9e8ccaa3842e to c2863530ce39 (2 revisions) (flutter/flutter#144792)
2024-03-07 [email protected] Roll Flutter Engine from 12828950890a to 9e8ccaa3842e (1 revision) (flutter/flutter#144784)
2024-03-07 [email protected] Marks Mac_x64 module_test_ios to be flaky (flutter/flutter#144681)
2024-03-07 [email protected] [flutter_tools] add custom tool analysis to analyze.dart, lint Future.catchError (flutter/flutter#140122)
2024-03-07 [email protected] Roll Flutter Engine from f8c3b2db8cd1 to 12828950890a (1 revision) (flutter/flutter#144775)

If this roll has caused a breakage, revert this CL and stop the roller
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
autosubmit Merge PR when tree becomes green via auto submit App 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