Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dart roll triggers new analyzer hints in google_sign_in_web #76625

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
zanderso opened this issue Feb 23, 2021 · 21 comments · Fixed by flutter/plugins#3622
Closed

Dart roll triggers new analyzer hints in google_sign_in_web #76625

zanderso opened this issue Feb 23, 2021 · 21 comments · Fixed by flutter/plugins#3622
Assignees
Labels
dependency: dart Dart team may need to help us p: google_sign_in The Google Sign-In plugin P0 Critical issues such as a build break or regression package flutter/packages repository. See also p: labels.

Comments

@zanderso
Copy link
Member

zanderso commented Feb 23, 2021

On the roll here #76620

That includes the Dart roll here flutter/engine#24554

There are new analyzer "info" messages about unused elements, e.g. the class _RequestOptions here:

https://github.com/flutter/plugins/blob/master/packages/google_sign_in/google_sign_in_web/lib/src/generated/gapi.dart#L228

There are a number of related-looking commits in the Dart roll, e.g.: https://dart.googlesource.com/sdk.git/+/b7849ab93396d4f5a5b9f2a9747620ee80bfc4d1.

We need to either adjust the analyzer to restore the previous behavior, or fix the code generator that generates the gapi.dart file above to suppress the warning.

P0 since this blocks the Engine -> Framework roll.

@srawlins @stuartmorgan

@zanderso zanderso added plugin dependency: dart Dart team may need to help us p: google_sign_in The Google Sign-In plugin P0 Critical issues such as a build break or regression labels Feb 23, 2021
@stuartmorgan-g
Copy link
Contributor

@ditman

@devoncarew
Copy link
Member

I assume we don't control the code generator? If we did, a good solution would be to add an ignore for file comment for this hint to the top of the file.

Otherwise, we could add an analysis options file for the google_sign_in_web project that disables the hint (and likely references the default flutter analysis options config).

@ditman
Copy link
Member

ditman commented Feb 23, 2021

What's the analysis_options.yaml file that the analyzer is using? The one in plugins excludes lib/src/generated stuff:

https://github.com/flutter/plugins/blob/master/analysis_options.yaml

@zanderso
Copy link
Member Author

From the logs:

Running command: "pub global run tuneup check" in /b/s/w/ir/tmp/t/pluginsXTOHXT/packages/google_sign_in/google_sign_in_web

I don't know what tuneup is.

@devoncarew
Copy link
Member

tuneup is a tool that drives the analysis server from the command line. The repo should probably be switched to using dart analyze (or flutter analyze).

@ditman
Copy link
Member

ditman commented Feb 23, 2021

As a quick mitigation, I'm going to try and add an // ignore at the file level for the two checks that are failing, see if that cures the build.

@devoncarew
Copy link
Member

devoncarew commented Feb 23, 2021

What's the analysis_options.yaml file that the analyzer is using? The one in plugins excludes lib/src/generated stuff:

https://github.com/flutter/plugins/blob/master/analysis_options.yaml

Interesting, the repo is using pedantic?

We'll want to either add unused_element as an error to ignore in that file, or target the change to the specific project. That would look something like adding an anaysis_options.yaml file to the https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_web directory:

include: ../../analysis_options.yaml
  errors:
    unused_element: false

Changing the top-level analysis options would be a simpler solution.

@ditman
Copy link
Member

ditman commented Feb 23, 2021

adding an anaysis_options.yaml file to the https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_web directory

We've been trying to reduce the amount of custom analysis_options.yaml files in the repo, that's why I pointed to the global one (that excludes generated and mock files).

I've posted a PR with an ignore_for_file for now. I don't know what's the "top-level" analysis options file that is being used in the check that is breaking the rolls :) Modifying that to exclude "generated" code would be nice.

@ditman
Copy link
Member

ditman commented Feb 23, 2021

PR here: flutter/plugins#3622

@srawlins
Copy link
Contributor

There are new analyzer "info" messages about unused elements, e.g. the class _RequestOptions here:

Are the messages wrong or just undesired here?

@ditman
Copy link
Member

ditman commented Feb 23, 2021

Maybe this is the analysis_options.yaml file that is being used?

https://github.com/flutter/flutter/blob/master/analysis_options.yaml#L39-L45

@zanderso
Copy link
Member Author

There are new analyzer "info" messages about unused elements, e.g. the class _RequestOptions here:

Are the messages wrong or just undesired here?

I think it's correct that _RequestOptions isn't used in that file. I suspect the @JS annotations might mean that they are needed for JS interop, though?

@ditman
Copy link
Member

ditman commented Feb 23, 2021

Yeah, these files were generated from typescript .d.ts files a long time ago. I guess new analyzer rules caught more stuff in these old files. We never saw those in flutter/plugins before because they were ignored, but mostly because it seems they're just rolling now to the flutter tool, so flutter/flutter caught it first, I guess?

@ditman
Copy link
Member

ditman commented Feb 23, 2021

I've merged the analyzer tweaks to the generated files, I'm going to check the next plugins -> flutter roll.

@ditman ditman reopened this Feb 23, 2021
@ditman
Copy link
Member

ditman commented Feb 23, 2021

The next run of the roller should include the fix above.

@ditman
Copy link
Member

ditman commented Feb 23, 2021

Confirmed, the fix is here: #76630

@ditman
Copy link
Member

ditman commented Feb 23, 2021

76630 has just landed in master

@ditman ditman self-assigned this Feb 23, 2021
@ditman
Copy link
Member

ditman commented Feb 23, 2021

Next engine roll here: #76636 should work

@cyanglaz
Copy link
Contributor

Is there anything left to track here? Should we close this?

@zanderso
Copy link
Member Author

Not that I am aware of. Let's file a new issue if this wasn't completely solved.

@github-actions
Copy link

github-actions bot commented Aug 5, 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 5, 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
dependency: dart Dart team may need to help us p: google_sign_in The Google Sign-In plugin P0 Critical issues such as a build break or regression package flutter/packages repository. See also p: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants