Scope signed package components to repository - #1494
Conversation
47e3ae6 to
5621752
Compare
977c942 to
757e5c0
Compare
Prevent package signing from adding release-component associations belonging to other repositories. fixes pulp#1493 Assisted-by: GitHub Copilot
757e5c0 to
27d001d
Compare
quba42
left a comment
There was a problem hiding this comment.
Code wise this LGTM. I really just wanted to still test that the new test will fail without the fix. However, I ran into some trouble running the signing tests locally. I am getting:
$ oci-env test -i -p pulp_deb functional
Using Python 3.12.13 environment at: /usr
Checked 8 packages in 4ms
pytest is /usr/local/bin/pytest
=============================================== test session starts ===============================================
platform linux -- Python 3.12.13, pytest-7.4.4, pluggy-1.6.0
rootdir: /var/lib/pulp
plugins: xdist-3.8.0, timeout-2.4.0, custom-exit-code-0.3.0, pulpcore-3.116.0.dev0
collected 132 items / 1 error
===================================================== ERRORS ======================================================
__________________________________ ERROR collecting api/test_package_signing.py ___________________________________
pulp_deb/tests/functional/api/test_package_signing.py:10: in <module>
from pulp_deb.app.models import AptPackageSigningService
pulp_deb/app/models/__init__.py:3: in <module>
from .content.content import (
pulp_deb/app/models/content/content.py:16: in <module>
from pulpcore.plugin.models import Content
../pulpcore/pulpcore/plugin/models/__init__.py:6: in <module>
from pulpcore.app.models import (
../pulpcore/pulpcore/app/models/__init__.py:6: in <module>
from .base import (
../pulpcore/pulpcore/app/models/base.py:4: in <module>
from django.contrib.contenttypes.fields import GenericRelation
/usr/local/lib/python3.12/site-packages/django/contrib/contenttypes/fields.py:8: in <module>
from django.contrib.contenttypes.models import ContentType
/usr/local/lib/python3.12/site-packages/django/contrib/contenttypes/models.py:134: in <module>
class ContentType(models.Model):
/usr/local/lib/python3.12/site-packages/django/db/models/base.py:131: in __new__
app_config = apps.get_containing_app_config(module)
/usr/local/lib/python3.12/site-packages/django/apps/registry.py:260: in get_containing_app_config
self.check_apps_ready()
/usr/local/lib/python3.12/site-packages/django/apps/registry.py:138: in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
E django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================ 1 error in 3.24s =================================================
I am getting this error on main branch, on this issue branch, everywhere. If I remove pulp_deb/tests/functional/api/test_package_signing.py from my local repo, other tests run normally.
Any ideas (so I can finish this review)?
|
Also, given how this is a pretty serious bug (even if the feature is tech preview), I am thinking we should backport this to 3.10. Thoughts? |
|
Yea, backporting makes sense. I am working on a fix for the test issue you are running into here: #1496 |
quba42
left a comment
There was a problem hiding this comment.
So I have now seen the test fail without the fix and succeed with it. That plus my code review is good enough for me for this change.
Side Note: Apparently adding pulp_rpm to my oci_env had the side effect of fixing my local test run.
Prevent package signing from adding release-component associations belonging to other repositories.
fixes #1493