Page MenuHomePhabricator

Add support for reading new file schema in MediaModeration
Closed, ResolvedPublic2 Estimated Story Points

Description

See parent task T28741 for more details.

This task is to track progress of updating the MediaModeration extension to support reading the new file schema (which is described in T28741 in the 'Approved changes' section). The schema migration configuration that is controlling this is wgFileSchemaMigrationStage

We need to have this ready by March per T383496#10452849.

Acceptance criteria
  • The MediaModeration extension works the same when wgFileSchemaMigrationStage is set to SCHEMA_COMPAT_READ_NEW or SCHEMA_COMPAT_READ_OLD
  • The MediaModeration extension tests pass when wgFileSchemaMigrationStage is set to SCHEMA_COMPAT_READ_NEW

Event Timeline

Dreamy_Jazz changed the task status from Open to Stalled.Jan 20 2025, 4:43 PM
Dreamy_Jazz removed Dreamy_Jazz as the assignee of this task.

Work on this cannot proceed until MediaWiki core is updated to support reading new in the FileSelectQueryBuilder because apart from test code we don't usually interact with the file tables without using that query builder.

Therefore marking this as stalled and moving back to the sprint backlog.

A patch does exist for supporting FileSelectQueryBuilder, but that patch is now blocked on tests from this extension. Upgrading the tests should help avoid this.

Dreamy_Jazz changed the task status from Stalled to Open.Jan 21 2025, 2:22 PM

Change #1113160 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Update tests to support file schema migration

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

Change #1113160 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Update tests to support file schema migration

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

Change #1113526 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] [WIP] De-duplicate inserts to image, oldimage, and filearchive for tests

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

Dreamy_Jazz set the point value for this task to 3.
Dreamy_Jazz changed the point value for this task from 3 to 2.

Change #1113819 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Insert mock file rows once per class in integration tests

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

Change #1113526 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] De-duplicate inserts to image, oldimage, and filearchive for tests

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

Change #1113836 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Update InsertMockFileDataTrait to also insert to new schema

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

Change #1113837 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/MediaModeration@master] Update remaining MediaModeration tests to insert to new file schema

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

Change #1113819 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Insert mock file rows once per class in integration tests

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

Change #1113836 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Update InsertMockFileDataTrait to also insert to new schema

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

Change #1113837 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Update remaining MediaModeration tests to insert to new file schema

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

For QA I would suggest ignoring the second acceptance criteria as that is verified through the PHPUnit tests passing.

To verify the first step I would suggest using the QA steps I detailed at T354408#9460927, doing this once with $wgFileSchemaMigrationStage = SCHEMA_COMPAT_OLD; set and then once with $wgFileSchemaMigrationStage = SCHEMA_COMPAT_NEW; set. You should see no difference in the results of the steps depending on the value of $wgFileSchemaMigrationStage.

Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected... Thank you for the QA Steps @Dreamy_Jazz.
Below is one of the configurations I used for $wgMediaModerationPhotoDNAMockServiceFiles, and then I verified the results of the mediamoderation_scan db table with $wgFileSchemaMigrationStage = SCHEMA_COMPAT_OLD; and then did the same for $wgFileSchemaMigrationStage = SCHEMA_COMPAT_NEW;

image.png (326×591 px, 22 KB)

image.png (413×759 px, 77 KB)