diff --git a/docs/build-scripts.md b/docs/build-scripts.md index 70264fdfa..ad89d001a 100644 --- a/docs/build-scripts.md +++ b/docs/build-scripts.md @@ -7,6 +7,21 @@ graph TD B-->|pacman|C[dist folder with things in it] ``` +### Checklist for updating mediawiki +- `wikiman.yaml` + - Check `mediawikiVersion` is still set to the version we want to target e.g. 1.39 + - Check if `mediawikiRepoRef` is set to a specific value for a reason that still makes sense + - If not remove it +- Review `patchUrls` + - Open each patch and determine if it has now been merged into the updated version you are targeting + - If so: remove it + - If not determine if we should: + - Apply it as is + - Edit it so that is correctly applies to the newly updated code + - Remove it since it's no longer needed +- Run `./sync/wikiman/wikiman .` +- Run `./sync.sh` + ### sync.sh This script will resync the `dist` directory. @@ -40,7 +55,7 @@ This needs to be run by developers when updating component versions in `wikiman. This is run as a step in `sync.sh` #### Syncing patches -To apply additional gerrit patches, you can specify patch URLs in the corresponding codebase part of `pacman.yaml` +To apply additional gerrit patches, you can specify patch URLs in the corresponding codebase part of `wikiman.yaml`. Example: ``` @@ -48,6 +63,3 @@ Example: patchUrls: - https://gerrit.wikimedia.org/r/changes/mediawiki%2Fextensions%2FWikibase~833742/revisions/15/patch?download ``` - -> [!WARNING] -> Currently patches will get overridden if `wikiman` is used to generate the `pacman.yaml` file! diff --git a/sync/wikiman/wikiman-schema.json b/sync/wikiman/wikiman-schema.json index cb2ac83bc..f372d7dd9 100644 --- a/sync/wikiman/wikiman-schema.json +++ b/sync/wikiman/wikiman-schema.json @@ -66,6 +66,9 @@ }, "remove": { "$ref": "#/$defs/RemoveList" + }, + "patchUrls": { + "$ref": "#/$defs/PatchUrlList" } }, "additionalProperties": false, @@ -88,6 +91,9 @@ }, "remove": { "$ref": "#/$defs/RemoveList" + }, + "patchUrls": { + "$ref": "#/$defs/PatchUrlList" } }, "additionalProperties": false, @@ -102,6 +108,13 @@ "items": { "type": "string" } + }, + "PatchUrlList": { + "description": "A list of gerrit URLs pointing to a base64 encoded git patch", + "type": "array", + "items": { + "type": "string" + } } } } diff --git a/sync/wikiman/wikiman.py b/sync/wikiman/wikiman.py index 66ae539f5..bd62349f8 100755 --- a/sync/wikiman/wikiman.py +++ b/sync/wikiman/wikiman.py @@ -52,6 +52,12 @@ def make_artifact_entry(details: Dict[str, str], extra_remove: List[str]) -> Dic 'destination': details['destination'], 'remove' : extra_remove + details.get('remove', []), } + + if "patchUrls" in details.keys(): + entry['patchUrls'] = [] + for patch_url in details['patchUrls']: + entry['patchUrls'].append(patch_url) + return entry # pylint: disable=too-many-ancestors diff --git a/wikiman.yaml b/wikiman.yaml index acfa3a3e5..50857d218 100644 --- a/wikiman.yaml +++ b/wikiman.yaml @@ -48,8 +48,13 @@ extensions: repoName: wikimedia/mediawiki-extensions-CirrusSearch - name: WikibaseCirrusSearch repoName: wikimedia/mediawiki-extensions-WikibaseCirrusSearch + patchUrls: + - https://gerrit.wikimedia.org/r/changes/mediawiki%2Fextensions%2FWikibaseCirrusSearch~1120939/revisions/2/patch?download + - https://gerrit.wikimedia.org/r/changes/mediawiki%2Fextensions%2FWikibaseCirrusSearch~1120941/revisions/1/patch?download - name: WikibaseLexemeCirrusSearch repoName: wikimedia/mediawiki-extensions-WikibaseLexemeCirrusSearch + patchUrls: + - https://gerrit.wikimedia.org/r/changes/mediawiki%2Fextensions%2FWikibaseLexemeCirrusSearch~1120949/revisions/1/patch?download - name: UniversalLanguageSelector repoName: wikimedia/mediawiki-extensions-UniversalLanguageSelector - name: cldr @@ -62,6 +67,8 @@ extensions: repoName: wikimedia/mediawiki-extensions-TwoColConflict - name: OAuth repoName: wikimedia/mediawiki-extensions-OAuth + patchUrls: + - https://gerrit.wikimedia.org/r/changes/mediawiki%2Fextensions%2FOAuth~1197610/revisions/2/patch?download - name: WikibaseLexeme repoName: wikimedia/mediawiki-extensions-WikibaseLexeme - name: SyntaxHighlight_GeSHi @@ -92,6 +99,10 @@ extensions: repoName: wikimedia/mediawiki-extensions-SecureLinkFixer - name: Echo repoName: wikimedia/mediawiki-extensions-Echo + patchUrls: + # This patch URL fixes SQLBagOStuff duplicate warnings due to bug in Echo extension. + # Remove when updated to 1.44+ (Bug: T412100). + - https://gerrit.wikimedia.org/r/changes/mediawiki%2Fextensions%2FEcho~1093496/revisions/1/patch?download - name: Poem repoName: wikimedia/mediawiki-extensions-Poem - name: TemplateData @@ -133,6 +144,8 @@ extensions: repoRef: 3e039311504eb82f8c5c488a457b9e376b5cf7e3 ## These extensions use urls directly - name: Wikibase + patchUrls: + - https://gerrit.wikimedia.org/r/changes/mediawiki%2Fextensions%2FWikibase~1120952/revisions/1/patch?download url: https://github.com/wbstack/mediawiki-tars/raw/ae333245e6fd22b888a925f088ac5637c6f9b6c1/Wikibase-1761224062-REL1_43.tar.gz remove: - build