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
The Big Kahuna re-factoring #10
Conversation
mwjames
commented
Feb 9, 2014
- Split responsibilties
- Clean-up invocation
- Use appropriate service registration
- Added PropertyRegistryTest and PredefinedPropertyAnnotatorTest
- Moved Exif handling in its own class
- Moved ShortUrl handling in its own class
Travis needs to be setup correctly
|
I have not made any attempt to clean-up some general design issues (this is for someone else to figure out and clean-up) |
@SemanticMediaWiki/testers @rotsee please feel free to test. Functionality have not been altered (as far as I know) but in order to prove this its needs testing. Classes have been re-factored in such a way that is possible to do constructor injection, eliminate the use of GLOBALS and it introduces the "smallest" DI container available which amounts to the possibility to run proper unit tests. As far as I'm concerned, I see SESP as a case study (that's why I did the re-factoring) so other SMW related extensions can see how to setup Travis, use phpunit and regression tests to ensure that if something changes in core it can (or should) be detected by the extension when running those tests. |
@mwjames Does this really require 1.9.1, as in, 1.9.0 will not work? If so, then we are not doing the SMW releases properly. There should be no compat changes in minor releases. |
I didn't delete the SESP.php file as people might want to poke and compare before and after but it should eventually vanish. |
Code definitely looks better then before now :) |
Adds |
Just wanted to dive into testing but got an error while doing the data refresh My SES configuration:
|
I just copied over the setting from the README which obviously has a typo. Just tried and everything seems fluffy. Now doing some testing and will build up some data for the new concept cache script. |
pageId vs. revisionIdI realized an obvious blunder in the original SESP [0]. It stores the pageId ( This needs to be addressed in the docs. IdentifierThe next PR stops with the mumbo jumbo of assigning double meaning to a single identifier. Currently [0] https://github.com/SemanticMediaWiki/SemanticExtraSpecialProperties/blob/master/src/SESP.php#L138 |
95cc2b4 now creates the tables when setting About pageId vs. revisionId: Shouldn't is be rectified and have a |
Already added a |
Ah, this tiny "Some clean-up". :) Breaking but better! Thanks for this great work! |
Jep, now also getting the pageid, exifsoftware and exifdatetime tables. Did not bother to add mimetype and mediatype. Working like charm I still need to add the I18n though. |
Just discovered an "issue": |
Whoa! |
@mwjames can you poke me when this is ready for review? |
I haven't changed to logic which means that this was probably broken before. git.wikimedia.orgI just had a look at git.wikimedia.org-SemanticExtraSpecialProperties which shows a rather larger differences (the next time this happens argh... I will sent some github-忍者 ) especially with the 'EXIFDATA' implementation therefore I will once again make a PR (this will be the last) which implements the already existing The PR will not implement the remaining All @kghbln Probably the git.wikimedia.org and github.com i18n version may show some differences. @s7eph4n Maybe of interest |
No worries about the @JeroenDeDauw Prior to moving the code over to wikimedia I will copy over the I18n to GiHub to save the translator's effort. I guess this is how it should be done best. @mwjames I am not sure where the messages for the new special properties ended up. Adding these to the I18n can be done later. When it comes to "exposure time" and "software" and possible new implementations the name should proably be "exposure time from Exif data" etc. to avoid property naming collisions. Since the new version will be breaking anyway ... |
I think that all the Speaking of which, after I looked at possible
Any additional Identifiers such as |
I see. Looks like a good option to retrieve the names for the properties existing translations for core. So there is absolute consistency about them. I am not sure if this will avoid property name collision but it may be a matter of just documenting in the README that these names are taboo if you want to activate properties regarding "exif" information. Consistency would take precedence over collision which is ok in this case. Just installed the new version and identified two issues. Neither "exif software" nor "exif datetime" are stored, i.e. vanished even though the configuration in LocalSettings.php did not change. Same applies to "ntrev". All other special properties are still there including "rev". As far as I see the configuration did not change. |
Since those are now stored within a subobject, As for the fixed tables, only |
Yay, that's utterly cool! Now I get it. Just added Since we are now talking about subobjects we can forget about the name collision. Are there any further blockers? I do not see any. Are we ready to poke for review? |
The implementation now comes close to the features that were available on the git.wikimedia.org version (the 30+ exif properties are not included in the json file and if someone wants to tackle this, feel free). I'm now reasonably satisfied. It runs (35 tests, 68 assertions) which should roughly account for 70% coverage and scrutinizer is pushed from 5 to 8.4.
@kghbln I think we are good to go. @JeroenDeDauw made the last sprint |
I just created pull request #13 to sync with the translations provided by twn. Hopefully all of this can be mashed together somehow by @JeroenDeDauw |
So the docu is now nitpicked with #15 and fluffy. Ready to merge and release? |
- Split responsibilties - Clean-up invocation - Use appropriate service registration - Added PropertyRegistryTest and PredefinedPropertyAnnotatorTest - Moved Exif handling in its own class - Moved ShortUrl handling in its own class
Added _NREV test to show case how to use DBConnection injection
Relates to issue #12
Introduce $sespUseAsFixedTables to enable the use of fixed tables as each of the properties are high volume targets by being potentially included for each page. If $sespUseAsFixedTables = true then update.php + SMW_refresh.php needs to be executed.
This only verifies that the invoked hook works in accordance within its specification.
The Big Kahuna re-factoring
👍 |