Skip to content

Conversation

@dbrant
Copy link
Collaborator

@dbrant dbrant commented Mar 17, 2019

This kicks off the process of integrating with our new Library that contains common code between the Wikipedia and Commons apps.

This set of commits does not yet integrate the networking layer of the library, but rather with the utility methods included with the library, and removes the redundant utilities found in the Commons app code.

@codecov-io
Copy link

codecov-io commented Mar 17, 2019

Codecov Report

Merging #2642 into backend-overhaul will decrease coverage by 0.36%.
The diff coverage is 0%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           backend-overhaul   #2642      +/-   ##
===================================================
- Coverage              2.75%   2.38%   -0.37%     
===================================================
  Files                   260     240      -20     
  Lines                 12437   12052     -385     
  Branches               1125    1106      -19     
===================================================
- Hits                    343     288      -55     
+ Misses                12067   11740     -327     
+ Partials                 27      24       -3
Impacted Files Coverage Δ
.../java/fr/free/nrw/commons/auth/SessionManager.java 0% <ø> (ø) ⬆️
...n/java/fr/free/nrw/commons/CommonsApplication.java 0% <0%> (ø) ⬆️
...a/fr/free/nrw/commons/OkHttpConnectionFactory.java 0% <0%> (ø)
...va/fr/free/nrw/commons/campaigns/CampaignView.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/WelcomePagerAdapter.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/di/NetworkingModule.java 0% <0%> (ø) ⬆️
...r/free/nrw/commons/contributions/Contribution.java 0.88% <0%> (ø) ⬆️
...ava/fr/free/nrw/commons/upload/UploadActivity.java 0% <0%> (ø) ⬆️
...n/java/fr/free/nrw/commons/MediaDataExtractor.java 0% <0%> (ø) ⬆️
.../free/nrw/commons/category/CategoryImageUtils.java 0% <0%> (ø) ⬆️
... and 28 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 ee7af37...6680518. Read the comment docs.

import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;

public final class OkHttpConnectionFactory {
Copy link
Contributor

Choose a reason for hiding this comment

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

We do have a provider for getting http client in NetworkingModule:provideOkHttpClient. It could be modified to add additional interceptors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool, I will de-duplicate things as I go along.

@maskaravivek
Copy link
Contributor

@dbrant Thanks for helping with the initial library integration. It would be great if you could include one MediaWiki API usage so that we can easily take it forward. :)

@dbrant
Copy link
Collaborator Author

dbrant commented Mar 17, 2019

@maskaravivek I'm very far from done. Stay tuned.

@misaochan
Copy link
Member

Should we use a separate development branch for this, and merge periodically into master?

@dbrant
Copy link
Collaborator Author

dbrant commented Mar 18, 2019

Sure, can it be this branch? Or is there a different procedure for that?

@misaochan
Copy link
Member

I just made https://github.com/commons-app/apps-android-commons/tree/backend-overhaul from master. If you could rebase and resubmit the PR to that branch, that would be great. :)

This was being used in some slightly incorrect/unexpected ways.
@dbrant dbrant changed the base branch from master to backend-overhaul March 18, 2019 19:38
@dbrant
Copy link
Collaborator Author

dbrant commented Mar 18, 2019

I've changed the base of this PR to be the backend-overhaul branch. There didn't seem to be any conflicts.

@misaochan
Copy link
Member

Thanks @dbrant . Do let us know when it's ready for review. :)

@vanshikaarora
Copy link
Contributor

Hello @dbrant I have merged by current branch with your branch. For solving Issue #2068.
Gradle successfully synced with
implementation 'com.dmitrybrant:wikimedia-android-data-client:0.0.8'

yet it can't recognise the import statement:
import org.wikipedia.edit.EditClient;

Can you please help? :)

@dbrant
Copy link
Collaborator Author

dbrant commented Mar 21, 2019

@vanshikaarora The EditClient class is not yet public (it's currently package-private). In my next version I can make it public, but I should say that the internals of this library are not quite ready for prime-time yet. Stay tuned while this branch gets ironed out, and I solidify the library to match all the requirements of Commons.

@vanshikaarora
Copy link
Contributor

but I should say that the internals of this library are not quite ready for prime-time yet.Stay tuned while this branch gets ironed out,

OK thanks :). I'll wait till then 👍

@dbrant
Copy link
Collaborator Author

dbrant commented Mar 21, 2019

@misaochan Actually this can be reviewable now. It would probably be good to perform the overhaul as a series of small(er) PRs, and also keep merging the latest updates from master into this branch, as well.

Copy link
Contributor

@maskaravivek maskaravivek 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.

@misaochan
Copy link
Member

Looks good to me, thanks @dbrant !

@misaochan misaochan merged commit 619b7a1 into commons-app:backend-overhaul Mar 22, 2019
maskaravivek added a commit that referenced this pull request Apr 2, 2019
* Beginnings of integration with Wikipedia client library. (#2642)

* Remove remaining unnecessary API version check.

* Roll up sleeves.

* Add and integrate the beginnings of app adapter.

* Remove vestigial event logging logic.

Event logging is no longer used in this app.

* Beginnings: remove StringUtils and associated redundancies.

* Remove redundant capitalize() method.

* Remove redundant urlEncode() method.

* Remove redundant (and incomplete) language lists.

* Remove redundant usages of SimpleDateFormat.

* Remove redundant json type adapter.

* Remove redundant MW error model classes.

* Rip out redundant MW model classes.

* Pass SessionManager into AppAdapter instead of injecting.

* Wire up more of the AppAdapter.

* Remove redundant Gson initialization and type adapters.

* Rip out PageTitle.

This was being used in some slightly incorrect/unexpected ways.

* Don't need static WikiSite.

* Bump data client library version

* Bump library version and fix build

* Fix tests

* Fix build

* Fix media of the day

* With fixes in recently modified APIs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants