Skip to content

Implement collectAndSendFeedback() #3816

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 8 commits into from
Jun 16, 2022
Merged

Implement collectAndSendFeedback() #3816

merged 8 commits into from
Jun 16, 2022

Conversation

lfkellogg
Copy link
Contributor

@lfkellogg lfkellogg commented Jun 15, 2022

Adds FeedbackSender as a new Component, so that it can be accessed by the FeedbackActivity.

Screencast (submit fails because the upload URL mapping has not rolled out to GFE yet): https://screencast.googleplex.com/cast/NTQ2NDIyNjkzNzE3NjA2NHw0M2YwNjUxYS03Nw

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 15, 2022

Coverage Report 1

Affected Products

  • firebase-appdistribution

    Overall coverage changed from 79.73% (0dd2be1) to 78.21% (164729d) by -1.52%.

    FilenameBase (0dd2be1)Merge (164729d)Diff
    FeedbackActivity.java?0.00%?
    FeedbackSender.java?87.50%?
    FirebaseAppDistributionImpl.java94.92%93.18%-1.74%
    FirebaseAppDistributionRegistrar.java92.59%81.08%-11.51%
    ReleaseIdentifier.java88.16%88.00%-0.16%
    ScreenshotTaker.java?66.67%?
  • firebase-appdistribution-api

    Overall coverage changed from 64.08% (0dd2be1) to 62.26% (164729d) by -1.81%.

    FilenameBase (0dd2be1)Merge (164729d)Diff
    FirebaseAppDistributionProxy.java100.00%84.62%-15.38%
    FirebaseAppDistributionStub.java83.33%81.40%-1.94%

Test Logs

Notes

  • Commit (164729d) is created by Prow via merging PR base commit (0dd2be1) and head commit (dd88656).
  • Run gradle <product>:checkCoverage to produce HTML coverage reports locally. After gradle commands finished, report files can be found under <product-build-dir>/reports/jacoco/.

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/enPkjnlo2B.html

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-appdistribution-api:
warning: Added method com.google.firebase.appdistribution.FirebaseAppDistribution.collectAndSendFeedback() [AddedAbstractMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@lfkellogg lfkellogg force-pushed the lk/feedback-activity branch from 6d5b7d1 to 51c8604 Compare June 15, 2022 16:42
@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-appdistribution-api:
warning: Added method com.google.firebase.appdistribution.FirebaseAppDistribution.collectAndSendFeedback() [AddedAbstractMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 15, 2022

Size Report 1

Affected Products

  • firebase-appdistribution

    TypeBase (0dd2be1)Merge (164729d)Diff
    aar129 kB146 kB+17.2 kB (+13.4%)
    apk (aggressive)751 kB878 kB+127 kB (+16.9%)
    apk (release)1.59 MB2.01 MB+415 kB (+26.1%)
  • firebase-appdistribution-api

    TypeBase (0dd2be1)Merge (164729d)Diff
    aar14.4 kB14.5 kB+96 B (+0.7%)
    apk (release)697 kB697 kB+76 B (+0.0%)

Test Logs

Notes

  • Commit (164729d) is created by Prow via merging PR base commit (0dd2be1) and head commit (dd88656).

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/nxMEzpaTWW.html

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-appdistribution-api:
warning: Added method com.google.firebase.appdistribution.FirebaseAppDistribution.collectAndSendFeedback() [AddedAbstractMethod]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@@ -46,23 +46,39 @@ public class FirebaseAppDistributionRegistrar implements ComponentRegistrar {
Component.builder(FirebaseAppDistribution.class)
.add(Dependency.required(FirebaseApp.class))
.add(Dependency.requiredProvider(FirebaseInstallationsApi.class))
.add(Dependency.required(FeedbackSender.class))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is component registry intended as a general purpose dependency injection framework?
If so, why use it just for FeedbackSender and not for things like FirebaseAppDistributionTesterApiClient, ReleaseIdentifier, etc.?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not. In this case the FeedbackActivity needs to get an instance of the class, which depends on a Provider and thus needs to be instantiated by the Firebase Components framework.

Not sure if this is the best way to do this though. I'll reach out to the ACore folks.

Copy link
Member

Choose a reason for hiding this comment

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

why does FirebaseAppDistribution actually depend on FeedbackSender? I don't see it used inside buildFirebaseAppDistribution

Copy link
Contributor Author

@lfkellogg lfkellogg Jun 15, 2022

Choose a reason for hiding this comment

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

I was thinking that this captures the dependency that FeedbackActivity (launched by FirebaseAppDistribution) has on FeedbackSender... (EDIT: thinking more now I guess that doesn't make sense, disregard)


/** Take a screenshot of the running host app. */
Task<Bitmap> takeScreenshot() {
// TODO(lkellogg): Actually take a screenshot
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice! We can get an activity using FirebaseAppDistributionActivityLifecycleNotifier.applyToForegroundActivity().

TODO: shorten the name of that class :)

I think we can add that in a followup.

@lfkellogg lfkellogg force-pushed the lk/feedback-activity branch from 861b763 to 05d4642 Compare June 15, 2022 17:46
this.testerApiClient = testerApiClient;
}

@NonNull
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed you removed this annotation in UpdateProgress. How do you decide it's needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't needed in UpdateProgress because those return types (long) were not nullable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I don't think this is necessary either. In this case it's because this is not a publicly exposed API. I'll remove it.

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this file generated somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I built this. It's a very basic prototype UI. You can see it in the screencast in the PR description.

@kaibolay
Copy link
Contributor

Task :firebase-appdistribution-api:verifyGoogleJavaFormat FAILED

The following files are not formatted properly:
/home/prow/go/src/github.com/firebase/firebase-android-sdk/firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/FirebaseAppDistribution.java

@kaibolay
Copy link
Contributor

/test smoke-tests

@lfkellogg lfkellogg merged commit bd94e28 into master Jun 16, 2022
@lfkellogg lfkellogg deleted the lk/feedback-activity branch June 16, 2022 16:58
@firebase firebase locked and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants