wearerequired / traduttore

🗼 A WordPress plugin to improve the I18N workflow for your own projects based on @GlotPress.
https://wearerequired.github.io/traduttore/
72 stars 12 forks source link

The Big 3.0 Update 💥 #70

Closed swissspidy closed 6 years ago

swissspidy commented 6 years ago

This is a first pass at making Traduttore way more flexible and working for (almost) all sorts of source code repositories.

I got a bit carried away during implementation, so this contains a lot of changes—but I think they're worth it.

Here's a breakdown:

Things I still need to do (any help appreciated):

Fixes #64, #65, #66, #73.

swissspidy commented 6 years ago

The current WIP includes docs for setting up private GitLab repositories.

I think we should try to automate this though, see #57.

swissspidy commented 6 years ago

Made some changes:

When receiving a webhook, the following information about the repository is now stored in project meta:

This way when trying to clone a repository and update translations, we don't have to check for visibility again (no extra HTTP request), plus we know the repo type even for self-hosted repositories because of the webhook.

Only if no webhook was received you do have to hook into the filters to manually set the repo type or something.

However, with #57 we could mitigate this. Plus with these changes here we'd already have the storage mechanism for such a new settings field.

swissspidy commented 6 years ago

Linting is failing because PHPCS apparently doesn't pick up @inheritdoc... I guess I have to duplicate all affected docs.

swissspidy commented 6 years ago

I guess I really need to copy all docblocks. Ugh.

https://github.com/squizlabs/PHP_CodeSniffer/pull/214 https://github.com/squizlabs/PHP_CodeSniffer/pull/1846

codecov-io commented 6 years ago

Codecov Report

Merging #70 into master will increase coverage by 1.14%. The diff coverage is 76.64%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #70      +/-   ##
============================================
+ Coverage     67.93%   69.08%   +1.14%     
- Complexity      189      338     +149     
============================================
  Files            17       26       +9     
  Lines           499      828     +329     
============================================
+ Hits            339      572     +233     
- Misses          160      256      +96
Impacted Files Coverage Δ Complexity Δ
inc/Loader/Git.php 0% <0%> (-92.69%) 7 <0> (-6)
inc/CLI/CacheCommand.php 0% <0%> (ø) 5 <5> (+1) :arrow_up:
inc/Loader/Subversion.php 0% <0%> (ø) 11 <11> (?)
inc/CLI/UpdateCommand.php 0% <0%> (ø) 6 <0> (+1) :arrow_up:
inc/ZipProvider.php 87.34% <0%> (-7.18%) 25 <2> (+2)
inc/Loader/Mercurial.php 0% <0%> (ø) 7 <7> (?)
inc/WebhookHandlerFactory.php 100% <100%> (ø) 5 <5> (?)
inc/LoaderFactory.php 100% <100%> (ø) 4 <4> (-1) :arrow_down:
inc/Updater.php 94.73% <100%> (+0.61%) 22 <2> (+2) :arrow_up:
inc/Loader/Base.php 100% <100%> (ø) 2 <2> (?)
... and 26 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 c0855ad...0ca812a. Read the comment docs.

swissspidy commented 6 years ago

Updated the description to give a better picture of the changes this involves.

@grappler @ocean90 If you don't mind giving some feedback, any help is appreciated.

I know some people are eagerly waiting for GitLab support, hence the big changes here.