[action required] Plugins should use django's new STORAGE config for 3.70

Does this apply to me?

Some work has been done in pulpcore. Still, some action is required and some may be required.

Requried:

  1. Configure CI to exercises the new STORAGES in at least 1 scenario (e.g, S3). Some scenario should still keep the legacy. Reason: both should be supported for the period [3.70, 3.85). Must happen on the PR declaring 3.70 compatibility.

Conditionally required: edit: Only pulp_container and pulp_ansible required some. PRs are open.

2. If plugin uses settings.DEFAULT_FILE_STORAGE or settings.STATICFILE_STORAGE explicitly, replace legacy with new.
3. If plugin uses settings imported globally on AppConfig ({plugin}/app/__init__.py) and uses that on signal handlers, move that to in-class.

For more context: Django `DEFAULT_FILE_STORAGE` deprecated · Issue #5404 · pulp/pulpcore · GitHub

How to do it?

For the respective cases:
1. Edit the .ci/ansible/settings.py.j2 file (dont apply anymore)

  1. Edit ./template_config.yml and apply plugin-template (example after plugin-template applied)
  2. Replace occurrences of the legacy config:
    -settings.DEFAULT_FILE_STORAGE
    +settings.STORAGES["default"]["BACKEND"]
    
    -settings.STATICFILES_STORAGE
    +settings.STORAGES["staticfiles"]["BACKEND"]
    
  3. Move the settings import from module-level to class-level (instantiation time)

When should this happen?

  • 1: On the PR declaring 3.70 compatibility.
  • 2 and 3: Before or on the PR declaring 3.70 core compatibility.
2 Likes

Issues tracking (this is editable by anyone):

2 Likes

Step 1 procedure was updated to use plugin-template.
Do this when when declaring compat with core 3.70.

1 Like