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

[tool] Support --flavor option for flutter install. #114048

Merged
merged 17 commits into from
Nov 8, 2022

Conversation

a-wallen
Copy link
Contributor

@a-wallen a-wallen commented Oct 26, 2022

flutter install previously forced users to specify the --flavor option if flavors were configured for a flutter project, but didn't provide the option, to begin with ( see #99607 ). We could solve this by either:

  1. Not throwing a tool exit when running flutter install on a project with flavors configured. Users will have to use install the application binary with the --use-application-binary flag.
  2. Adding --flavor as an option - search for that flavor's binary and install it.

Fixes #99607

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.
  • All existing and new tests are passing.

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

@flutter-dashboard flutter-dashboard bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Oct 26, 2022
@a-wallen a-wallen force-pushed the ios_flavors_install branch from e3a50c2 to b2b6700 Compare October 26, 2022 03:01
@jmagman
Copy link
Member

jmagman commented Oct 26, 2022

Suggest also adding flutter install --flavor and flutter install --uninstall-only --flavor to the end of https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/flavors_test.dart

@a-wallen a-wallen force-pushed the ios_flavors_install branch 2 times, most recently from fc54eab to 13d60f2 Compare October 31, 2022 20:43
@jmagman
Copy link
Member

jmagman commented Nov 2, 2022

You added Chris as me as reviewers, mark this ready for review when it's actually ready for review 🙂

@jmagman
Copy link
Member

jmagman commented Nov 2, 2022

I didn't test this, but here's a possible way to test install in the devicelab

    await inDirectory('${flutterDirectory.path}/dev/integration_tests/flavors', () async {
      await flutter(
        'install',
        options: <String>['--flavor', 'paid'],
      );
      await flutter(
        'install',
        options: <String>['--flavor', 'paid', '--uninstall-only'],
      );
      final StringBuffer stderr = StringBuffer();
      await evalFlutter(
        'install',
        canFail: true,
        stderr: stderr,
        options: <String>['--flavor', 'bogus'],
      );

      final String stderrString = stderr.toString();
      if (!stderrString.contains('install failed, bogus flavor not found')) {
        print(stderrString);
        return TaskResult.failure('Should not succeed with bogus flavor');
      }
    });

);

final String stderrString = stderr.toString();
if (!stderrString.contains('install failed, bogus flavor not found')) {
Copy link
Member

Choose a reason for hiding this comment

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

This isn't the correct error message I'm sure, you'll have to run it.

@a-wallen a-wallen force-pushed the ios_flavors_install branch from 9898ded to 5be125d Compare November 3, 2022 18:09
@a-wallen a-wallen marked this pull request as ready for review November 3, 2022 18:56
@flutter-dashboard flutter-dashboard bot added the team Infra upgrades, team productivity, code health, technical debt. See also team: labels. label Nov 3, 2022
@a-wallen a-wallen requested a review from keyonghan as a code owner November 3, 2022 21:38
@a-wallen a-wallen force-pushed the ios_flavors_install branch from 040913e to cde4f66 Compare November 3, 2022 22:01
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

This LGTM once you're done testing and the .ci.yaml bringup changes are reverted (though if you want to keep it for the Windows one, that makes sense).

@@ -1690,6 +1690,7 @@ targets:
task_name: fast_scroll_large_images__memory

- name: Linux_android flavors_test
bringup: true
Copy link
Member

Choose a reason for hiding this comment

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

If the intention of this was to test in this PR, then you also need to remove presubmit: false

Copy link
Member

Choose a reason for hiding this comment

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

Can we even run devicelab tests presubmit?

Copy link
Member

Choose a reason for hiding this comment

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

We run Mac_ios hot_mode_dev_cycle_macos_target__benchmark and Linux_android hot_mode_dev_cycle_linux__benchmark so there's capacity.

But what I said doesn't make any sense, adding bringup wouldn't make it run in this PR, removing bringup would do that.

@keyonghan suggested @a-wallen do this, but I didn't see that since their conversation was resolved and hidden.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

LGTM

@a-wallen a-wallen added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 7, 2022
@auto-submit auto-submit bot merged commit 7020f59 into flutter:master Nov 8, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 9, 2022
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 9, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
auto-submit bot pushed a commit to flutter/plugins that referenced this pull request Nov 9, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
@jmagman
Copy link
Member

jmagman commented Nov 10, 2022

This caused Windows_android flavors_test_win to start failing: #115121

IVLIVS-III pushed a commit to IVLIVS-III/flutter_plugins_fork that referenced this pull request Nov 11, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
percula pushed a commit to percula/packages that referenced this pull request Nov 17, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
adam-harwood pushed a commit to adam-harwood/flutter_plugins that referenced this pull request Nov 21, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
* Alphabetize setup calls

* Add --flavor as an option for install

* Add verbose logging in install command

* Test that flavors build succeeds with proper flavor and fails with bogus one.

* Remove unused import

* The import was used...

* SQUASH

* Add flavor install test

* Rename test

* Add flavors install integration tests

* correct error message

* remove unused imports

* Delete copy test

* update test target

* Refactor mechanism to read buildInfo

* Remove unused import

* Set affected test targets to bringup: true

Co-authored-by: a-wallen <[email protected]>
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
* Alphabetize setup calls

* Add --flavor as an option for install

* Add verbose logging in install command

* Test that flavors build succeeds with proper flavor and fails with bogus one.

* Remove unused import

* The import was used...

* SQUASH

* Add flavor install test

* Rename test

* Add flavors install integration tests

* correct error message

* remove unused imports

* Delete copy test

* update test target

* Refactor mechanism to read buildInfo

* Remove unused import

* Set affected test targets to bringup: true

Co-authored-by: a-wallen <[email protected]>
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
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 platform-ios iOS applications specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flutter install demands unsupported --flavor option
4 participants