Skip to content
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

Fix fcm dependency #3533

Merged
merged 8 commits into from Mar 15, 2022
Merged

Fix fcm dependency #3533

merged 8 commits into from Mar 15, 2022

Conversation

VinayGuthal
Copy link
Contributor

No description provided.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 15, 2022

Size Report 1

Affected Products

  • base

    TypeBase (e324046)Merge (215d9b4)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?8.65 kB? (?)
  • firebase-annotations

    TypeBase (e324046)Merge (215d9b4)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?8.88 kB? (?)
  • firebase-common

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?48.0 kB? (?)
    apk (aggressive)?84.2 kB? (?)
    apk (release)?680 kB? (?)
  • firebase-components

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?41.4 kB? (?)
    apk (aggressive)?8.68 kB? (?)
    apk (release)?29.5 kB? (?)
  • firebase-datatransport

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?5.12 kB? (?)
    apk (aggressive)?130 kB? (?)
    apk (release)?767 kB? (?)
  • firebase-encoders

    TypeBase (e324046)Merge (215d9b4)Diff
    apk (aggressive)?8.68 kB? (?)
    apk (release)?15.3 kB? (?)
  • firebase-encoders-json

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?10.5 kB? (?)
    apk (aggressive)?8.68 kB? (?)
    apk (release)?20.1 kB? (?)
  • firebase-encoders-proto

    TypeBase (e324046)Merge (215d9b4)Diff
    apk (aggressive)?8.68 kB? (?)
    apk (release)?21.6 kB? (?)
  • firebase-installations

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?55.0 kB? (?)
    apk (aggressive)?85.8 kB? (?)
    apk (release)?702 kB? (?)
  • firebase-installations-interop

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?8.34 kB? (?)
    apk (aggressive)?65.0 kB? (?)
    apk (release)?651 kB? (?)
  • firebase-messaging

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?225 kB? (?)
    apk (aggressive)?504 kB? (?)
    apk (release)?1.22 MB? (?)
  • transport-api

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?6.57 kB? (?)
    apk (aggressive)?8.68 kB? (?)
    apk (release)?14.9 kB? (?)
  • transport-backend-cct

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?53.5 kB? (?)
    apk (aggressive)?58.0 kB? (?)
    apk (release)?105 kB? (?)
  • transport-runtime

    TypeBase (e324046)Merge (215d9b4)Diff
    aar?178 kB? (?)
    apk (aggressive)?43.8 kB? (?)
    apk (release)?82.6 kB? (?)

Test Logs

Notes

  • Commit (215d9b4) is created by Prow via merging PR base commit (e324046) and head commit (e79557d).

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 15, 2022

Coverage Report 1

Affected Products

  • firebase-messaging

    Overall coverage changed from 85.70% (e324046) to 84.82% (215d9b4) by -0.88%.

    FilenameBase (e324046)Merge (215d9b4)Diff
    ByteStreams.java?59.72%?
    MessagingAnalytics.java83.00%81.38%-1.62%

Test Logs

Notes

  • Commit (215d9b4) is created by Prow via merging PR base commit (e324046) and head commit (e79557d).
  • 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/rrDyWrNDSN.html

Copy link

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

Nice - I'm only here because I'm the original poster of #3526 - with this change I cannot imagine the google api-client dependency leaking in to the published artifact anymore, thus I cannot imagine the httpcomponents dependencies transitively leaking in either. Should do the trick. I recognize my approval doesn't carry weight but symbolically, 😄 👍

@gsakakihara gsakakihara self-requested a review March 15, 2022 14:08
Copy link
Contributor

@gsakakihara gsakakihara left a comment

Choose a reason for hiding this comment

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

It looks like this may need to have verifyGoogleJavaFormat run to fix the test failures. For the annotation changes, I think you might also be able to fix it by adding
compileOnly 'com.google.code.findbugs:jsr305:3.0.2' instead of switching them, though I haven't tested it out and I don't know which one is more preferred.

byte[] data = new byte[MAX_IMAGE_SIZE_BYTES + 1];

while ((nRead = connectionInputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can end up reading several chunks of up to MAX_IMAGE_SIZE_BYTES+1, which is not equivalent to ByteStreams.limit. If you check @ ByteStreams implementation it limits the total value read to be up to MAX_IMAGE_SIZE_BYTES+1 with a counter. You would need to implement something similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think it will be equivalent. bcz the reading is not in the for loop and ByteStreams.limit(connectionInputStream, MAX_IMAGE_SIZE_BYTES + 1)); is getting initialized everytime a function is called so the limit will be set everytime not once

Copy link
Contributor

@gsakakihara gsakakihara left a comment

Choose a reason for hiding this comment

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

Is there a way to add a previous dependency to continue to use ByteStreams? It used to work without bringing in google-api-client.

@VinayGuthal
Copy link
Contributor Author

Is there a way to add a previous dependency to continue to use ByteStreams? It used to work without bringing in google-api-client.

@gsakakihara this would introduce a dependency on guava and would be a big regression in terms of size..Guava was vendored in before so it was fine. However now it will cause a lot of bloating

@gsakakihara
Copy link
Contributor

Is there a way to vendor it in now? Otherwise it seems like that section will need to be fixed since it is definitely a change in behavior.

Also compileOnly 'com.google.code.findbugs:jsr305:3.0.2' doesn't work, but:

implementation 'com.google.errorprone:error_prone_annotations:2.11.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'

does seem to work, but I'm not sure what other effects on size and such that would have.

@VinayGuthal
Copy link
Contributor Author

Is there a way to vendor it in now? Otherwise it seems like that section will need to be fixed since it is definitely a change in behavior.

Also compileOnly 'com.google.code.findbugs:jsr305:3.0.2' doesn't work, but:

implementation 'com.google.errorprone:error_prone_annotations:2.11.0' implementation 'com.google.code.findbugs:jsr305:3.0.2'

does seem to work, but I'm not sure what other effects on size and such that would have.

I think it should fairly be similar between androidx and javax (especially since this is android sdk androidx might be preferred). However if you want to keep it back to javax, i can add implementation 'com.google.code.findbugs:jsr305:3.0.2' to the gradle and revert the annotation changes

@VinayGuthal
Copy link
Contributor Author

Is there a way to vendor it in now? Otherwise it seems like that section will need to be fixed since it is definitely a change in behavior.

Also compileOnly 'com.google.code.findbugs:jsr305:3.0.2' doesn't work, but:

implementation 'com.google.errorprone:error_prone_annotations:2.11.0' implementation 'com.google.code.findbugs:jsr305:3.0.2'

does seem to work, but I'm not sure what other effects on size and such that would have.

Vendored in

@VinayGuthal
Copy link
Contributor Author

Nice - I'm only here because I'm the original poster of #3526 - with this change I cannot imagine the google api-client dependency leaking in to the published artifact anymore, thus I cannot imagine the httpcomponents dependencies transitively leaking in either. Should do the trick. I recognize my approval doesn't carry weight but symbolically, 😄 👍

Thanks a lot @mikehardy for the review :) Your approval does carry weight!! Also thanks for pointing out this issue allowing us to fix this!

@VinayGuthal VinayGuthal merged commit 87ae78e into master Mar 15, 2022
@VinayGuthal VinayGuthal deleted the fix_fcm_dependency branch March 15, 2022 16:43
@google-oss-bot
Copy link
Contributor

@VinayGuthal: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests e79557d link /test smoke-tests
device-check-changed e79557d link /test device-check-changed

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@firebase firebase locked and limited conversation to collaborators Apr 15, 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.

None yet

5 participants