Skip to content

[extension_google_sign_in_as_googleapis_auth] Update example app. #466

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

Merged
merged 21 commits into from
Sep 23, 2021

Conversation

ditman
Copy link
Member

@ditman ditman commented Sep 14, 2021

Update the example app of package:extension_google_sign_in_as_googleapis_auth by grabbing the latest version of the example app from package:google_sign_in and applying the changes required for this package to work.

The example app builds again on Android (at least on an emulator, it starts up!)

Fixes flutter/flutter#89301

Pre-launch Checklist

  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • 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.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

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

@ditman
Copy link
Member Author

ditman commented Sep 14, 2021

@stuartmorgan I've copied a bunch of test-like stuff from the google_sign_in example from flutter/plugins, but I'm not sure if it's 100% appropriate (especially the pbxproj/iOS files)

I have verified that the app now builds on Android again, but it seems to lack the client ID to correctly use the Auth service.

I'm not sure if tests run correctly (I hope something happens in this run!)

@ditman ditman force-pushed the update-google-sign-in-extension-example branch from bd86712 to 44ca4b5 Compare September 15, 2021 18:42
@ditman
Copy link
Member Author

ditman commented Sep 15, 2021

(Force-pushed after fixing conflicts on a rebase with master)

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

I started doing a file-by-file review, but it seems like there's a lot here that's not relevant.

What about just nuking example, regenerating it from the template, and re-adding the Dart bits?


@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface DartIntegrationTest {}
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not running this file at all in this repo. Do we actually need native integration tests for this package?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just a result of doing a cp from the current implementation of the example app of google_sign_in into here. I thought you were looking at adding Android tests for this repo? I can remove these tests, no problem (there's probably the xcode equivalents somewhere under the ios dir?)

Copy link
Contributor

Choose a reason for hiding this comment

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

We can run whatever tests in the repo that we believe are useful, but generally I wouldn't expect a non-plugin package to need to run native tests. Presumably this package is testable by shimming out the plugin it wraps, and doing Dart unit tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there are a couple of unit-tests in the root test directory that are enough (the behavior is very simple).

I think the most valuable thing to do here would be to say: this example app passes the same integration tests as google_sign_in, in an attempt to prove they're functionally identical?

(The only change actually is that this example app uses package:googleapis and the standard app uses raw http requests with hand-coded authentication headers)

@ditman
Copy link
Member Author

ditman commented Sep 20, 2021

What about just nuking example, regenerating it from the template, and re-adding the Dart bits?

Yep, this is better. I'll get this done.

@ditman
Copy link
Member Author

ditman commented Sep 21, 2021

@stuartmorgan I completely nuked example and regenerated it:

flutter create googlesigninexample --org io.flutter.plugins

The only modifications I did were to lib/main.dart, the pubspec.yaml and ensured that android had the gms plugin enabled through gradle.

I added the plist file in the right spot on the ios code (inside the Runner), but I did it manually, so I'm sure it's missing some xcode magic :/

PTAL!

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM with nits.

Some of the added churn here is because you didn't use --ios-language=objc --android-language=java, but for an example in the packages repo I think it probably doesn't matter. (In plugins we want the example runners to use the same language as everything else, at least for now.)

@ditman
Copy link
Member Author

ditman commented Sep 22, 2021

you didn't use --ios-language=objc --android-language=java, but for an example in the packages repo I think it probably doesn't matter.

This is a good point, I'll get it done before merging, see if it simplifies things :)

@ditman
Copy link
Member Author

ditman commented Sep 22, 2021

Ready to go!

@ditman ditman merged commit 671b787 into flutter:master Sep 23, 2021
@ditman ditman deleted the update-google-sign-in-extension-example branch September 23, 2021 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[extension_google_sign_in_as_googleapis_auth] Example doesn't build on Android
2 participants