Skip to content

[plugins] [ci] Plugins with custom analysis_options.yaml are failing analyze test in flutter/flutter. #78994

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

Closed
ditman opened this issue Mar 24, 2021 · 3 comments · Fixed by #79008
Assignees
Labels
package flutter/packages repository. See also p: labels. team-infra Owned by Infrastructure team

Comments

@ditman
Copy link
Member

ditman commented Mar 24, 2021

The flutter/plugins roller is failing pre-submit:

Activated flutter_plugin_tools 0.0.45+3.
▌09:47:03▐ ELAPSED TIME: 5.143s for ../../../k/flutter/bin/cache/dart-sdk/bin/pub global activate flutter_plugin_tools in ../../tmp/t/pluginsDYZTNQ
▌09:47:03▐ RUNNING: cd ../../tmp/t/pluginsDYZTNQ; ../../../k/flutter/bin/cache/dart-sdk/bin/pub global run flutter_plugin_tools analyze
Verifying analysis settings...
Found an extra analysis_options.yaml in /b/s/w/ir/tmp/t/pluginsDYZTNQ/packages/android_alarm_manager/analysis_options.yaml.
If this was deliberate, pass the package to the analyze command with the --custom-analysis flag and try again.

https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20flutter_plugins/5356/overview

It seems that the issue was introduced by this change:

flutter/plugins#3703

We need to configure the analysis command to accept custom analysis_options.yaml files, either here:

  • flutter/dev/bots/test.dart

    Lines 851 to 860 in 2e06ed0

    await runCommand(
    pub,
    <String>[
    'global',
    'run',
    'flutter_plugin_tools',
    'analyze',
    ],
    workingDirectory: checkout.path,
    );
  • Or publish a new version of flutter_plugin_tools which allows for custom yaml files.
@ditman ditman added plugin team-infra Owned by Infrastructure team labels Mar 24, 2021
@ditman ditman changed the title [plugins] [ci] Plugins with custom analysis_options.yaml are failing analyze test. [plugins] [ci] Plugins with custom analysis_options.yaml are failing analyze test in flutter/flutter. Mar 24, 2021
@stuartmorgan-g
Copy link
Contributor

Whitelisting all the current packages using the existing flag seems like a good option, since the goal is not to add new ones over time.

@ditman
Copy link
Member Author

ditman commented Mar 24, 2021

There's a bug with the current version of the tool here:

https://github.com/flutter/plugins/blob/master/script/tool/lib/src/analyze_command.dart#L45-L50

When argResults[_customAnalysisFlag] is empty [], it actually is: [""] and the any check runs once (against an empty string), so p.join(packagesDir.path, directory) is packages.

That is effectively allowing all packages to go through. I'm going to add a null check to directory so this case is contemplated, but it's probably a bad default value (maybe coming from the .sh) :/

@github-actions
Copy link

github-actions bot commented Aug 4, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package flutter/packages repository. See also p: labels. team-infra Owned by Infrastructure team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants