Page MenuHomePhabricator

OnThisDay endpoint skips AD years
Closed, ResolvedPublic

Description

The first entry on https://en.wikipedia.org/api/rest_v1/page/html/June_26 is from the year "4 AD". The onthisday endpoint skips this since "4 AD" is not recognized as a year based on the regex:

yearListElementRegEx : /^\s*(\d+)\s*(bce?)?\s*–\s(.+)/i

Complicating this is that (bce?) in the regex (the 2nd group is used the determine if the year is negative, and the third group is used to get the remaining text (in all languages). In the AD case the year should still be positive.

Expected result

The entry for the year 4 AD is included.

Actual result

The entry for the year 4 AD is not included.

Details

Related Gerrit Patches:
mediawiki/services/mobileapps : masteronthisday: Recognize 4 AD as a year on enwiki

Event Timeline

bearND created this task.Jul 11 2017, 3:54 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
bearND claimed this task.Jul 11 2017, 3:55 AM
bearND triaged this task as Medium priority.
bearND moved this task from Needs triage to Kanban on the Product-Infrastructure-Team-Backlog board.
bearND moved this task from To Do to Doing on the Product-Infrastructure-Team-Backlog (Kanban) board.

Change 364361 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] onthisday: Recognize 4 AD as a year on enwiki

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

Change 364361 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] onthisday: Recognize 4 AD as a year on enwiki

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

Stashbot added a subscriber: Stashbot.

Mentioned in SAL (#wikimedia-operations) [2017-07-12T20:11:00Z] <bsitzmann@tin> Started deploy [mobileapps/deploy@3f90bf1]: Update mobileapps to d30dae2 (T169930, T170225)

Mentioned in SAL (#wikimedia-operations) [2017-07-12T20:16:00Z] <bsitzmann@tin> Finished deploy [mobileapps/deploy@3f90bf1]: Update mobileapps to d30dae2 (T169930, T170225) (duration: 05m 00s)

bearND closed this task as Resolved.Jul 12 2017, 8:18 PM