Repository navigation
Add upgrade group management and parallel wiki upgrade support - #19
Merged
Merged
Conversation
UpgradeWiki previously upgraded whichever wiki --wiki selected, which meant the script had to run under every wiki in turn and --change-version was only safe on a single wiki. The wikis to upgrade are now positional arguments, or come from --group or --file, and --wiki only decides which wiki the script itself runs under. A maintenance class instantiated in-process always talks to the database of the wiki the process was booted for, so steps for any other wiki are now run as separate maintenance/run.php --wiki=<target> processes. ChangeMediaWikiVersion is pinned to the target wiki with --regex, so --change-version is safe for multi-wiki runs. Because the run is no longer one wiki per process, LoggedUpdateMaintenance no longer fits: each wiki's upgrade-wiki-<mwversion> row is written to its own updatelog, with --force to re-run and --continue-on-error to carry on past a failed wiki. Adds ManageUpgradeGroups, which manages the group1, group2, ... database lists in cw_cache that UpgradeWiki --group deploys to: listing, adding, moving and removing wikis, creating or topping up a group to cover a given percentage of the fleet, and auditing the lists. A wiki is never placed in two groups, and every run reports duplicates (--check --fix drops them). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXN8RgK2iUq9jh74muDMWk
Version changes for a whole batch now happen in one ChangeMediaWikiVersion pass with a single database list regeneration, instead of one full regeneration per wiki. That regeneration rewrites this server's copy and bumps CreateWiki's global timestamp, so every other server regenerates once too. --change-version flips every target first; --change-version-after flips only the wikis that upgraded cleanly, once their schema changes are in. Each target wiki is now upgraded in its own run.php --wiki=<target> process, with that wiki's steps run in-process inside it, so MediaWiki boots once per wiki rather than once per step. --parallel runs several at a time, with output prefixed by wiki name. Without --continue-on-error the first failure stops new wikis from starting and lets the running ones finish. ChangeMediaWikiVersion reads the current version off the cw_wikis row it has already loaded rather than re-including databases.php for every wiki, skips wikis already on the target version, and skips the regeneration when nothing changed. ManageUpgradeGroups can select wikis by state (--state, --exclude-state) using CreateWiki's active/closed/inactive/deleted/public/private lists, and fill a group with --add-all, --count or --percent of the selected wikis. Group names are now restricted to group<number> so a group can never overwrite a CreateWiki list or a per-wiki cache file in cw_cache. Also defines formatPercent(), which the previous commit called without defining, breaking --list, --check and --percent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXN8RgK2iUq9jh74muDMWk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXN8RgK2iUq9jh74muDMWk
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive support for managing staged wiki upgrades through upgrade groups and parallel processing. It introduces a new
ManageUpgradeGroupsmaintenance script for managing rollout groups, significantly refactorsUpgradeWikito support upgrading multiple wikis in parallel, and adds a newUpgradeGroupsutility class for reading/writing group database lists.Key Changes
New
UpgradeGroupsclass (includes/UpgradeGroups.php):New
ManageUpgradeGroupsmaintenance script (maintenance/ManageUpgradeGroups.php):$wgLocalDatabasesby defaultRefactored
UpgradeWikimaintenance script (maintenance/UpgradeWiki.php):LoggedUpdateMaintenancetoMaintenancefor more control--group, or--file--paralleloption to run multiple wiki upgrades concurrently (default: 1)--change-versionand--change-version-afteroptions for batch version updates--forceto re-run upgrades on already-upgraded wikis--continue-on-errorto keep upgrading remaining wikis after failures--dry-runto preview what would be upgraded--wikionly affects script's boot wiki) from upgrade targetsUpdated
ChangeMediaWikiVersion(maintenance/ChangeMediaWikiVersion.php):Updated README.md:
Notable Implementation Details
$wgLocalDatabasesunless--skip-validationis passedhttps://claude.ai/code/session_01MXN8RgK2iUq9jh74muDMWk
Summary by CodeRabbit
New Features
Bug Fixes
Documentation