Page MenuHomePhabricator

scap backport should remove code for removed submodules
Closed, ResolvedPublic

Description

For example, the /srv/mediawiki-staging/fonts repo didn't get removed from the deployment server:

https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/723652/5#message-68f2e2d7f4564e39a84b27703751cedee5f9e88d

Event Timeline

Reedy triaged this task as Low priority.Jul 8 2023, 10:21 AM

On pulling git gives warning: unable to rmdir 'fonts': Directory not empty, but that is easy to miss out. The leftover directory is tentatively cleanable via git clean which knows how to take in account git ignore list or whether a subdirectory is tracked by git.

Then in dry run (--dry-run) node on production:

$ git clean --dry-run -d --force --force
Would remove wmf-config/scap

Which is a leftover empty directory not showing in git status (since it is empty). I will remove it.

Then git clean is easy to shoot oneself in the foot and given we only update submodules in operations/mediawiki-config every 3 years or so, I am tempted to skip implementing a cleanup step.

Mentioned in SAL (#wikimedia-operations) [2023-07-10T07:21:08Z] <hashar> deploy1002: removed empty untracked directory from MediaWiki staging area: rmdir /srv/mediawiki-staging/wmf-config/scap/log/ && rmdir /srv/mediawiki-staging/wmf-config/scap/ | T341292

hashar claimed this task.

Claimed that to be resolved after doing a manual git clean. I don't think we need to invest time in making scap to clean up the removal of submodules since we barely rely on them.