Page MenuHomePhabricator

[wikireplicas] Refactor maintenance scripts to allow local testing
Closed, ResolvedPublic

Description

As far as I know, maintain-views.py, maintain-meta_p.py and maintain_replica_indexes.py were never tested locally but always directly against a live wiki replica database.

This task is to track the required refactor to make it possible to run the scripts against a local database.

We should also add a basic Tox configuration to run automated tests.

Running the automated tests on the CI for operations/puppet is probably going to be more difficult, because they will require a MariaDB
container they can connect to, and I don't know how to run that in Jenkins/Zuul. We could consider migrating these scripts to a GitLab repo.

Event Timeline

Change #1148358 had a related patch set uploaded (by FNegri; author: FNegri):

[operations/puppet@production] wikireplicas: remove dashes from script names

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

Change #1150715 had a related patch set uploaded (by FNegri; author: FNegri):

[operations/puppet@production] wikireplicas: split db config from maintain-views

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

Change #1148394 had a related patch set uploaded (by FNegri; author: FNegri):

[operations/puppet@production] wikireplicas scripts: setup pytest, add first test

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

fnegri changed the task status from Open to In Progress.May 26 2025, 4:24 PM
fnegri moved this task from Backlog to Wiki replicas on the Data-Services board.

Change #1148358 merged by FNegri:

[operations/puppet@production] wikireplicas: remove dashes from script names

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

Change #1151656 had a related patch set uploaded (by FNegri; author: FNegri):

[operations/puppet@production] wikireplicas: split db config into separate file

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

Change #1150715 abandoned by FNegri:

[operations/puppet@production] wikireplicas: split db config into separate file

Reason:

Replaced by I59ab4faf8481d912dcb4bd9fa715df7893a78873

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

Change #1151656 abandoned by FNegri:

[operations/puppet@production] wikireplicas: split db config into separate file

Reason:

The db config used to be the only templated part, but now we also template the "fullviews" definition, so I need a different approach.

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

Change #1148394 abandoned by FNegri:

[operations/puppet@production] wikireplicas scripts: setup pytest, add first test

Reason:

I created https://gitlab.wikimedia.org/repos/cloud/wikireplicas-utils and I'm migrating the changes from this patch to there.

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

Change #1179728 had a related patch set uploaded (by FNegri; author: FNegri):

[operations/puppet@production] aptrepo: import wikireplicas-utils from apt-staging

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

Change #1179728 merged by FNegri:

[operations/puppet@production] aptrepo: import wikireplicas-utils from apt-staging

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

Change #1180121 had a related patch set uploaded (by FNegri; author: FNegri):

[operations/puppet@production] wikireplicas: install scripts from deb package

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

Change #1180121 merged by FNegri:

[operations/puppet@production] wikireplicas: install scripts from deb package

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

Change #1180157 had a related patch set uploaded (by FNegri; author: FNegri):

[operations/cookbooks@master] sre.wikireplicas.add-wiki: update script paths

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

Change #1180157 merged by jenkins-bot:

[operations/cookbooks@master] sre.wikireplicas.add-wiki: update script paths

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

fnegri moved this task from In progress to Done on the cloud-services-team (FY2025/2026-Q1-Q2) board.

The scripts were migrated to the new https://gitlab.wikimedia.org/repos/cloud/wikireplicas-utils repo and they now have a basic testing setup including CI.
This task can be resolved, follow-up work will be tracked in separate tickets, e.g. T351637: [wikireplicas] add proper dry-run/diff mode to maintain-views.