Skip to content

Conversation

@pedro-psb
Copy link
Member

@pedro-psb pedro-psb commented Dec 19, 2025

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:16

Source: https://github.com/pulp/pulp_ostree/actions/runs/20372911840/job/58544021745?pr=475#step:12:827

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.
@pedro-psb pedro-psb changed the title [backport/3.85] Expose RepositoryVersionSerializer in the plugin API [PULP-1004] [backport/3.85] Expose RepositoryVersionSerializer in the plugin API Dec 19, 2025
@pedro-psb pedro-psb enabled auto-merge (rebase) December 19, 2025 16:56
@pedro-psb pedro-psb merged commit 20f3b7a into pulp:3.85 Dec 19, 2025
13 checks passed
@patchback
Copy link

patchback bot commented Dec 19, 2025

Backport to 3.49: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 20f3b7a on top of patchback/backports/3.49/20f3b7a7d01675fc4dcc08ccb8580e1a50a01012/pr-7170

Backporting merged PR #7170 into 3.85

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/pulp/pulpcore.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.49/20f3b7a7d01675fc4dcc08ccb8580e1a50a01012/pr-7170 upstream/3.49
  4. Now, cherry-pick PR [PULP-1004] [backport/3.85] Expose RepositoryVersionSerializer in the plugin API #7170 contents into that branch:
    $ git cherry-pick -x 20f3b7a7d01675fc4dcc08ccb8580e1a50a01012
    If it'll yell at you with something like fatal: Commit 20f3b7a7d01675fc4dcc08ccb8580e1a50a01012 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 20f3b7a7d01675fc4dcc08ccb8580e1a50a01012
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR [PULP-1004] [backport/3.85] Expose RepositoryVersionSerializer in the plugin API #7170 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.49/20f3b7a7d01675fc4dcc08ccb8580e1a50a01012/pr-7170
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link

patchback bot commented Dec 19, 2025

Backport to 3.63: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 20f3b7a on top of patchback/backports/3.63/20f3b7a7d01675fc4dcc08ccb8580e1a50a01012/pr-7170

Backporting merged PR #7170 into 3.85

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/pulp/pulpcore.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.63/20f3b7a7d01675fc4dcc08ccb8580e1a50a01012/pr-7170 upstream/3.63
  4. Now, cherry-pick PR [PULP-1004] [backport/3.85] Expose RepositoryVersionSerializer in the plugin API #7170 contents into that branch:
    $ git cherry-pick -x 20f3b7a7d01675fc4dcc08ccb8580e1a50a01012
    If it'll yell at you with something like fatal: Commit 20f3b7a7d01675fc4dcc08ccb8580e1a50a01012 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 20f3b7a7d01675fc4dcc08ccb8580e1a50a01012
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR [PULP-1004] [backport/3.85] Expose RepositoryVersionSerializer in the plugin API #7170 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.63/20f3b7a7d01675fc4dcc08ccb8580e1a50a01012/pr-7170
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link

patchback bot commented Dec 19, 2025

Backport to 3.73: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.73/20f3b7a7d01675fc4dcc08ccb8580e1a50a01012/pr-7170

Backported as #7171

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants