Skip to content

Initial code structure for App Distribution Android SDK #2754

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 12 commits into from
Jun 30, 2021
Merged

Conversation

andrewbibiloni
Copy link
Contributor

Initial commit for App Distribution new build alerts Android SDK

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 22, 2021

Coverage Report

Affected SDKs

  • firebase-database

    SDK overall coverage changed from 50.03% (202af1d) to 50.01% (10f53ba5) by -0.02%.

    Filename Base (202af1d) Head (10f53ba5) Diff
    ChildChangeAccumulator.java 96.67% 83.33% -13.33%
    DoubleNode.java 88.24% 100.00% +11.76%
    ViewProcessor.java 92.10% 91.79% -0.30%
    WriteTree.java 76.67% 77.22% +0.56%
  • firebase-firestore

    SDK overall coverage changed from 47.18% (202af1d) to 47.10% (10f53ba5) by -0.09%.

    Filename Base (202af1d) Head (10f53ba5) Diff
    AsyncQueue.java 78.39% 77.89% -0.50%
    FirestoreClient.java 34.96% 30.08% -4.88%
    LruGarbageCollector.java 93.46% 84.11% -9.35%
  • firebase-storage

    SDK overall coverage changed from ? (202af1d) to 86.07% (10f53ba5) by ?.

    Click to show coverage changes in 46 files.
    Filename Base (202af1d) Head (10f53ba5) Diff
    ActivityLifecycleListener.java ? 74.14% ?
    AdaptiveStreamBuffer.java ? 84.62% ?
    CancelException.java ? 100.00% ?
    CancellableTask.java ? 100.00% ?
    ControllableTask.java ? 100.00% ?
    DeleteNetworkRequest.java ? 100.00% ?
    DeleteStorageTask.java ? 100.00% ?
    ExponentialBackoffSender.java ? 86.00% ?
    FileDownloadTask.java ? 80.00% ?
    FirebaseStorage.java ? 85.11% ?
    FirebaseStorageComponent.java ? 100.00% ?
    GetDownloadUrlTask.java ? 96.77% ?
    GetMetadataNetworkRequest.java ? 100.00% ?
    GetMetadataTask.java ? 85.19% ?
    GetNetworkRequest.java ? 100.00% ?
    HttpURLConnectionFactory.java ? 0.00% ?
    HttpURLConnectionFactoryImpl.java ? 50.00% ?
    ListNetworkRequest.java ? 100.00% ?
    ListResult.java ? 100.00% ?
    ListTask.java ? 85.71% ?
    NetworkRequest.java ? 86.67% ?
    OnPausedListener.java ? 0.00% ?
    OnProgressListener.java ? 0.00% ?
    ResumableNetworkRequest.java ? 100.00% ?
    ResumableUploadByteRequest.java ? 90.91% ?
    ResumableUploadCancelRequest.java ? 100.00% ?
    ResumableUploadQueryRequest.java ? 100.00% ?
    ResumableUploadStartRequest.java ? 95.24% ?
    Slashes.java ? 88.24% ?
    Sleeper.java ? 0.00% ?
    SleeperImpl.java ? 33.33% ?
    SmartHandler.java ? 87.50% ?
    StorageException.java ? 65.45% ?
    StorageMetadata.java ? 86.34% ?
    StorageReference.java ? 89.94% ?
    StorageReferenceUri.java ? 100.00% ?
    StorageRegistrar.java ? 100.00% ?
    StorageTask.java ? 84.29% ?
    StorageTaskManager.java ? 100.00% ?
    StorageTaskScheduler.java ? 100.00% ?
    StreamDownloadTask.java ? 88.89% ?
    TaskListenerImpl.java ? 100.00% ?
    UpdateMetadataNetworkRequest.java ? 100.00% ?
    UpdateMetadataTask.java ? 82.14% ?
    UploadTask.java ? 82.37% ?
    Util.java ? 73.24% ?

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (10f53ba5) is created by Prow via merging commits: 202af1d 013e422.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 22, 2021

Binary Size Report

Affected SDKs

  • firebase-app-distribution

    Type Base (202af1d) Head (10f53ba5) Diff
    aar ? 10.2 kB ? (?)
    apk (aggressive) ? 78.1 kB ? (?)
    apk (release) ? 641 kB ? (?)

Test Logs

Notes

Head commit (10f53ba5) is created by Prow via merging commits: 202af1d 013e422.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 22, 2021

Macrobenchmark Report

Affected SDKs

Measurements are for head commit (45167b3). Diffing against base commit (563781c) is working in progress.

  • baseline

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait122.0 ms152.0 ms137.0 ms148.3 ms151.8 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait41.0 ms66.0 ms48.0 ms54.0 ms63.7 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait58.0 ms83.0 ms67.0 ms82.1 ms83.0 ms
  • firebase-common

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait121.0 ms160.0 ms142.5 ms153.5 ms159.6 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait39.0 ms59.0 ms49.5 ms55.3 ms58.8 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait64.0 ms84.0 ms70.5 ms80.1 ms83.4 ms
  • firebase-config

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait122.0 ms177.0 ms152.0 ms171.3 ms176.4 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait46.0 ms70.0 ms51.0 ms64.3 ms69.4 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait52.0 ms100.0 ms73.5 ms93.5 ms99.6 ms
  • firebase-crashlytics

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait138.0 ms187.0 ms163.0 ms178.6 ms186.4 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait36.0 ms62.0 ms55.5 ms62.0 ms62.0 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait61.0 ms91.0 ms75.5 ms87.0 ms90.2 ms
  • firebase-database

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait135.0 ms164.0 ms141.5 ms155.2 ms162.7 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait39.0 ms73.0 ms58.0 ms65.3 ms72.1 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait62.0 ms99.0 ms76.0 ms82.1 ms96.0 ms
  • firebase-dynamic-links

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait118.0 ms163.0 ms139.0 ms160.1 ms162.6 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait37.0 ms74.0 ms54.0 ms63.0 ms71.9 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait63.0 ms91.0 ms78.0 ms84.0 ms89.7 ms
  • firebase-firestore

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait127.0 ms164.0 ms145.5 ms157.2 ms163.1 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait46.0 ms67.0 ms52.0 ms59.0 ms65.5 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait49.0 ms77.0 ms71.5 ms75.0 ms76.6 ms
  • firebase-functions

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait129.0 ms171.0 ms146.0 ms155.2 ms170.1 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait31.0 ms64.0 ms46.5 ms59.1 ms63.2 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait59.0 ms90.0 ms76.0 ms81.3 ms88.9 ms
  • firebase-inappmessaging-display

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait157.0 ms220.0 ms174.5 ms203.1 ms217.0 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait34.0 ms63.0 ms50.0 ms62.0 ms62.8 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait53.0 ms89.0 ms71.0 ms86.0 ms88.4 ms
  • firebase-messaging

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait133.0 ms169.0 ms149.5 ms159.1 ms169.0 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait30.0 ms62.0 ms48.0 ms61.1 ms62.0 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait50.0 ms83.0 ms64.5 ms82.0 ms82.8 ms
  • firebase-perf

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait142.0 ms178.0 ms162.0 ms170.8 ms178.0 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait45.0 ms66.0 ms54.0 ms61.2 ms65.4 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait59.0 ms88.0 ms71.0 ms84.2 ms87.6 ms
  • firebase-storage

    NameDeviceMinMaxP50P90P99
    BenchmarkTest.startup[mode=COLD]flame-30-en-portrait132.0 ms167.0 ms141.5 ms156.1 ms165.1 ms
    BenchmarkTest.startup[mode=HOT]flame-30-en-portrait37.0 ms66.0 ms51.5 ms61.1 ms65.2 ms
    BenchmarkTest.startup[mode=WARM]flame-30-en-portrait46.0 ms100.0 ms75.0 ms84.3 ms97.5 ms

@andrewbibiloni
Copy link
Contributor Author

/retest

1 similar comment
@andrewbibiloni
Copy link
Contributor Author

/retest

@andrewbibiloni andrewbibiloni requested a review from vkryachko June 22, 2021 21:34
@andrewbibiloni
Copy link
Contributor Author

/retest

* @param updateProgressListener a callback function invoked as the update progresses
*/
@NonNull
public abstract Task<Void> updateApp(@Nullable UpdateProgressListener updateProgressListener);
Copy link
Member

Choose a reason for hiding this comment

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

it's a bit strange to me that lack of update is an exception, do you have an api review doc I can take a look at?

Choose a reason for hiding this comment

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

This method is different from updateToLatestRelease, because it should be called only after checkForUpdate returns a truthy value. If it is called when no release is available, we'd throw the exception.

We'll share the API proposal with you over chat

* @param updateProgressListener a callback function invoked as the update progresses
*/
@NonNull
public abstract Task<Void> updateApp(@Nullable UpdateProgressListener updateProgressListener);

Choose a reason for hiding this comment

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

This method is different from updateToLatestRelease, because it should be called only after checkForUpdate returns a truthy value. If it is called when no release is available, we'd throw the exception.

We'll share the API proposal with you over chat

@andrewbibiloni
Copy link
Contributor Author

/retest

1 similar comment
@andrewbibiloni
Copy link
Contributor Author

/retest

@rachaprince
Copy link

/retest

@rachaprince
Copy link

/test device-check-changed

1 similar comment
@rachaprince
Copy link

/test device-check-changed

@rachaprince
Copy link

/test device-check-changed

* @param updateProgressListener a callback function invoked as the update progresses
*/
@NonNull
public Task<Void> updateApp(@Nullable UpdateProgressListener updateProgressListener) {
Copy link
Member

Choose a reason for hiding this comment

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

This API looks a bit suspicious, on the one hand it's returning a task indicating that it will succeed in the future, otoh it also takes a listener to monitor progress.
We have a pattern for such APIs, e.g. storage uses CancellableTask that allows to listen to progress updates. It would be beneficial to do something similar here. cc @schmidt-sebastian

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you speak more about why returning a task is at odds with providing a progress listener? The idea behind a progress listener was to provide customers the flexibility of listening to progress updates (in our case APK download progress). Something like the CancellableTask is reasonable but we don't want to introduce update cancellation functionality yet.

Copy link
Contributor

@pranavrajgopal pranavrajgopal Jun 29, 2021

Choose a reason for hiding this comment

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

To add more context to the API - updateApp is a Task< Void > because we didn't think there is any actionable data to be returned to the customer if that task succeeds. But customers might be interested in knowing the progress of the current update (maybe to present a custom UI)

Choose a reason for hiding this comment

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

We discussed this offline. We plan to update this method to return an UpdateTask, and follow the same pattern as the CancellableTask (but without providing cancellation functionality)

Change data classes to public final classes
Add UpdateTask class
Update FirebaseAppDistributionException to use an enum instead of an IntDef
* updateToLatestRelease()
*/
public interface AppDistributionRelease {
public final class AppDistributionRelease {
Copy link
Member

Choose a reason for hiding this comment

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

non-blocking nit: you may want to add equals() and hashCode(), or use an @AutoValue altogether.

Choose a reason for hiding this comment

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

Good call. We will add these in a follow-up PR

@rachaprince rachaprince merged commit 460fd3f into master Jun 30, 2021
@rachaprince rachaprince deleted the fad_sdk branch June 30, 2021 19:19
@firebase firebase locked and limited conversation to collaborators Jul 31, 2021
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.

5 participants