-
Notifications
You must be signed in to change notification settings - Fork 614
Fix fcm dependency #3533
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
Conversation
Size Report 1Affected Products
Test Logs
Notes |
Coverage Report 1Affected Products
Test Logs
Notes |
There was a problem hiding this 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, 😄 👍
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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.
@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 |
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' 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 |
Vendored in |
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: The following tests failed, say
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. |
No description provided.