Page MenuHomePhabricator

Decide if WikimediaEvents wants to use generalized test
Open, MediumPublic

Description

Background

Core now has a generic MediaWiki\Tests\Structure\OwnersStructureTestBase test.
WikimediaEvents has a test tests/phpunit/OwnersStructureTest.php that could be replaced with this test and benefit from upstream fixes and improvements. In particular the existing test doesn't check ownership of files in includes folder meaning certain instrumentation is currently not claimed.

Feel free to decline if this is not of interest.

User story

As a repo owner I want to know who to talk to about code in a repository with multiple teams contributing.

Requirements

  • Add task requirements. Requirements should be user-centric, well-defined, unambiguous, implementable, testable, consistent, and comprehensive

BDD

  • For QA engineer to fill out

Test Steps

  • For QA engineer to fill out

Design

  • Add mockups and design requirements

Acceptance criteria

  • Add acceptance criteria

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

Rollback plan

  • What is the rollback plan in production for this task if something goes wrong?

This task was created by Version 1.2.0 of the Web team task template using phabulous

Event Timeline

Change #1233928 had a related patch set uploaded (by Jdlrobson; author: Gergő Tisza):

[mediawiki/extensions/WikimediaCustomizations@master] Enforce claiming of files and folders via OWNERS.md

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

We also want to use this in QuickSurveys now.

We could either create a new test inspired by the existing two tests or (recommended) generalize the test in core so we can share it and improve it for all repos going forward

An assumption here is that the test is easy to improve and improving it across codebases will also be easy. Has there been any consideration of the cons of the current system?

Change #1233892 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/WikimediaEvents@master] Use MediaWiki\Tests\Structure\OwnersStructureTestBase

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

Change #1233928 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCustomizations@master] Check all files and folders are claimed via OWNERS.md

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

We could either create a new test inspired by the existing two tests or (recommended) generalize the test in core so we can share it and improve it for all repos going forward

An assumption here is that the test is easy to improve and improving it across codebases will also be easy. Has there been any consideration of the cons of the current system?

The test in WikimediaEvents is useful but incomplete and possibly already overly-complex. The WikimediaEvents test has a modules section which the core test does not support (the assumption being that a ResourceLoader module should have its own dedicated folder).

The test we now have in core, is a simplified version of the one that was previously inside MobileFrontend and is currently in WikimediaEvents with several bug fixes. It's now being used by WikimediaCustomizations and I have plans to use it in QuickSurveys too to better support https://www.mediawiki.org/wiki/Wikimedia_Production/Service_Catalog/Ownership_Roles_and_Responsibilities

When applying the new test to WikimediaEvents I found:

  • various files with no ownership suggesting the test is not working (see OwnersStructureTest::getUntestedFiles)
  • inconsistencies around base folder which lead to ambiguities for similar named files (modules/ext.wikimediaEvents, ext.wikimediaEvents or root)
  • Evidence of wanting to test ownership for PHP files too which is not enforced (but is forced by the test in core)

I think having a single test in core that every team can improve is preferable to the current situation and now we have several repos using it, it would be great if WikimediaEvents used it too. If we find this not manageable we can always revisit.
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/1233892

Of course, there is no requirement to switch to the test. If WikimediaEvents isn't seeing value in the test, please feel free to delete it.

Also in the cons column:

It's a homegrown system. A quick search yielded a competing one, https://docs.gitlab.com/user/project/codeowners/, which is supported by both GitLab, GitHub, Gerrit – via a a plugin, which appears to be under active development – and also VSCode and PHPStorm via plugins.

A more thorough search may well yield more with similar levels of support.

Yes you are right that we should be exploring industry-standard solutions rather than sticking with a homegrown format. My reasoning for standardizing is that if we have N different homegrown formats, then we will need N migration steps when we'll eventually do that. Consolidating to one format with a test cleans the data, ensuring that when we do want to migrate, we can run a single migration tool across all those repos. Currently we have 2 homegrown formats, one of which is the WikimediaEvents repo.

I don't have the bandwidth or annual plan justification to lead an evaluation of alternatives right now, but I'd be happy to support your team if you want to propose/pilot a new standard. In the meantime, I'd love to get this repo onto the shared test so we're at a consistent baseline and move back to higher-priority work.

Change #1233892 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/WikimediaEvents@master] Use MediaWiki\Tests\Structure\OwnersStructureTestBase

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

Jdlrobson-WMF renamed this task from Decide if we want to enforce ownership in WikimediaCustomizations a la WikimediaEvents and MobileFrontend and if so generalize the test to Decide if WikimediaEvents wants to use generalized test.Fri, May 15, 5:46 PM
Jdlrobson-WMF removed a project: QuickSurveys.
Jdlrobson-WMF updated the task description. (Show Details)