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

[Toolkit Cleanup] Yard doc: step 2 – rename module Helpers -> Helper #199

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Feb 1, 2021

This PR sits on top of #198 and simply renames the module Helpers into module Helper for consistency both in code and in the generated documentation.

⚠️ This PR is ready for review but PLEASE DO NOT MERGE it yourself. Once it's approved I will take care of merging it as it should only be merged after #198 is itself merged.

Why?

  • In fastlane's own source code, the helpers live inside Fastlane::Helper (singular).
  • In our codebase, some helpers are named under Fastlane::Helper but others are named Fastlane::Helpers.

This discrepancy makes the code inconsistent but also makes the YARD documentation incoherent, by splitting some modules and helpers in one module and other helpers in another.

How?

This is mainly a "Find & Replace All" on the codebase for module Helpers and Fastlane::Helpers to its singular form instead. I made it a dedicated PR for easier review because it touches many files and already makes quite a big diff all by itself.

To Test

  • Review the code changes
  • Run bundle install && bundle exec rspec to run the existing tests and ensure they still compile and pass
  • Optionally you could try running a couple of actions (bundle exec fastlane run <action_name> to ensure that they still work, though be careful about potential side effects triggered by those actions (we wouldn't want to cut a release or push a new beta unexpectedly)
  • Run bundle exec yard doc to generate the documentation. Open yard-doc/index.html in your browser and ensure that the modules and helpers are consistently classified under a common Fastlane > Helper hierarchy

@AliSoftware AliSoftware requested review from a team, oguzkocer, jkmassel and loremattei and removed request for a team February 1, 2021 15:28
@AliSoftware AliSoftware self-assigned this Feb 1, 2021
@AliSoftware AliSoftware changed the title rename module Helpers -> Helper [Toolkit Cleanup] Yard doc: step 2 – rename module Helpers -> Helper Feb 1, 2021
@AliSoftware
Copy link
Contributor Author

⚠️ This PR is ready for review but PLEASE DO NOT MERGE it yourself. Once it's approved I will take care of merging it as it should only be merged after #198 is itself merged.

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

This is a very nice alignment change. Review notes:

✅ Review the code changes [ they were very boring and exactly what I expected]
✅ [...] Run the existing tests and ensure they still compile and pass
✅ Run bundle exec yard doc to generate the documentation. Open yard-doc/index.html in your browser and ensure that the modules and helpers are consistently classified under a common Fastlane > Helper hierarchy. [they were, and this does make it significantly nicer]

I didn't run any lanes, as I have confidence that this change works well – I instead used rg helpers && rg Helpers to try to find any unresolved instances of this. All that came back were comments and files in the .xcproject for drawText.

One thing to note – we'll likely need to update WPAndroid for this, as it contains calls to these helpers (though AFAICT only its own local copies – the Fastfile doesn't seem to reference them, so it might just be possible to delete the helpers directory from that project altogether – just noting it here because we should take special care when bringing this update to that project).

Copy link
Contributor

@loremattei loremattei left a comment

Choose a reason for hiding this comment

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

LGTM!
I double checked that there are no remaining instances of Helpers in the project.

@jkmassel raised a very good point about WPAndroid. I'd say it's a good time to remove all the local instances and pull everything in the toolkit. IIRC, for the most part we can just get rid of the local instances and call the toolkit equivalent without any other chance.

@AliSoftware
Copy link
Contributor Author

That's a good point. I'll definitively try to get rid of the versions in WPAndroid.

Unfortunately quickly diff-ing between WordPress-Android/fastlane/helper/android_*_helper.rb and release-toolkit/…/helper/android/*_helper.rb files I can see the diff is quite not empty and some changes in code are substantial, so I'll have to take some time to compare them and to ensure the code is supposed to behave the same (hopefully with the one in release-toolkit being more modern/recent) before blindly deleting the one in WPAndroid.
Also deleting the local helpers will mean either also immediately deleting the local actions in WPAndroid repo too (so, will need to diff and compare them point by point with the release-toolkit ones too first, as with helpers), or to first modify the local actions to call the release-toolkit helpers as a first step, before deleting the local actions as a second, iterative step.

So might not be as trivial / immediate (I mean I could also just blindly delete the local actions and helpers, sacrifice a lamb and pray that using the release-toolkit ones will behave the same… but I prefer to be safe than sorry 😅, even if that means taking more time to double-check). But definitively on my roadmap for sure.

Base automatically changed from yard-doc/step1 to toolkit-cleanup February 2, 2021 17:44
@AliSoftware
Copy link
Contributor Author

AliSoftware commented Feb 2, 2021

WPAndroid local helpers and actions removal tracked in #204

@AliSoftware AliSoftware merged commit 57ca5ca into toolkit-cleanup Feb 2, 2021
@AliSoftware AliSoftware deleted the yard-doc/step2 branch February 2, 2021 17:50
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.

3 participants