Page MenuHomePhabricator

tstarling (Tim Starling)
UserAdministrator

Projects (19)

Today

  • Clear sailing ahead.

Tomorrow

  • Clear sailing ahead.

Thursday

  • Clear sailing ahead.

User Details

User Since
Oct 15 2014, 8:27 PM (247 w, 5 d)
Roles
Administrator
Availability
Available
LDAP User
Tim Starling
MediaWiki User
Tim Starling (WMF) [ Global Accounts ]

Recent Activity

Yesterday

tstarling added a comment to T226598: REST API i18n.

The current situation is that any messages which are output as raw HTML need to be added to $wgRawHtmlMessages, a very short list at present. That's not what I assumed when @Anomie said that <var> etc. are essential in help text. It's not too bad for security, although a caller can shoot itself in the foot if it tries hard enough. There are actually four formats: in addition to plain text, HTML and wikitext, we also have filtered HTML, for example the api-help-title message is sent into OutputPage::setPageTitle() which calls Sanitizer::removeHTMLtags(). If all messages accessed via a MessageFormatter instance are the same source format, then they can all use the same sanitization, removing the need to expose different formatting methods. The source format can just be passed to the MessageFormatter constructor.

Mon, Jul 15, 10:56 AM · Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2)), Services (watching)
tstarling added a comment to T226598: REST API i18n.

If a handler throws a LocalizedHttpException, what JSON should be provided? Should the message parameters be included in the response, along with their types? I think any localized text should have the language code attached, for example [ 'message-en' => 'File not found' ].

Mon, Jul 15, 6:28 AM · Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2)), Services (watching)
tstarling added a comment to T226598: REST API i18n.

Something that came up during more detailed design: I think MessageFormatter actually just needs format(), not formatText() and formatHtml(). Message has parse() and escaped(), which conflate declaration of the storage format with a desire for HTML output. Both set HTML output, but parse() assumes wikitext storage and escaped() assumes plain text storage. Similarly, Message::plain() declares a storage format with no preprocessor tags. If we're not exposing the storage format, then they don't really make sense.

Mon, Jul 15, 5:22 AM · Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2)), Services (watching)
tstarling added a comment to T226598: REST API i18n.

I agree with the plan Tim outlined above.
The only thing I'd change is exposing the MessageFormatterFactory to the Handlers. Most handlers shouldn't need it, and those that do should pull it in like any other service they need. I see no reason to make it special.

Mon, Jul 15, 12:56 AM · Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2)), Services (watching)

Fri, Jul 12

tstarling added a comment to T226598: REST API i18n.

As @Anomie says, exceptions were introduced to MediaWiki (by me), and later, Status was introduced to MediaWiki (also by me). I asked on wikitech-l what exceptions should be used for, and the consensus was that they should generally be used only for unexpected errors, such as when the developer has made a mistake, not for cases where the user does something wrong. Nobody supported following Python's model of using exceptions for everything, and making try/catch a routine part of flow control. The convention thus established was that "ordinary" errors should be handled by returning a special value. Status was introduced in response to this. It's only very recently that Daniel has been trying to change this convention by adding try/catch everywhere.

Fri, Jul 12, 5:22 AM · Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2)), Services (watching)

Thu, Jul 11

Volker_E awarded T6845: CAPTCHA doesn't work for people with visual impairments a Heartbreak token.
Thu, Jul 11, 12:11 PM · Security, WCAG-Level-A, Security-Extensions, Design, Accessibility, ConfirmEdit (CAPTCHA extension)

Wed, Jul 10

tstarling moved T226667: Register namespaces in the database from Inbox to Watching on the TechCom board.
Wed, Jul 10, 5:06 AM · TechCom, MediaWiki-General-or-Unknown
tstarling added a comment to T226667: Register namespaces in the database.

Previous tasks related to this subject:

Wed, Jul 10, 5:04 AM · TechCom, MediaWiki-General-or-Unknown
tstarling added a comment to T117279: [EPIC] Core should provide inline diffs as well as side by side (Move InlineDifferenceEngine into core / remove MobileDiff).

I think this should be done. The code looks fine. I see it is in wikidiff2 already, so from a production standpoint this is just the addition of a few lines of wrapper code. It seems like a no-brainer. Why has it been stalled for so long, do you need help with the implementation?

Wed, Jul 10, 4:01 AM · TechCom, MobileFrontend (MobileFrontend Special Pages), Multi-Content-Revisions, Readers-Web-Backlog (Tracking), Technical-Debt (RW-Tech-Debt)
tstarling added a comment to T218362: +2 for Ciencia Al Poder in mediawiki/tools/grabbers.

I endorse this request.

Wed, Jul 10, 3:50 AM · TechCom, Gerrit-Privilege-Requests, Utilities-grabbers
tstarling added a comment to T193049: Make MGChecker maintainer of Extension:LanguageTag & InteractiveBlockMessage.

I endorse this request.

Wed, Jul 10, 3:50 AM · TechCom, Gerrit-Privilege-Requests

Fri, Jun 28

JMinor awarded T6845: CAPTCHA doesn't work for people with visual impairments a Heartbreak token.
Fri, Jun 28, 9:40 PM · Security, WCAG-Level-A, Security-Extensions, Design, Accessibility, ConfirmEdit (CAPTCHA extension)

Wed, Jun 26

tstarling added a comment to T221177: REST route handler extension interface RFC.

So are we going to implement PSR-7 properly? If so, can the task description be updated? If not, could it be explained why we wont be?

Wed, Jun 26, 11:43 PM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T226598: REST API i18n.

Some options:

Wed, Jun 26, 5:57 AM · Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2)), Services (watching)
tstarling created T226598: REST API i18n.
Wed, Jun 26, 3:11 AM · Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2)), Services (watching)

Mon, Jun 24

alanajjar awarded T145952: Reduce password reset spam a Like token.
Mon, Jun 24, 4:50 PM · MediaWiki-User-login-and-signup, MediaWiki-Email
tstarling added a comment to T226325: "Restore Default Settings" design requires significant improvement.

There was originally (beginning in Lee's original prototype) a reset button next to the save button, labeled "Reset preferences", which worked like <input type=reset>, except it was emulated by reloading preferences from the database. In 2009 155ddf6de4a2aa68dcdd8ca7d0f9db21ced4b228 the feature was removed, and instead a link was provided to reset the preferences to the default, with a confirmation page. The placement of the link was the same as the old button.

Mon, Jun 24, 3:52 AM · Design, MediaWiki-User-preferences

Thu, Jun 20

tstarling updated the task description for T224423: Factor user group management out of the User object.
Thu, Jun 20, 9:06 PM · MediaWiki-User-management, Core Platform Team (Decoupling (CDP2))

Jun 13 2019

tstarling added a comment to T224076: wmerrors has no license information.

I think MIT is more compatible with upstream. It's what we used for LuaSandbox.

Jun 13 2019, 11:01 PM · Patch-For-Review, wmerrors, Software-Licensing

Jun 11 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Task description edit reflecting the rename of getAttributes() to getPathParams() as suggested in Gerrit.

Jun 11 2019, 1:13 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated the task description for T221177: REST route handler extension interface RFC.
Jun 11 2019, 1:12 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

Jun 10 2019

tstarling added a comment to T223737: Increase Memory Limit for Scribunto.

Looking at the template in question, the obvious solution is to stop doing that. If that's what it takes to exceed the memory limit, then it's probably set about right. We're talking about a table with 36,000 entries, and there are at least 8 such modules loaded into a typical article. What value is this bringing to the articles?

Jun 10 2019, 12:43 PM · serviceops, Performance-Team (Radar), Performance, Operations, Wikimedia-Site-requests

Jun 7 2019

tstarling created P8596 (An Untitled Masterwork).
Jun 7 2019, 12:56 AM

Jun 6 2019

tstarling added a comment to T224949: Failed to access name from slot_roles using id = 1.

In the scenario of 1.32 code with a non-upgraded 1.31 wiki, I found that page creation actually succeeds. However, it does not write slot_roles to memcached and the DB in the same request. It inserts the slot_roles row during the save transaction, but the cache set is ignored due to the 'pending' flag, which exists to avoid this exact problem. The row is successfully inserted and committed, then on the subsequent GET request, it is loaded from the DB and saved to the cache.

Jun 6 2019, 1:32 AM · MW-1.34-release, Core Platform Team Workboards (Team 3), Multi-Content-Revisions (Reactive), Core Platform Team (MCR), MW-1.33-release, Patch-For-Review, MW-1.32-release, MediaWiki-General-or-Unknown

Jun 5 2019

tstarling added a comment to T224949: Failed to access name from slot_roles using id = 1.

I enabled database query logging during a 1.31 -> 1.32 web upgrade. It shows the database apparently being in autocommit mode when the row is inserted. However, I wasn't able to reproduce the issue.

Jun 5 2019, 4:32 AM · MW-1.34-release, Core Platform Team Workboards (Team 3), Multi-Content-Revisions (Reactive), Core Platform Team (MCR), MW-1.33-release, Patch-For-Review, MW-1.32-release, MediaWiki-General-or-Unknown

Jun 4 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Following negative comments on libraryization from @Anomie and @Tgr above, I'm not planning to split the implementation right now. It can stay in includes/Rest for the initial commit.

Jun 4 2019, 4:30 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 31 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

There are a limited number of available methods and generating a 404 or 405 probably isn't a critical path. We might just run ->match() for every method that has at least one registered path instead of trying to make a separate 405 tree.

May 31 2019, 3:44 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 29 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Task description edit: Handler::outerExecute() -> Router::executeHandler() per CR comment by @Tgr .

May 29 2019, 8:46 PM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated the task description for T221177: REST route handler extension interface RFC.
May 29 2019, 8:46 PM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
Jdforrester-WMF awarded T214998: Remove .m. subdomain, serve mobile and desktop variants through the same URL a Like token.
May 29 2019, 6:54 PM · TechCom-RFC, Readers-Web-Backlog (Tracking), Traffic, Operations, MobileFrontend
tstarling added a comment to T221177: REST route handler extension interface RFC.

How do you envision the urls relative to the root? For instance, will this be:

  1. https://en.wikipedia.org/rest.php/user/{userName}/hello (requires no changes to Apache's config)
May 29 2019, 5:21 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T202094: Deprecate Title::getUserCaseDBKey().

LinkCache and LinkBatch are for local pages. The difference only exists for links to remote files.

You mean, interwiki file links, like [[foo:File:xyz.jpg]]? I wasn't aware that was a thing, I thought remote repos always used the shadow namespace mechanism... or am I confused?

May 29 2019, 1:01 AM · Core Platform Team (Decoupling (CDP2)), MW-1.33-notes (1.33.0-wmf.9; 2018-12-18), MediaWiki-General-or-Unknown

May 28 2019

tstarling added a comment to T224085: WikiPEG: remove unnecessary variable assignment assertion mode.

It's not necessary to file a Phabricator ticket for every change. Just describe the change in the commit message.

May 28 2019, 4:25 AM · WikiPEG, Patch-For-Review

May 27 2019

hashar awarded T187147: Port mediawiki/php/wmerrors to PHP7 and deploy a Love token.
May 27 2019, 9:08 AM · Core Platform Team Workboards (Team 1), serviceops, Patch-For-Review, MW-1.34-notes (1.34.0-wmf.6; 2019-05-21), wmerrors, Wikimedia-Logstash, MediaWiki-Logging, Operations, User-herron, PHP 7.2 support, Core Platform Team (PHP7 (TEC4)), Performance-Team (Radar)
tstarling reopened T222856: WikiPEG & Parsoid cache rule optimization as "Open".
May 27 2019, 5:53 AM · WikiPEG, Patch-For-Review
tstarling closed T222856: WikiPEG & Parsoid cache rule optimization as Resolved.
May 27 2019, 5:51 AM · WikiPEG, Patch-For-Review
tstarling added a comment to T202094: Deprecate Title::getUserCaseDBKey().

Isn't there a problem with that if the Title object was cached in LinkCache or pre-loaded using LinkBatch? I have not checked the logic in detail, but it seems to me like these classes are not aware of the idea of a user-case DB key. Or even Title::instanceCache, which uses the normalized DB key as a key.

May 27 2019, 5:28 AM · Core Platform Team (Decoupling (CDP2)), MW-1.33-notes (1.33.0-wmf.9; 2018-12-18), MediaWiki-General-or-Unknown
tstarling added a comment to T222419: Incorrect section numbering after unclosed subst.

Can we just leave off the headingIndex when the token is created, and assign it when the chunk is emitted? Or in an early TT pass?

May 27 2019, 3:06 AM · Parsoid-Read-Views, Patch-For-Review, Reading-Infrastructure-Team-Backlog, Page Content Service

May 24 2019

tstarling added a comment to T222964: WikiPEG character class optimization.

My reaction is... (holding my breadth) "why are you asking this?"
WikiPEG doesn't have a roadmap, and I haven't seen anything that says JavaScript parser generation will be phased out. WikiPEG runs on Node.js, so one would assume JS will always be supported along side PHP.

May 24 2019, 11:22 AM · WikiPEG, Patch-For-Review
tstarling updated subscribers of T202094: Deprecate Title::getUserCaseDBKey().

@daniel asked me about this, following a complaint in CR from @Simetrical that the function was deprecated despite its usage not having significantly changed since it was introduced, without apparent awareness of what it is for. The idea is that if you have a remote file repository hosted on a wiki with $wgCapitalLinks=false, or a remote file repository that is not a MediaWiki instance, then [[File:foo.jpg]] and [[File:Foo.jpg]] may refer to two different files. So to know which one was intended, you have to get the link text before it was mangled by ucfirst().

May 24 2019, 12:45 AM · Core Platform Team (Decoupling (CDP2)), MW-1.33-notes (1.33.0-wmf.9; 2018-12-18), MediaWiki-General-or-Unknown

May 23 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Task description update: I'm explicitly limiting the scope so that we can move towards approval.

May 23 2019, 6:23 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling renamed T221177: REST route handler extension interface RFC from Route Handler Interface RFC to REST route handler extension interface RFC.
May 23 2019, 6:21 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling edited projects for T223646: Create a policy on importing global classes, added: Code-Health; removed TechCom.

We don't think this needs TechCom involvement. Maybe Code Health is interested?

May 23 2019, 5:59 AM · MediaWiki-Codesniffer, Code-Health
tstarling added a comment to T187147: Port mediawiki/php/wmerrors to PHP7 and deploy.

Basic porting work on wmerrors is hopefully complete.

May 23 2019, 4:09 AM · Core Platform Team Workboards (Team 1), serviceops, Patch-For-Review, MW-1.34-notes (1.34.0-wmf.6; 2019-05-21), wmerrors, Wikimedia-Logstash, MediaWiki-Logging, Operations, User-herron, PHP 7.2 support, Core Platform Team (PHP7 (TEC4)), Performance-Team (Radar)

May 21 2019

tstarling added a comment to T222964: WikiPEG character class optimization.

Why are you doing this? The JavaScript code will soon only be used by the compiler itself.

May 21 2019, 10:59 AM · WikiPEG, Patch-For-Review
tstarling added a comment to T223296: proposal: new &? !? and ~? predicates.

Would you accept a new feature request for @ operator that's compatible with PEG.js?

May 21 2019, 10:14 AM · Patch-For-Review, Parsoid

May 20 2019

tstarling closed T223296: proposal: new &? !? and ~? predicates as Declined.

Yes we need an operator which selects an element of a sequence and makes it the return value from the sequence. My previous idea for the selection operator was "@". I don't think we need a discard operator. The semantics are awkward if you try to discard the only element of a sequence, especially if the sequence is at the top level of a rule. This was the problem I had in trying to make parameter capture not return a result -- eventually I gave up and made it the same as an assertion. This may be the reason PEG.js has assertions that return values in the first place, it's definitely convenient when expressions always return values.

May 20 2019, 7:13 AM · Patch-For-Review, Parsoid
tstarling added a comment to T146257: Create objectcache/BagOStuff library.

Would you move the classes to a namespace? If so, would the b/c aliases be part of the library?

May 20 2019, 6:53 AM · Patch-For-Review, User-Addshore, MediaWiki-Cache, Librarization
tstarling added a comment to T221177: REST route handler extension interface RFC.

BagOStuff is in includes/libs/, which in theory means it's in a state where it could be put into a library as-is (i.e. it has no dependencies on MediaWiki). MediaWiki-specific implementations such as SqlBagOStuff are in includes/objectcache/.

May 20 2019, 6:52 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 16 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Latest task description edit: RequestInterface::getParsedBody() has been removed, replaced by getPostParams().

May 16 2019, 3:25 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated the task description for T221177: REST route handler extension interface RFC.
May 16 2019, 3:24 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 15 2019

tstarling moved T221177: REST route handler extension interface RFC from Inbox to Request IRC meeting on the TechCom-RFC board.
May 15 2019, 9:19 PM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling reassigned T223240: REST API ResponseFactory from tstarling to Tgr.
May 15 2019, 6:28 AM · Core Platform Team Workboards (Done with CPT), MW-1.34-notes (1.34.0-wmf.10; 2019-06-18), MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 14 2019

tstarling updated the task description for T221177: REST route handler extension interface RFC.
May 14 2019, 6:39 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T221177: REST route handler extension interface RFC.

To do that, we will need to extend ResponseInterface with a cookie-setting method. It needn't actually wrap WebResponse, instead EntryPoint could use the collected data to call WebResponse's existing method. Adding a cookie-getting method to RequestInterface seems less needed, but it'd also be simple enough. WebRequest::getCookie() seems simple enough to just copy if we omit the Unicode normalization bit that's only intended for $_GET anyway.

May 14 2019, 6:34 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated the task description for T221177: REST route handler extension interface RFC.
May 14 2019, 3:14 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated subscribers of T221177: REST route handler extension interface RFC.

Question from @Krinkle from Gerrit: can getLastModified() be omitted? You can construct an ETag from a timestamp, so ETag is a more generic facility.

May 14 2019, 3:10 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 13 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Some questions copied from the task description:

May 13 2019, 1:04 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated the task description for T221177: REST route handler extension interface RFC.
May 13 2019, 12:42 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T187154: Consider enabling wgExtensionInfoMTime in wmf-production.

Aaron also pointed out we should look into why there is the overhead we see because in theory the overhead should be minimal given the os and php filestat cache. But perhaps the lookups are slow when done 100s of times? Or (Aaron suspects) that maybe the filestat cache size is not big enough and entires are being pushed out.
If that's the case we should see if we can increase the stat cache size on app servers.

May 13 2019, 12:08 AM · Core Platform Team (Security, stability, performance and scalability (TEC1)), Performance-Team (Radar), Wikimedia-Site-requests

May 10 2019

tstarling added a project to T221177: REST route handler extension interface RFC: TechCom-RFC.
May 10 2019, 6:57 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated the task description for T221177: REST route handler extension interface RFC.
May 10 2019, 6:54 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 9 2019

tstarling added a comment to T222224: Normalizing *links tables.

I mentioned in TechCom that DB normalisation can sometimes cause performance problems with range queries. For example, if a page has a very large number of outbound links, and you want to page through them, sorted by title. In general, since an index can only aggregate fields in a single table, splitting a table may require the loss of such indexes, which can cause performance degradation. I'm not aware of any actual instances of this query pattern in the links tables, but Daniel asked me to make a note of this concern.

May 9 2019, 6:11 AM · Patch-For-Review, MediaWiki-Database, TechCom-RFC

May 8 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

I wrote a "path template matcher" class based on the tree building code I previously pasted. It's decoupled from the router and could go in a separate library. I wrote a benchmark script for it, which uses path templates like '/6/{8}/{9}/1/2/{7}'. They are random templates of length 1-6 where 30% of the path components are parameters, filtered in advance to remove conflicts. For 1000 such templates, it takes about 12ms to build the tree, and 1.3µs to match a path against it. The paths were prefiltered so that they always matched a template. This is a very rough model for intended usage. But it supports the proposition that tree based routing is an efficient approach to matching templates, but that a cache of the routing tree is required.

May 8 2019, 12:33 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 6 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Most are just to generate the right version when manually calling header( "HTTP/1.1 404 Not Found" ) or the like. The one in OutputHandler was added in rSVN19996 to send a Content-Length header to HTTP/1.0 clients; it doesn't specify why it's not also including it for 1.1 clients.

May 6 2019, 11:36 PM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
jrbs awarded T6845: CAPTCHA doesn't work for people with visual impairments a Heartbreak token.
May 6 2019, 6:32 PM · Security, WCAG-Level-A, Security-Extensions, Design, Accessibility, ConfirmEdit (CAPTCHA extension)
tstarling added a comment to T221177: REST route handler extension interface RFC.

Comparison of WebRequest and PSR-7 ServerRequestInterface:

May 6 2019, 7:27 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 3 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

I've been reading PSR-7. We already have Guzzle's PSR-7 library as a core dependency, so we could use GuzzleHttp\Psr7\ServerRequest as the parent class of our Rest\Request. ServerRequest::fromGlobals() is wrong for us, but we could have an implementation that gets data from WebRequest. There is ServerRequest::getAttributes() which, PSR-7 strongly suggests, is supposed to have template variables from the path, so that would replace my Request::getParams().

May 3 2019, 5:33 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T221177: REST route handler extension interface RFC.

That's the kind of thing you'd use a middleware for.
...
Keeps the framework simple, keeps handlers flexible in case they need to do something strange (e.g. do the date / etag check in some unusual way).

May 3 2019, 3:29 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 2 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

OK, let's use ObjectFactory.

May 2 2019, 9:28 PM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T221177: REST route handler extension interface RFC.

Mostly yes. But I think that it's mixing response and handler for instance. lastmodified as mentioned in this proposal, is a response property and thus does not belong in a standard Handler class. In Laravel, you would 1 of three things:

  • create a MySpecializedResponse, initialized (incl. LastModified) by a factory based on your model
  • say that your Handler uses LastModifiedTrait to provide the getLastModified and then Router checks for the function being present and then enforcing it on the response.
  • add a MyETAGMiddleware to conditionally check if your ModelType requires setting the eTAG and then doing it.
May 2 2019, 11:01 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling updated subscribers of T221177: REST route handler extension interface RFC.
May 2 2019, 10:34 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T221177: REST route handler extension interface RFC.

I went through a few iterations on the API in the last couple of days. Here's my current favourite. First the verbose interface:

May 2 2019, 1:21 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

May 1 2019

tstarling added a comment to T221177: REST route handler extension interface RFC.

Several REST libraries have "reverse routing", i.e. serialization of parameters into a URL. That requires named routes, or some other way to refer to a route, since you don't want to have to provide the full template in order to serialize parameters. Do we need that?

May 1 2019, 11:56 PM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T221177: REST route handler extension interface RFC.

One thing I brought up tonight in the meeting is that HyperSwitch uses OpenAPI 3.0 to define routes. It's a unique architecture in my experience!
UPDATE: It's actually a pretty well-established architecture; it's how Swagger works, after all.

May 1 2019, 3:27 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling edited P8463 detect-template-ambiguity.php.
May 1 2019, 2:31 AM
tstarling added a comment to T221177: REST route handler extension interface RFC.

Real ambiguity is pretty hard to detect, in both directions:

  • the template pair /foo/{var}/baz and /foo/bar/{var} is ambiguous, but short of turning one into a regexp, matching against the other, and doing that for all pairings of templates, I don't think you can detect it.
May 1 2019, 2:29 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling created P8464 detect-template-ambiguity sample.
May 1 2019, 2:11 AM
tstarling created P8463 detect-template-ambiguity.php.
May 1 2019, 2:10 AM
tstarling added a comment to T221177: REST route handler extension interface RFC.

I for one prefer /{type}/{id}.{format}, like /page/Main_Page.json. And having URLs for related resources under that "directory", like /page/Main_Page/revisions. It's tricky, since in this case our page titles allow "/", but I think that can be fudged...?

May 1 2019, 12:22 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

Apr 30 2019

tstarling updated subscribers of T221177: REST route handler extension interface RFC.
  • Resources identified using a path hierarchy.

Note this conflicts with module prefixes somewhat. The typical REST API approach is something like /<resource type>/<representation>/<id>, e.g. /page/html/Barack_Obama. But a large number of APIs will provide functionality for the same small set of resource types (page, revision, user etc) and often an extension will provide functionality for several different resource types.

Apr 30 2019, 5:35 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

Apr 29 2019

tstarling updated subscribers of T221177: REST route handler extension interface RFC.

There's no single accepted definition of a REST API. Is this a fair summary of what we are building here?

Apr 29 2019, 5:27 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T221177: REST route handler extension interface RFC.

Library surveys and some related thoughts.

Apr 29 2019, 4:17 AM · Core Platform Team Workboards (Team 1), TechCom-RFC (TechCom-Approved), Patch-For-Review, MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))
tstarling added a comment to T219959: REST API Router.

I suggest merging this task with T221177. The same things are being discussed in both places.

Apr 29 2019, 2:07 AM · Core Platform Team Workboards (Team 1), MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

Apr 25 2019

tstarling closed T221858: Release wikipeg 2.0.3 through npm as Resolved.

I added cscott, arlolra and subbu as maintainers.

Apr 25 2019, 11:55 PM · Patch-For-Review, Parsoid

Apr 24 2019

tstarling added a comment to T219959: REST API Router.

I would lean towards option 1, rest.php. Special pages are mostly for UIs, not APIs. Actions usually have a required title parameter and are intended for taking an action on a page.

Apr 24 2019, 3:55 AM · Core Platform Team Workboards (Team 1), MediaWiki-REST-API, Core Platform Team (Parsoid REST API in PHP (CDP2))

Apr 22 2019

tstarling lowered the priority of T219942: Analyse performance of the PHP tokenizer code and do any necessary optimisation work from Normal to Low.
Apr 22 2019, 11:59 PM · Core Platform Team (Parsoid PHP (CDP2)), Parsoid-PHP

Apr 17 2019

tstarling added a comment to T219942: Analyse performance of the PHP tokenizer code and do any necessary optimisation work.

"Keyword set extraction" is actually on my PEG.js idea list from 2016. I wrote a note "Find minimum prefix length. Construct a switch case for each unique substring of the minimum length." I think what stopped me at the time was fear of corrupting the stops stack by omitting execution of impossible choices. Now that we have rule parameters, it should be feasible.

Apr 17 2019, 5:04 AM · Core Platform Team (Parsoid PHP (CDP2)), Parsoid-PHP
tstarling added a comment to T219942: Analyse performance of the PHP tokenizer code and do any necessary optimisation work.

I've done an initial pass on this, and written a series of changes to both WikiPEG and Parsoid:

Apr 17 2019, 4:49 AM · Core Platform Team (Parsoid PHP (CDP2)), Parsoid-PHP
tstarling renamed Core Platform Team (Parsoid PHP (CDP2)) from Parsoid PHP (CPD2) to Parsoid PHP (CDP2).
Apr 17 2019, 4:06 AM

Apr 12 2019

tstarling closed T219341: Cross-language test suite for WikiPEG as Resolved.
Apr 12 2019, 5:30 AM · Core Platform Team Workboards (Done with CPT), Core Platform Team (Parsoid PHP (CDP2)), Parsoid-PHP
tstarling closed T219341: Cross-language test suite for WikiPEG, a subtask of T219339: PHP generator backend for WikiPEG, as Resolved.
Apr 12 2019, 5:30 AM · Core Platform Team Workboards (Done with CPT), Core Platform Team (Parsoid PHP (CDP2)), Parsoid-PHP
tstarling added a comment to T176916: Set up sampling profiler for PHP 7 (alternative to HHVM Xenon).

Is it feasible to always traverse the whole stack?
I know this sounds like a naive ask, and from your description I'm guessing that would be too expensive (which totally makes sense). But it's unclear to me how this compares to related to PHP functions debug_backtrace() and ( new RuntimeException() )->getTraceAsString(). We we use regularly in production code, and appear to do this.

Apr 12 2019, 1:57 AM · Core Platform Team Workboards (Done with CPT), PHP 7.1 support, Core Platform Team (PHP7 (TEC4)), Performance-Team

Apr 11 2019

tstarling added a comment to T208776: Introduce PageIdentity to be used instead of Title.

How would this help to remove the cyclic dependency between User and Title? I was looking at those classes last night, and the dependencies between them don't seem related to this proposal. There is User::isWatched() etc., which is already a wrapper around WatchedItemStore, so the dependency could be removed by just moving it fully to WatchedItemStore and deprecating the wrapper. Similarly Title::getUserPermissionsErrors() is now a deprecated wrapper for PermissionManager, and most of the other uses of User in Title could receive similar treatment.

Apr 11 2019, 11:31 PM · TechCom-RFC, Core Platform Team (Decoupling (CDP2))
tstarling added a comment to T176916: Set up sampling profiler for PHP 7 (alternative to HHVM Xenon).
  1. Assuming I understood correctly that we trim from the start currently, is this something we can/should change?
  2. How big a stack depth would you be comfortable with?
Apr 11 2019, 5:48 AM · Core Platform Team Workboards (Done with CPT), PHP 7.1 support, Core Platform Team (PHP7 (TEC4)), Performance-Team
tstarling added a comment to T220514: MediaWiki web installer do not show extension when their dependency is missing.

I'm thinking about how to fix this. In the meantime, for CI, if you know the extension list, you could pass it to the --extensions option of install.php. That way you would get an error even if the extension directory is missing, which sounds like it would be a useful sanity check.

Apr 11 2019, 4:16 AM · MW-1.34-release, Core Platform Team (Security, stability, performance and scalability (TEC1)), Regression, MW-1.32-release, MW-1.33-release, Patch-For-Review, Continuous-Integration-Infrastructure, MediaWiki-Installer

Apr 10 2019

tstarling added a comment to T220563: Undefined index: june in DateFormatter.php (makeIsoMonth).

The months are combined into a regex without preg_quote(), which wasn't quite so bad in the original commit, which only supported English and thus fairly well-known and well-behaved month names. Now that other language are supported, it becomes a problem, since for example German has "jun" => "Jun.". So the bug can be reproduced with:

Apr 10 2019, 2:40 AM · MW-1.33-notes (1.33.0-wmf.25; 2019-04-09), MW-1.34-notes (1.34.0-wmf.1; 2019-04-16), Wikimedia-production-error, MediaWiki-Parser
tstarling added a comment to T220563: Undefined index: june in DateFormatter.php (makeIsoMonth).

A significant amount of DateFormatter.php is unchanged since I introduced it in November 2003, including makeIsoMonth() and the check of its return value. It was one of the first things I wrote in PHP. I was developing with PHP notices disabled at the time. Code was often committed that emitted notices, we just had them disabled in production. It took a while for us to make it a development policy to not emit notices.

Apr 10 2019, 1:26 AM · MW-1.33-notes (1.33.0-wmf.25; 2019-04-09), MW-1.34-notes (1.34.0-wmf.1; 2019-04-16), Wikimedia-production-error, MediaWiki-Parser
tstarling added a comment to T220563: Undefined index: june in DateFormatter.php (makeIsoMonth).

It's probably just a change in the input text, not a change in the code. DateFormatter.php is obviously broken, line 260 calls makeIsoMonth() speculatively, and checks if the return value is false or "00", anticipating this error but not the notice that goes with it. $fail is set to true, but $bits['m'] is subsequently used anyway, even though it is unset. It's used to construct text that is subsequently thrown away at line 314, and then used again unconditionally at line 321.

Apr 10 2019, 12:44 AM · MW-1.33-notes (1.33.0-wmf.25; 2019-04-09), MW-1.34-notes (1.34.0-wmf.1; 2019-04-16), Wikimedia-production-error, MediaWiki-Parser

Apr 3 2019

tstarling added a comment to T219279: Some pages will become completely unreachable after PHP7 update due to Unicode changes.

I see now that the ligatures are indeed changing, but there is only one affected username:

Apr 3 2019, 9:22 PM · Patch-For-Review, MW-1.34-notes (1.34.0-wmf.14; 2019-07-16), Core Platform Team Workboards (Clinic Duty Team), Core Platform Team (PHP7 (TEC4)), serviceops, Operations, PHP 7.2 support, MediaWiki-General-or-Unknown