Page MenuHomePhabricator

Switch `GEUseCommunityConfigurationExtension` to `true` in extension.json
Closed, ResolvedPublic5 Estimated Story Points

Description

Currently, CI does not pass if we just toggle on the CommunityConfiguration in config: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1053018

The phpunit tests see a lot of failures:

18:05:31 ERRORS!
18:05:31 Tests: 26253, Assertions: 80279, Errors: 38, Failures: 1, Skipped: 124.

And also the MentorDashboard Selenium tests are failing:

18:03:43 [Chrome 90.0.4430.212 linux #0-3] » /tests/selenium/specs/mentordashboard.js
18:03:43 [Chrome 90.0.4430.212 linux #0-3] Special:MentorDashboard
18:03:43 [Chrome 90.0.4430.212 linux #0-3]    ✓ Does not trigger errors when visited
18:03:43 [Chrome 90.0.4430.212 linux #0-3]    ✖ Prompts to enroll as a mentor
18:03:43 [Chrome 90.0.4430.212 linux #0-3]    ✖ Allows enrolling as a mentor
18:03:43 [Chrome 90.0.4430.212 linux #0-3]
18:03:43 [Chrome 90.0.4430.212 linux #0-3] 1 passing (14.1s)
18:03:43 [Chrome 90.0.4430.212 linux #0-3] 2 failing
18:03:43 [Chrome 90.0.4430.212 linux #0-3]

Acceptance Criteria:

  • GEUseCommunityConfigurationExtension is set to true in CI
  • CI is green for the master branch of GE

Notes:

Related Objects

Event Timeline

Michael updated the task description. (Show Details)

Change #1069115 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] chore: remove migrateCommunityConfig maint script and tests

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

Change #1069115 abandoned by Michael Große:

[mediawiki/extensions/GrowthExperiments@master] chore: remove migrateCommunityConfig maint script and tests

Reason:

Abandoning for now. We'll define a more consistent approach to supporting 3rd parties, and probably remove this script after 1.43 has been released.

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

Change #1087520 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] [tests] Mentorship: Test with CommunityConfiguration

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

Change #1087520 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] [tests] Mentorship: Test with CommunityConfiguration

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

Change #1087870 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] extension.json: Use community configuration by default

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

KStoller-WMF set the point value for this task to 5.Nov 12 2024, 5:26 PM
This comment was removed by Michael.
Urbanecm_WMF updated Other Assignee, added: Michael.

According to today's standup, I will focus at PHPUnit failures, and @Michael will take a look at the browser test failures.

A great deal of the PHPUnit failures is this:

10:06:29 1) Wikibase\Search\Elastic\Tests\EntitySearchElasticFulltextTest::testSearchElastic with data set "search_de-ch" (array('Wien', 'de-ch', array(0, 120)), '/workspace/src/extensions/Wik...pected')
10:06:29 RuntimeException: Database backend disabled

This is because CommunityConfiguration is always trying to load the database. I wanted to know why that doesn't happen for legacy CC, which is also accessing pages. It turns out WikiPageConfigLoader has the following code:

private function fetchConfig( Link_target $configPage, int $flags ) {
	if ( $configPage->isExternal() ) {
		// Irrelevant in this case
	} else {
		$revision = $this->isTestWithStorageDisabled
			? null
			: $this->revisionLookup->getRevisionByTitle( $configPage, 0, $flags );
		if ( !$revision ) {
			// The configuration page does not exist. Pretend it does not configure anything
			// specific (failure mode and empty-page behavior is equal, see T325236).
			return StatusValue::newGood( $this->configValidatorFactory
				->newConfigValidator( $configPage )
				->getDefaultContent()
			);
		}
	}
}

Essentially, WikiPageConfigLoader skips the database layer entirely if the storage is disabled. Since we're dealing with the same problem in this task and returning the default proved to be successful for legacy CC, let's do that again. In CommunityConfiguration world, this would be a change to WikiPageStore::fetchJsonBlob().

Let's implement the same thing in CommunityConfiguration and see where it takes us.

Change #1092316 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] WikiPageStore: Do not access DB when running without a storage backend

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

Change #1092331 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] [tests] HelpPanelTest: Override CC2.0 variables correctly

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

Change #1094377 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] Introduce CommunityConfigurationTestHelpers

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

Change #1094378 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] [tests] Migrate PersonalizedPraiseHooksTest to CC2.0

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

Change #1087870 abandoned by Urbanecm:

[mediawiki/extensions/GrowthExperiments@master] extension.json: Use community configuration by default

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

Considering we're nearing the end of the sprint, I decided to clarify this ticket's purpose. Here, the goal is to switch the use CommunityConfiguration feature flag to true by default, ensuring most tests (and all new ones) are using CommunityConfiguration. However, it is acceptable to pin certain tests to the old system. Fully fixing all tests is tracked in T380586: [EPIC] Ensure GrowthExperiments CI pipeline is using CommunityConfiguration to run tests.

Urbanecm_WMF renamed this task from Switch `GEUseCommunityConfigurationExtension` to `true` in extension.json and fix tests failing in CI to Switch `GEUseCommunityConfigurationExtension` to `true` in extension.json.Nov 22 2024, 12:57 PM

Change #1092331 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] HelpPanel: Inject $config and $wikiConfig correctly

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

This should be all ready for code review. Once patches uploaded here get merged, using CC should be the default. There will be few other tests to follow-up on:

Change #1092316 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] WikiPageStore: Do not access DB when running without a storage backend

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

Change #1094377 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] Introduce CommunityConfigurationTestHelpers

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

Change #1094378 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] [tests] Migrate most testcases to CC2.0

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

  NODES
Bugs 1
COMMUNITY 61
Note 6
Project 10