-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
feat: update gradle dependencies #1163
Conversation
Thanks for opening this pull request!
|
I will reformat the title to use the proper commit message syntax. |
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.
Great job @mobilekosmos
LGTM
I just noticed the CI is failing, do we need a separate PR to fix something or is this related to this PR? |
It seems that all the mockito imports are not being resolved, could also see locally in my IDE, it happens when updating mockito to latest version, must investigate solution. |
How to fix the spotless failing? Wouldn't it be possible to let the CI do the formatting automatically? |
You should be able to run spotless to auto-correct what's possible locally and commit these changes. |
"First-time contributors need a maintainer to approve running workflows." |
@mobilekosmos Could you please take a look at the failing CI? |
Codecov Report
@@ Coverage Diff @@
## master #1163 +/- ##
============================================
- Coverage 67.31% 66.79% -0.53%
+ Complexity 2285 2248 -37
============================================
Files 122 121 -1
Lines 9962 9892 -70
Branches 1343 1332 -11
============================================
- Hits 6706 6607 -99
- Misses 2735 2773 +38
+ Partials 521 512 -9
Continue to review full report at Codecov.
|
Despite such minor changes, the pain of a PR is big. |
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 is upgrading the Facebook SDK from 12 to 13. Does this imply a breaking change for developers? If so we'd need to make this a major version increase.
Shouldn't automated tests respond to this? |
Btw. it seems that Facebook's Android SDK 13 urges to "migrate" to it: |
After seeing the amount of files changed with this PR I'm asking myself if it wouldn't be better, at least in the future, to accept only one dependency update per each PR, more burocratic and painfull again, but maybe a better approach? Not sure yet. |
@mobilekosmos Yes, I would not mix a major version upgrade of the FB SDK with other dependency upgrades, because it's an essential part of the SDK with its own complexities. Depending on what the breaking change in the FB SDK 13 is, we may have to declare a breaking change for the Parse Android SDK if developers cannot simply upgrade the SDK without having to change their code. Could you take a look at the FB SDK changelog? |
@mtrezza I tried to follow all breaking changes on the Facebook SDK and check if something is needed to be change as a breaking change on this SDK, but didn't see anything. Still, following the discussions and the issues it looks that there are some issues, but I'm no sure if it's a misconfiguration of the app or not. In #1164 from the screenshots I saw that the app is not configured. About:
Yes, the Facebook SDK is
Yes, it's possible |
Thanks, so we have to do a major version increment when we merge this. |
I'm suggesting to fix #1158 first before we merge this, because any release without the migration logic is for most people likely a useless release. |
Good news, #1158 has been merged, so we can resume this PR. The question is still, whether a major version increment by FB SDK means the Parse SDK has to do a major increment as well. Let's explore this: The FB SDK is a transitive dependency (and For developers who do have the Facebook SDK and Parse SDK added to their project, this creates a challenge due to Gradle's dependency resolution management. For example, if Parse Android SDK 3.0.1 is added to an app that also has added:
Gradle will resolve this by overriding the Parse Android SDK's dependency:
This happens in the background and looks problematic, because Parse SDK is tested with
We are saying that the Parse SDK works with any FB SDK version >= 12.1.0 which isn't correct. It should trigger a resolution error because the app requires FB SDK >= 13.2.0 and the Parse SDK is only tested with 12.1.0, and we can assume FB follows semver and it will be compatible until <13.0.0. So we would need to add a dependency constraint, which currently should be the range
I don't think we need to increment by a major version, since this is a "dependency breaking change" that gradle will identify and report if there is a resolution conflict with the developer's app. That of course requires the developer to properly set the version ranges of their app's dependencies, which is the developer's responsibility. So we don't have to worry about it. What do you think @L3K0V, @rommansabbir? |
That's not correct, only Facebook SDK dependency can be changed from The point having the Facebook as a Another approach will be to make the Facebook SDK I cannot take a decision here, not until I research how is done in other similar cases and situations. |
AFAIK It will cause troubles if two different versions of Facebook SDK will end up being used. I have experienced this myself many times. The Android Studio compiler will eventually flag this as "duplicate class" error since Java can not use two .jar files providing the same classes in isolation. This can work in C/Objective-C/Swift world where |
Yes, sorry for the confusion, should have phrased that better.
There can't be 2 different FB SDK versions used at the same time. Gradle will try to decide on a single version. If it cannot, it will throw an error. If a developer implements their own FB SDK with a higher version, gradle will override the FB SDK version in the Parse SDK. We have to tell gradle that we did not test the Parse SDK with any version higher than 12.1.0. We can only assume that it will be compatible with If a developer tries to implement a FB SDK that is incompatible with Parse SDK's dependency of the FB SDK, gradle should throw an error, that is nothing bad but necessary. Otherwise the Parse SDK will cause runtime errors when it tries to access an API that is not available in the FB SDK. In addition, we are only implementing the FB Login SDK, that means chances are high that a developer adds their own FB SDK to the app, because all other FB modules are missing. |
@mman my point was about the resolution strategy of Gradle which version will pick of many and what will be the behaviour after that. In your experience and from your perspective what should be the approach here? a) Facebook SDK as Maybe is a manner of how do we want to 'communicate' to developers, do we want to push them to use bundled version, or their own or something else. |
I haven't used before the versions constraints @mtrezza, where you can specify a range. It sounds promising but again maybe we should discuss whenever the Parse SDK bundle the Facebook SDK, bundle + export ( |
That's answered in the dependency resolution management and my previous 2 comments.
Gradle communicates that to the developer. Even if we specify an upper range, the developer can still decide to force override the FB SDK version in the Parse SDK to resolve the resolution conflict. That will then be a deliberate choice, with the developer being aware that is may cause runtime errors because it's not tested. But it should never happen in the background without the developer knowing. A changelog may be read or not read, but gradle will actually warn the developer in a way that is hard to overlook.
Good question. I think we can separate that from the range discussion, whatever we choose, we need to define a range because we cannot future-test the Parse SDK with unreleased FB SDK versions. How about we add the range in this PR and open a new issue to discuss the larger question you posed? That will also give the discussion more visibility. |
Sounds great 👍 |
So the conclusion would be:
@mman What do you think? |
@@ -35,7 +35,7 @@ android { | |||
} | |||
|
|||
dependencies { | |||
api "com.facebook.android:facebook-login:12.1.0" | |||
api "com.facebook.android:facebook-login:13.1.0" |
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.
Change to
api "com.facebook.android:facebook-login:[13.2.0, 14.0["
@mobilekosmos Would you take a look at the small change requested and the failing CI so we can merge this? I assume the failing test is caused by this PR, because we just merged #1158 with all tests passing. |
Does anyone want to continue this PR to get it merged? It seems to need just a rebase and a trivial code change. It seems that @mobilekosmos has abandoned it. @parse-community/android-sdk |
I will try to start again with this PR, once I'm back to my working place. |
Cool, @rommansabbir can I add you to the Parse Android SDK review team? No obligations, but you would get a notification as member of |
Yes, that would be amazing! |
@mtrezza I have updated FB SDK (api) version to a specific range and run all the tests from the existing tests, all passed but I'm unable to push my changes to @mobilekosmos HEAD:master to that the changes could refelect in this PR. @mobilekosmos can you check, if it's allowed to push commits to this PR? Or, else I just create a new PR and refer to this one? @mman @mtrezza |
New PR please, I will then go ahead and close this PR. |
Closing, replaced by #1172. Thanks for the initial work, @mobilekosmos! |
Related issue: #1159