pypi / warehouse

The Python Package Index
https://pypi.org
Apache License 2.0
3.54k stars 955 forks source link

Missing Purges #3383

Closed ewdurbin closed 6 years ago

ewdurbin commented 6 years ago

Noticed this while setting up new mirror. We don't seem to be purging project/<normalized_name> key when projects are deleted.

This leads bandersnatch to get confused and fall behind until the key is purged so the JSON api returns a 404

ewdurbin commented 6 years ago

Also appears to miss purges due to maintainership changes and _pypi_hidden (legacy) changes.

dstufft commented 6 years ago

Legacy doesn't purge Warehouse at all

ewdurbin commented 6 years ago

I think we should just disable editing anything but pypi_hidden on legacy, and disable the journal entry for it then @dstufft ?

dstufft commented 6 years ago

fine with me, pypi_hidden is useless in warehouse anyways.

ewdurbin commented 6 years ago

👍

ewdurbin commented 6 years ago

pypi-legacy interference resolved in https://github.com/pypa/pypi-legacy/pull/785

Still need maintainer changes to purge project/ keys though.

di commented 6 years ago

Should just require adding:

    config.register_origin_cache_keys(
         Role,
         purge_keys=[
             key_factory("user/{obj.user.username}"),
             key_factory("project/{obj.project.normalized_name}")
         ],
     )