Page MenuHomePhabricator

Migration Schemas to a non-latest version is broken
Open, In Progress, MediumPublic5 Estimated Story PointsBUG REPORT

Description

The migrateSchema.php maintenance script developer for T357532: Create a system to support developers while upgrading configuration schemas supports in principle both upgrading and downgrading. However, there is a fundamental problem with migrating to anything besides the most recent version of a Schema: The store and the validator used to save that schema are not version-aware.
That means when migrating to anything but the most-recent version, then the schema saved will still be validated with the most recent Schema and it will be saved with the version of the most-recent Schema.

Acceptance Criteria:

  • It is possible to migrate Configuration to any version of a Schema. That version will be validated with the Schema at that version, and have that version as the value for $version in the stored json.
  • in particular, it is possible to migrate to the first version of a Schema
  • there exist e2e tests asserting that functionality in the CommunityConfiguration extension

Details

Related Changes in Gerrit:
SubjectAuthorRepoBranchLines +/-
EMcFarlandmediawiki/extensions/GrowthExperimentsmaster+2 -1
EMcFarlandmediawiki/extensions/GrowthExperimentsmaster+3 -2
Michael Großemediawiki/extensions/CommunityConfigurationmaster+626 -197
EMcFarlandmediawiki/extensions/GrowthExperimentsmaster+3 -2
Michael Großemediawiki/extensions/ReportIncidentmaster+2 -2
Thiemo Kreuz (WMDE)mediawiki/extensions/Citemaster+3 -0
Michael Großemediawiki/extensions/TemplateDatamaster+7 -6
Michael Großemediawiki/extensions/CommunityConfigurationmaster+8 -2
Michael Großemediawiki/extensions/CommunityConfigurationmaster+36 -21
Michael Großemediawiki/extensions/CommunityConfigurationmaster+5 -5
Michael Großemediawiki/extensions/GrowthExperimentsmaster+0 -15
Michael Großemediawiki/extensions/GrowthExperimentsmaster+15 -0
Michael Großemediawiki/extensions/CommunityConfigurationmaster+23 -4
Show related patches Customize query in gerrit

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

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

[mediawiki/extensions/CommunityConfiguration@master] fix(migrateSchema): use correct converter when downgrading

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

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

[mediawiki/extensions/CommunityConfiguration@master] refactor(ISchemaConverter): rename downgrading method

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

Note that while the added changes improve the code, they do not yet address the fundamental issue brought up in this task and mentioned in the AC. So this task should not move to QA until the main points have actually been addressed.

Change #1056961 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] fix(migrateSchema): use correct converter when downgrading

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

Change #1056959 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] refactor(SchemaConverters): prepare rename of downgradeFromNewer to downgradeToPrevious

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

Change #1056962 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] refactor(ISchemaConverter): rename downgrading method

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

Change #1056960 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] refactor: Remove unused code

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

KStoller-WMF subscribed.

Estimation planning decision: this task should be broken into subtasks

KStoller-WMF set the point value for this task to 5.Mar 3 2025, 5:18 PM

General approach to finish implementing the migration feature:

  • write example migration and test for CommunityConfigurationExample (test will be failing for now)
  • when writing configuration, it should be validated with the Schema of its own version
  • when reading configuration for functional usage from code, the converters must be applied to bring it to the latest version
  • when reading configuration for rendering value in the Special:CommunityConfiguration form, then too the converters must be applied to bring it to the latest version

⇒ running the migration script will be a "convenience" so that the change of functionality is visible in the history of the config wiki-page, but it should not change anything functionality-wise

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

[mediawiki/extensions/CommunityConfiguration@master] fix: finish implementing migrations

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

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

[mediawiki/extensions/CommunityConfiguration@master] refactor: make IValidator implementations version-aware

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

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

[mediawiki/extensions/CommunityConfiguration@master] refactor: make IValidator version aware

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

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

[mediawiki/extensions/ReportIncident@master] refactor: make use of version in schema for validation

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

This is finally ready for review now.

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

[mediawiki/extensions/TemplateData@master] refactor: make use of version in schema for validation

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

Change #1139103 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] refactor: make IValidator implementations version-aware

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

Change #1139104 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] refactor: make IValidator version aware

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

Change #1161998 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] refactor: make use of version in schema for validation

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

Change #1169068 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Fix incomplete CommunityConfiguration SchemaProviderTestCase

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

Change #1169068 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Fix incomplete CommunityConfiguration SchemaProviderTestCase

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

Change #1139106 merged by jenkins-bot:

[mediawiki/extensions/ReportIncident@master] refactor: make use of version in schema for validation

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

Michael raised the priority of this task from Medium to High.Jan 22 2026, 5:29 PM
Michael lowered the priority of this task from High to Medium.Apr 28 2026, 3:45 PM
EMcFarland-WMF changed the task status from Open to In Progress.May 20 2026, 4:16 PM

Change #1296526 had a related patch set uploaded (by EMcFarland; author: EMcFarland):

[mediawiki/extensions/GrowthExperiments@master] fix: finish implementing migrations

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

Change #1322764 had a related patch set uploaded (by EMcFarland; author: EMcFarland):

[mediawiki/extensions/GrowthExperiments@master] fix: finish implementing migrations

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

Change #1131996 abandoned by EMcFarland:

[mediawiki/extensions/CommunityConfiguration@master] fix: finish implementing migrations

Reason:

abandoned in favor of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1322764

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

Change #1131996 restored by EMcFarland:

[mediawiki/extensions/CommunityConfiguration@master] fix: finish implementing migrations

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

Change #1296526 abandoned by EMcFarland:

[mediawiki/extensions/GrowthExperiments@master] fix: finish implementing migrations

Reason:

abandoned in favor of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1322764

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

Change #1325418 had a related patch set uploaded (by EMcFarland; author: EMcFarland):

[mediawiki/extensions/GrowthExperiments@master] MentorListConfigProvider: Use current version of DataProvider::storeValidConfiguration

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