Page MenuHomePhabricator

Create a service that creates LocalFile and ArchivedFile objects for files that have a given SHA-1
Closed, ResolvedPublic2 Estimated Story Points

Description

A service is needed that given a SHA-1 returns all matching rows in the image, oldimage, and filearchive as as LocalFile or ArchivedFile objects up to a certain limit and potentially grouped by filename.

The service needs to return all the images so that if one of the image objects cannot be rendered or does not have a thumbnail, another object can be attempted. The number of objects returned will be limited, as quarry queries ran in T351416: [S] Explore how many rows in the file tables have duplicated SHA-1 values on WMF wikis determined that some SHA-1 values have thousands of rows and filenames. Creating too many objects could unnecessarily use memory.

Acceptance criteria
  • A service that meets the requirements above is created
  • This service be fully tested

Related Objects

StatusSubtypeAssignedTask
ResolvedDreamy_Jazz
OpenNone
OpenNone
DuplicateNone
Resolvedkostajh
ResolvedNone
ResolvedTchanders
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
DeclinedPRODUCTION ERRORNone
ResolvedTchanders
ResolvedDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedNone
ResolvedDreamy_Jazz
Resolvedkostajh
Resolvedkostajh
ResolvedSTran
Resolvedkostajh
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz

Event Timeline

Dreamy_Jazz set the point value for this task to 2.Nov 20 2023, 4:42 PM

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

[mediawiki/extensions/MediaModeration@master] [Very WIP] Add MediaModerationFileFactory

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

Change 979434 merged by jenkins-bot:

[mediawiki/extensions/MediaModeration@master] Add MediaModerationFileFactory and MediaModerationFileLookup

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

Similar to {T351417], the services added in this ticket are unused and so there is no easy way to QA this ticket. I would suggest, similar to T351417, that QA be done through T351399: Create a maintenance script to automatically scan files listed in mediamoderation_scan where these services will be used to implement the maintenance script. Moving to QA for QA Engineers to decide either way.

Djackson-ctr subscribed.

I concur with Dreamy_Jazz's comment regarding QA and therefore am pushing this ticket to Done.