Skip to content

[Modules Restructuring] Restructure Analytics Module - #16744

Merged
ParaskP7 merged 7 commits into
trunkfrom
build/restructure-analytics-module
Jun 16, 2022
Merged

ParaskP7 merged 7 commits into
trunkfrom
build/restructure-analytics-module

Conversation

@ParaskP7

@ParaskP7 ParaskP7 commented Jun 14, 2022 •

Copy link
Copy Markdown
Contributor

Parent #16562
Fixes #16563

This PR restructures the analytics module by disassociating the WordPress-Analytics-Android repo and removing the extra WordPressAnalytics level from it. This effectively makes analytics a pure module, without any extra inner levels or unnecessary build files lying around (like settings.gradle, .gitignore, etc).

PS: @zwarm I added you as the main reviewer, that is, in addition to the @wordpress-mobile/owl-team team itself, since I have been seeing you handling data coverage for WPAndroid for the past few weeks/months, adding/updating track events, etc. As such, I think you might be the best person to sign-off on that change for WPAndroid. 🥇


Question (❓): I wasn't sure about the LICENCE file, which point to MIT and as such I chose to keep it. The root level LICENCE that WPAndroid is using is GPLv2. Should we keep the additional MIT licence or remove it in favor of GPLv2? 🤔


To test:

  • Build the app and install it on your device or emulator.
  • Go to App Settings -> Privacy settings and enable Collect information.
  • Open Logcat and verify that track events are being fired as expected (you can search by 🔵 Tracked: ).

Regression Notes

  1. Potential unintended areas of impact

N/A

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

See To test section above.

  1. What automated tests I added (or what prevented me from doing so)

N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

ParaskP7 added 5 commits June 14, 2022 17:33
This file and its inner properties seem to be unused and/or outdated.
The root level '.gitignore' file should be all that is needed from now
on.
The inner 'build.gradle' file from the 'WordPressAnalytics' module
should be all that is needed from now on.
This change removes all the outdated details from the 'README.md' file
while still preserving the title and short description of what the
module is for.
Everything within the 'WordPressAnalytics' module ('build.gradle' +
'src') is now moved to the new root 'analytics' module.

With this change the new 'analytics' module is effectively and
completely disassociated from the 'WordPress-Analytics-Android' repo.

URL: https://github.com/wordpress-mobile/WordPress-Analytics-Android
@ParaskP7 ParaskP7 added this to the 20.2 milestone Jun 14, 2022
@ParaskP7
ParaskP7 requested review from a team and zwarm June 14, 2022 15:29
@ParaskP7 ParaskP7 self-assigned this Jun 14, 2022
@peril-wordpress-mobile

peril-wordpress-mobile Bot commented Jun 14, 2022 •

Copy link
Copy Markdown

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@wpmobilebot

Copy link
Copy Markdown
Contributor

Found 1 violations:

The PR caused the following dependency changes:

+\--- project :libs:analytics
+     \--- com.automattic:Automattic-Tracks-Android:2.2.0 (*)
-\--- project :libs:analytics:WordPressAnalytics
-     \--- com.automattic:Automattic-Tracks-Android:2.2.0 (*)

Please review and act accordingly

@wpmobilebot

wpmobilebot commented Jun 14, 2022 •

Copy link
Copy Markdown
Contributor
You can test the Jetpack changes on this Pull Request by downloading an installable build (jetpack-installable-build-pr16744-039001f.apk), or scanning this QR code:

@wpmobilebot

wpmobilebot commented Jun 14, 2022 •

Copy link
Copy Markdown
Contributor
You can test the WordPress changes on this Pull Request by downloading an installable build (wordpress-installable-build-pr16744-039001f.apk), or scanning this QR code:

@ParaskP7 ParaskP7 mentioned this pull request Jun 14, 2022
6 of 7 tasks

@oguzkocer oguzkocer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ParaskP7 I left a couple suggestions. Let me know what you think!

Comment thread WordPress/build.gradle
exclude group: 'org.wordpress', module: 'utils'
}
implementation (project(path:':libs:analytics:WordPressAnalytics')) {
implementation (project(path:':libs:analytics')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we use :libs:WordPressAnalytics instead, so it's consistent with :libs:WordPressProcessors, :libs:WordPressAnnotations etc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👋 @oguzkocer and thank you so much for the suggestion! 🙏

I actually considered that too while doing this change, but I ended up in favor of the plain analytics naming instead of WordPressAnalytics for the below two main reasons:

  1. We are already in the context of the WordPress repo, as such, having to add the WordPress prefix to every module seems unnecessary.
  2. This repo, in addition to the WordPress app is also building the Jetpack app. As such, it might be better to remove the word WordPress from every module so that to avoid any Jetpack related naming confusion.

To that end, I was thinking to also rename the WordPressProcessors and WordPressAnnotations modules to plain processors and annotations in order to have every module naming consistent from now on.

In the end, I am planning to end up with the below module names:

  • analytics (from WordPressAnalytics)
  • editor (from WordPressEditor)
  • editor-example (from editor/example)
  • image-editor (from ImageEditor)
  • mocks (from WordPressMocks)
  • networking (from WordPressNetworking)
  • annotations (from WordPressAnnotations)
  • processors (from WordPressProcessors)

Let me know what you think. 🤔 🙇

PS: You will also notice the editor-example:

  • I also want to have it build and be part of our active modules as it is currently not.
  • I am thinking of moving it up to the same level as every other module for now, just for simplicity sake and until we figure out how modularization and the organization of it would look like as we progress forward with the main modularization project (TBD).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good to me. As long as we are consistent, I don't mind either naming and your reasoning makes sense to me for going with the shorter version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great, yes, consistency matters, thanks for giving me the 👍 on it @oguzkocer ! 🙇

Comment thread libs/analytics/README.md Outdated
```shell
$ ./gradlew assemble publishToMavenLocal bintrayUpload -PbintrayUser=FIXME -PbintrayKey=FIXME -PdryRun=false
```
Library for handling Analytics tracking.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not a library anymore. I vote for removing the README alltogether, but if we are keeping, I think we should call it a module instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👋 @oguzkocer and thanks!

I was thinking the same, I was in favor of removing this README.md file altogether too. The only reason that I kept that there is in case we might want to have a README.md, file per module, just as a general rule, so that to allow engineers to contribute to it by describing what the module does, why it is needed or any other FAQ.

...but if we are keeping, I think we should call it a module instead.

💯 Let me know what you think of the above and if you still think we should remove the README.md anyway I'll just remove it. Else, I'll just rename Library to Module, good call. 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't feel strongly about having a README or not. Now that you renamed Library to Module, it's all good from my side 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great, thank you @oguzkocer ! 🙇

PS: I'll keep the basic structure of the README for now (title + short description), add that to every module as I will be progressing with this restructuring, that is, if such file is missing, and maybe come back to it later by adding some more details on them, most probably with some additional help from WP engineers!

@zwarm

zwarm commented Jun 15, 2022

Copy link
Copy Markdown
Contributor

@ParaskP7 🥳
I installed and spot tested both Jetpack and WP debug builds against play store builds. Events are tracking as expected. Nice work. 👍

@zwarm zwarm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Form a testing perspective, all is working as expected. Thanks!

@oguzkocer oguzkocer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the follow up comments @ParaskP7. Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modules Restructuring - Analytics Module

4 participants