[PR #7170/20f3b7a7 backport][3.73] [PULP-1004] [backport/3.85] Expose RepositoryVersionSerializer in the plugin API #7171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #7170 as merged into 3.85 (20f3b7a).
In pulpcore 3.88 it was added a feature that would the return value of task functions, and those return must be serializable or None.
In 3.100 that would be required by pulpcore, so plugins that wante to adapt before might use the RepositoryVersionSerializer. In this case, regardless of whether pulpcore >=3.88 or <3.88 is used, the plugin must be able to import the serializer or it will throw a runtime import error.
Example on pulp-ostree CI, installation step of lowerbounds scenario(pulpcore 3.49):
------ > [4/5] RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost /usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link: 0.846 File "<frozen importlib._bootstrap_external>", line 940, in exec_module 0.846 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed 0.846 File "/usr/local/lib/python3.11/site-packages/pulp_ostree/app/viewsets.py", line 25, in <module> 0.846 from . import models, serializers, tasks 0.846 File "/usr/local/lib/python3.11/site-packages/pulp_ostree/app/tasks/__init__.py", line 1, in <module> 0.846 from .synchronizing import synchronize # noqa 0.846 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 0.846 File "/usr/local/lib/python3.11/site-packages/pulp_ostree/app/tasks/synchronizing.py", line 23, in <module> 0.846 from pulpcore.plugin.serializers import RepositoryVersionSerializer 0.846 ImportError: cannot import name 'RepositoryVersionSerializer' from 'pulpcore.plugin.serializers' (/usr/local/lib/python3.11/site-packages/pulpcore/plugin/serializers/__init__.py) ------ Containerfile:16Source: https://github.com/pulp/pulp_ostree/actions/runs/20372911840/job/58544021745?pr=475#step:12:827