fix: prune RPM metadata when a local file is evicted #100

Merged
benvin merged 1 commits from benvin/rpm-metadata-evict-cleanup into master 2026-07-03 14:54:28 +10:00

1 Commits

Author SHA1 Message Date
unkinben 808015f6bb fix: prune RPM metadata when a local file is evicted
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
Evicting or deleting a local RPM removed the local_files row but left its
rpm_metadata behind, so generated repodata kept listing a package that no
longer exists. Deletes now run a provider cleanup hook symmetric to the
existing upload hook.

- add PostDeleteHook and MetadataDeleter provider interfaces, plus a
  DeleteRPMMetadata DB method
- implement AfterDelete in the RPM provider to drop the metadata row
- route both local delete paths (evictLocal and the files handler) through
  a shared deleteLocalFile helper that removes the file then runs the hook
- cover the cleanup with a dockerised test
2026-07-03 14:50:04 +10:00