Page MenuHomePhabricator

ExtractORM from MediaWiki core and move to the EducationProgram extension
Closed, ResolvedPublic

Description

It doesn't really have any benefit being in core; it's used by a few extensions though used by WMF. Wikidata are in the process of removing it's usage, so it would be easier to just put it straight into EducationProgram, as it has some MW dedpendancies

See also:

Event Timeline

Reedy raised the priority of this task from to Needs Triage.
Reedy updated the task description. (Show Details)
Reedy added subscribers: Reedy, JeroenDeDauw.

At first glance I though this was about moving out MediaWikis DB abstraction from core, which would be fantastic. Then I realized this is presumably about the worst implementation of active record that was created by me and ended up in core. I'd just deprecate the whole thing and migrate away from it. That is no objection against moving it out of core though.

Aklapper renamed this task from Extract ORM from MediaWiki core to Extract/Remove ORM from MediaWiki core and move to Vendor repo.Oct 4 2015, 9:35 AM
Aklapper set Security to None.

At first glance I though this was about moving out MediaWikis DB abstraction from core, which would be fantastic. Then I realized this is presumably about the worst implementation of active record that was created by me and ended up in core. I'd just deprecate the whole thing and migrate away from it. That is no objection against moving it out of core though.

I believe there was a discussion (RfC maybe?) about moving some of the DB support from core (namely mostly unsupported DB types), which although solves some of the problem, doesn't do it completely.

That aside, the main question(s) about the ORM layer is how many extensions are using it? And how much work would it be to remove it from said extensions? We can certainly deprecate and extract it from core (updating the composer.json for any relevant extensions to save breaking them), but I suspect there's quite a bit of work to be able to fully remove it.

I'll try and get an answer for the first question in the next couple of days when I have access to PhpStorm and all the extension repos (or if I work out what to easily grep for)

I believe there was a discussion (RfC maybe?) about moving some of the DB support from core (namely mostly unsupported DB types), which although solves some of the problem, doesn't do it completely.

Yeah there is. And yeah, that in itself does not allow for code that should not depend on MediaWiki to use the MediaWiki databse abstraction.

EducationProgram and Wikidata/Wikibase seem to be the only real users of this code

So, it wants extracting from core into a separate repo. Adding to the WMF vendor repo (for extension purposes), and then said repo wants adding as a dependancy via composer to EducationProgram and Wikidata/Wikibase

There's also the API module to go with it too

Unless I am forgetting something, I think the only places in Wikibase (and core) that use ORM are the sites table and wb_changes table. imho, sites should move away from using a database backend altogether. (the sites information is config and should be stored in a config file)

wb_changes should move away from ORM

we have tickets for both of these, but i don't have time right now / am too lazy to find them now :)

I don't know about education program, but also thought folks were working on something new there.

that said, if someone wants to maintain the ORM code as a library, then fine with me

Those are also the 3 places I'm aware of, and I agree they all those move away from using this code. If the sites stuff and Wikibase do this, then you could move the ORM code to the EP extension.

Jumping in for the education team. We have many programs that are dependent on the education program extension (however flawed it may be) on over a dozen Wikimedia projects, so I would ask that nothing be removed that would cause the extension to fail. It is unclear what is proposed since I don't have a strong technical background. Could someone explain in plain English what is proposed and how it would impact our extension, as well as the urgency for making any changes?

As mentioned in other comments here and elsewhere, there is a hope for something newer and better than the current MediaWiki-extensions-EducationProgram, but that is at least a year off AFAIK. We have no engineering resources to even begin building something or adapting the WikiEd Foundation's dashboard for our global stakeholders.

Copying my colleagues to this thread who may have more context.

Jumping in for the education team. We have many programs that are dependent on the education program extension (however flawed it may be) on over a dozen Wikimedia projects, so I would ask that nothing be removed that would cause the extension to fail. It is unclear what is proposed since I don't have a strong technical background. Could someone explain in plain English what is proposed and how it would impact our extension, as well as the urgency for making any changes?

As mentioned in other comments here and elsewhere, there is a hope for something newer and better than the current MediaWiki-extensions-EducationProgram, but that is at least a year off AFAIK. We have no engineering resources to even begin building something or adapting the WikiEd Foundation's dashboard for our global stakeholders.

Copying my colleagues to this thread who may have more context.

We're not going to break anything (not purposely anyway). There will be a few minor changes in the Education Program extension, but we will make sure it keeps working.

We're just moving an amount of code from core MediaWiki and putting it elsewhere.

FYI, we have been doing these sorts of changes to MediaWiki for a while, moving out "reuseable" code etc

Change 243945 had a related patch set uploaded (by Reedy):
[WIP] Remove ORM code from core

https://gerrit.wikimedia.org/r/243945

16:05:52 Fatal error: Class undefined: ORMTable in /mnt/jenkins-workspace/workspace/mediawiki-phpunit-hhvm/src/includes/site/DBSiteStore.php on line 346

DAMN IT

Change 243966 had a related patch set uploaded (by Anomie):
Remove ORM use from DBSiteStore

https://gerrit.wikimedia.org/r/243966

Suggestions for a repo name? :D

Change 243966 merged by jenkins-bot:
Remove ORM use from DBSiteStore

https://gerrit.wikimedia.org/r/243966

Reedy renamed this task from Extract/Remove ORM from MediaWiki core and move to Vendor repo to ExtractORM from MediaWiki core and move to the EducationProgram extension.Oct 6 2015, 9:36 PM
Reedy updated the task description. (Show Details)
daniel subscribed.

This is blocked by Wikibase still depending on ORMTable in one place. @hoo is working on getting rid of that.

Change 246706 had a related patch set uploaded (by Reedy):
Remove unused ApiQueryORM

https://gerrit.wikimedia.org/r/246706

Change 246706 merged by jenkins-bot:
Remove unused ApiQueryORM

https://gerrit.wikimedia.org/r/246706

Ok, so https://gerrit.wikimedia.org/r/#/c/246718/ is ready to go... Unit tests are passing.

Can someone familiar with the EP extension test the patch? It should work... There's code still in core, ie https://gerrit.wikimedia.org/r/#/c/243945/ but it shouldn't make any difference...

The core stuff will need to stay around until it's not needed by Wikidata/Wikibase... Shouldn't be long though :)

Commit to core needs merging first. Then rebase/re-run the tests for EP after that, confirm that it's still ok, then merge it before the core patch is deployed to WMF wikis :)

Change 246718 had a related patch set uploaded (by BryanDavis):
Move ORM classes to EducationProgram extension

https://gerrit.wikimedia.org/r/246718

Change 243945 merged by jenkins-bot:
Remove ORM code from core

https://gerrit.wikimedia.org/r/243945

Change 246718 merged by jenkins-bot:
Move ORM classes to EducationProgram extension

https://gerrit.wikimedia.org/r/246718

Reedy claimed this task.