Skip to content

Add meza maint run for ad-hoc maintenance script execution#358

Draft
Copilot wants to merge 2 commits into
devfrom
copilot/improve-maintenance-handling
Draft

Add meza maint run for ad-hoc maintenance script execution#358
Copilot wants to merge 2 commits into
devfrom
copilot/improve-maintenance-handling

Conversation

Copilot AI commented Apr 3, 2026

Copy link
Copy Markdown

Running ad-hoc MediaWiki maintenance scripts required either verbose direct ansible-playbook invocations or writing custom wrapper scripts. The run-maintenance.yml playbook existed but had no CLI entrypoint.

Changes

src/scripts/meza.py

  • Adds meza_command_maint_run() — a new maint sub-command routing to the existing run-maintenance.yml playbook
  • Supports --wiki <wiki_id> to target a single wiki (default: all wikis) and --args <script_args> to forward arguments to the PHP script
  • Unrecognized flags are passed through to ansible-playbook

manual/meza-cmd/maint.md

  • Documents the new run directive with usage examples
  • Updates the Arguments table and "When to Run Maintenance" section
  • Promotes meza maint run as the recommended approach in the "Advanced" section over raw playbook invocations

Usage

# All wikis
sudo meza maint run monolith update

# Single wiki
sudo meza maint run monolith refreshLinks --wiki demo

# With script arguments
sudo meza maint run monolith runJobs --args '--maxjobs=50'

# Combined
sudo meza maint run monolith refreshLinks --wiki demo --args '--verbose'

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Improve maintenance handling for MediaWiki Add meza maint run for ad-hoc maintenance script execution Apr 3, 2026
Copilot AI requested a review from freephile April 3, 2026 13:53

Copilot AI commented Apr 9, 2026

Copy link
Copy Markdown
Author

@copilot This feature branch was created a week ago from 'dev', and contains a couple commits. I want to work on the branch in my local repo, so I fetched it and checked it out. Over the past week the...

Yes, rebasing the feature branch onto the tip of dev is the right practice here — it replays your commits on top of the latest dev changes, gives you a cleaner linear history, and avoids a merge commit that would otherwise clutter the branch.

After rebasing locally, your local branch and origin will have diverged (different commit SHAs for the same logical changes), so a normal git push will be rejected. The correct way to update origin is a force-push:

# Safest option — fails if someone else pushed to the branch since you last fetched
git push --force-with-lease origin copilot/improve-maintenance-handling

# Unconditional force-push (use only if you're sure no one else is working on the branch)
git push --force origin copilot/improve-maintenance-handling

--force-with-lease is preferred because it acts as a safety check: it refuses to overwrite commits on origin that you haven't seen locally yet, protecting against accidentally clobbering someone else's work.

Full workflow recap:

git fetch origin dev
git rebase origin/dev
# resolve any conflicts, then:
git push --force-with-lease origin copilot/improve-maintenance-handling

Since this is a Copilot-owned branch and the only collaborator is you, --force-with-lease and --force are equivalent here, but --force-with-lease is the habit worth keeping.

@freephile freephile force-pushed the copilot/improve-maintenance-handling branch from b41c1f9 to b83a540 Compare April 9, 2026 12:55
@sonarqubecloud

sonarqubecloud Bot commented Apr 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Improve maintenance handling

2 participants