housekeep: stop "pkgmaint" script (cron job)

With the removal of the "setup-repo" command this script becomes obsolete,
because it is not possible to reserve a repo anymore.
Hence we don't need cleanup.

We've also seen issues in case the last packager's user account is removed,
leading to the deletion of a Package.

Let's deactivate this for now.

Issue report: #425

Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
moson-mo 2023-02-09 19:09:07 +01:00
parent b1a9efd552
commit 8d2e176c2f
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
2 changed files with 15 additions and 4 deletions

View file

@ -17,6 +17,12 @@ def _main():
def main():
# Previously used to clean up "reserved" packages which never got pushed.
# Let's deactivate this for now since "setup-repo" is gone and we see
# other issue where deletion of a user account might cause unintended
# removal of a package (where PackagerUID account was deleted)
return
db.get_engine()
with db.begin():
_main()

View file

@ -62,7 +62,12 @@ def test_pkgmaint(packages: list[Package]):
# Query package objects again and assert that the
# first package was deleted but all others are intact.
packages = db.query(Package).all()
assert len(packages) == 4
expected = ["pkg_1", "pkg_2", "pkg_3", "pkg_4"]
for i, pkgname in enumerate(expected):
assert packages[i].Name == pkgname
# !Cleanup of packages without last packager deactivated.
# We should still have 5 packages
assert len(packages) == 5
# assert len(packages) == 4
# expected = ["pkg_1", "pkg_2", "pkg_3", "pkg_4"]
# for i, pkgname in enumerate(expected):
# assert packages[i].Name == pkgname