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

feat: update project dependencies and code refactoring #1141

Merged
merged 23 commits into from
Nov 25, 2021
Merged

feat: update project dependencies and code refactoring #1141

merged 23 commits into from
Nov 25, 2021

Conversation

azlekov
Copy link
Contributor

@azlekov azlekov commented Nov 16, 2021

New Pull Request Checklist

Issue Description

The project should be up-to-date with all dependencies, Gradle version, Android Studio etc but is not.
It uses an old versions of the integration libraries like Firebase, Facebook and also the Parse Android SDK is stuck on very old version of OkHttp which does not support newer TLS versions. Updating OkHttp requires bump of min Android SDK version to API 21. Also the new Firebase libraries also bump their min version to API 19

Also some of the modules uses deprecated APIs from Bolts and other libraries. The idea is to update the source base a bit.

Related issue: #1142 #1100 #1123 #1095
Closes: #1142

Approach

The approach here will be to update all dependencies, Gradle wrapper version and AGP to the latest versions. Also cleaning up all deprecated code calls and replace them with their new options or variants. Because there was no activity and new Parse Android SDK versions lately, it's save to remove all deprecated Parse APIs.

Breaking changes

  • Minimum Android SDK API level is now 21
  • Removed deprecated twitter link methods
  • Removed deprecated Parse.getParseDir()

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 16, 2021

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented Nov 16, 2021

Codecov Report

Merging #1141 (5a482ba) into master (d420371) will increase coverage by 0.53%.
The diff coverage is 52.63%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1141      +/-   ##
============================================
+ Coverage     66.27%   66.81%   +0.53%     
+ Complexity     2251     2249       -2     
============================================
  Files           122      121       -1     
  Lines          9983     9892      -91     
  Branches       1343     1332      -11     
============================================
- Hits           6616     6609       -7     
+ Misses         2850     2771      -79     
+ Partials        517      512       -5     
Impacted Files Coverage Δ
parse/src/main/java/com/parse/Parse.java 61.68% <ø> (+0.28%) ⬆️
parse/src/main/java/com/parse/ParseConfig.java 95.53% <ø> (ø)
.../src/main/java/com/parse/ParseEventuallyQueue.java 10.95% <0.00%> (ø)
parse/src/main/java/com/parse/ParseObject.java 61.35% <ø> (ø)
parse/src/main/java/com/parse/ParsePlugins.java 31.25% <0.00%> (+1.48%) ⬆️
parse/src/main/java/com/parse/ParsePolygon.java 82.27% <ø> (ø)
...ain/java/com/parse/ParsePushBroadcastReceiver.java 45.16% <0.00%> (+1.75%) ⬆️
parse/src/main/java/com/parse/ParseQuery.java 76.99% <ø> (ø)
parse/src/main/java/com/parse/PushRouter.java 0.00% <0.00%> (ø)
...rse/src/main/java/com/parse/ParseCommandCache.java 8.12% <50.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b065eff...5a482ba. Read the comment docs.

@azlekov azlekov changed the title Keep dependencies up to date refactor: update project dependencies and refactor the code Nov 16, 2021
@azlekov
Copy link
Contributor Author

azlekov commented Nov 16, 2021

@mtrezza in continue of #1095 I did another batch of dependencies updates to all modules dependencies and update again everything. Unfortunately it's time to update min SDK version to 21 as we discussed in #1123 because of two reasons:

  1. Firebase requires now min SDK API 19
  2. OkHttp requires min SDK API 21

The discussion here #1123 (comment)

Fortunately the upgrades went smooth so far without big changes.

@azlekov azlekov changed the title refactor: update project dependencies and refactor the code feat: update project dependencies and refactor the code Nov 16, 2021
Remove deprecated code calls
Refactor code and remove not needed Android SDK checks
@azlekov
Copy link
Contributor Author

azlekov commented Nov 16, 2021

@mtrezza again this PR is baby step ahead. I have updated the description adding the breaking changes this PR introduce. And because there was no activity on the Android SDK if you are okay I decide to clean up and remove the deprecated methods Parse Android SDK provides, so it will be less code to maintain and to migrate to Kotlin after that.

@azlekov azlekov mentioned this pull request Nov 16, 2021
13 tasks
@azlekov azlekov marked this pull request as ready for review November 16, 2021 18:48
@azlekov azlekov requested a review from mtrezza November 16, 2021 18:48
@azlekov azlekov marked this pull request as draft November 16, 2021 21:09
@mtrezza
Copy link
Member

mtrezza commented Nov 17, 2021

@L3K0V you marked this as DRAFT after requesting the review. If you still request the review please remove the DRAFT flag and request again.

@mtrezza mtrezza removed their request for review November 17, 2021 12:30
@azlekov
Copy link
Contributor Author

azlekov commented Nov 17, 2021

Sorry @mtrezza, I found few things which I should improve soon.

As not sure if all libraries supports 1.6.0 which was released one or two days ago
@azlekov azlekov marked this pull request as ready for review November 18, 2021 07:20
@azlekov azlekov requested a review from mtrezza November 18, 2021 07:20
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good, that's a pretty nice clean-up!

It seems this will be a major release as it will contain some breaking changes:

  • minSdkVersion 16 to 21
  • com.google.firebase:firebase-messaging 22.0.0 to 23.0.0 --> this does not have to mentioned explicitly, as it requires minSDK 19 which is lower than the bump to 21, but was google play services required for 22 as well?
  • many deprecated public methods have been removed, they should be listed explicitly in the release notes, could you list them here in a comment, so I can use that to compose the breaking change note?

@azlekov
Copy link
Contributor Author

azlekov commented Nov 18, 2021

@mtrezza here you go:

but was google play services required for 22 as well?

In the release notes they say nothing about bumping the API level, but the release we use (the latest available) is from July, so I expect soon new versions to be released.

Deprecated methods:

Parse

  • getParseDir() use getParseCacheDir(String) or getParseFilesDir(String) instead

Twitter Utils

  • link(ParseUser, Context) use linkInBackground(Context, ParseUser) instead
  • link(ParseUser, String, String, String, String) use linkInBackground(ParseUser, String, String, String, String) instead

I wonder how to compose an COMPATIBILITY.md or something similar to define the API levels supported and close also #1123 I'm open for ideas. Can you help me with this?

@azlekov
Copy link
Contributor Author

azlekov commented Nov 18, 2021

@mtrezza maybe I didn't get you right about

but was google play services required for 22 as well?

I think still Google Play Services are required for all versions of Firebase Messaging. In the release notes they said that:

Due to its dependency on Google Play services, this SDK now requires devices and emulators to target API level 19 (KitKat) or higher and to use Android 4.4 or higher.

So I expect that they still depend on it. Also here is mentioned that cloud messaing still requires Google Play Services

@mtrezza
Copy link
Member

mtrezza commented Nov 18, 2021

Yes, I have seen that table, but I couldn't tell from it whether they only added the Google Play Services dependency with version 23 or whether Cloud Messaging was already dependent on GPS in version 22. But if you say it was dependent also in version 22 then it's not a breaking change we need to mention.

I wonder how to compose an COMPATIBILITY.md or something similar to define the API levels supported and close also #1123 I'm open for ideas. Can you help me with this?

Maybe take a look at this compatibility table for inspiration, simple and it works; and you can also just add this as a headline to the README instead of creating a new .md doc.

@mtrezza
Copy link
Member

mtrezza commented Nov 18, 2021

I'm suggesting this breaking note in the release notes, any additions/changes? Never mind the formatting, it has to be written in 1 line for the changelog auto-generator to pick it up properly.

BREAKING CHANGE: The required minimum API level changes from 16 to 21. The following deprecated methods are removed: Parse.getParseDir() (use getParseCacheDir(String) or getParseFilesDir(String) instead), ParseTwitterUtils.link(ParseUser, Context) (use linkInBackground(Context, ParseUser) instead), ParseTwitterUtils.link(ParseUser, String, String, String, String) (use linkInBackground(ParseUser, String, String, String, String) instead).

@azlekov
Copy link
Contributor Author

azlekov commented Nov 19, 2021

@mtrezza I have added some Compatibility section. It would be great if you check it.

@azlekov azlekov requested a review from mtrezza November 24, 2021 12:52
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

I've made some changes to the compatibility table and moved the API level rules into the CONTRIBUTING doc, as it's more relevant for contributors than for developers. Could you review these changes and let me know if the wording is fine? Then we should be good to merge.

@azlekov
Copy link
Contributor Author

azlekov commented Nov 25, 2021

LGTM

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good to me too!

@mtrezza mtrezza changed the title feat: update project dependencies and refactor the code feat: update project dependencies and code refactoring Nov 25, 2021
@mtrezza mtrezza merged commit 38d2ebb into parse-community:master Nov 25, 2021
parseplatformorg pushed a commit that referenced this pull request Nov 25, 2021
# [2.2.0](2.1.0...2.2.0) (2021-11-25)

### Features

* update project dependencies and code refactoring ([#1141](#1141)) ([38d2ebb](38d2ebb))
@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 25, 2021
@azlekov azlekov deleted the keep-dependencies-up-to-date branch November 25, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outdated dependencies and using of deprecated code
3 participants