pulpcore 3.82.1__py3-none-any.whl → 3.83.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulpcore might be problematic. Click here for more details.

@@ -6,6 +6,6 @@ class PulpCertGuardPluginAppConfig(PulpPluginAppConfig):
6
6
 
7
7
  name = "pulp_certguard.app"
8
8
  label = "certguard"
9
- version = "3.82.1"
9
+ version = "3.83.1"
10
10
  python_package_name = "pulpcore"
11
11
  domain_compatible = True
pulp_file/app/__init__.py CHANGED
@@ -8,6 +8,6 @@ class PulpFilePluginAppConfig(PulpPluginAppConfig):
8
8
 
9
9
  name = "pulp_file.app"
10
10
  label = "file"
11
- version = "3.82.1"
11
+ version = "3.83.1"
12
12
  python_package_name = "pulpcore"
13
13
  domain_compatible = True
pulpcore/app/apps.py CHANGED
@@ -247,7 +247,7 @@ class PulpAppConfig(PulpPluginAppConfig):
247
247
  label = "core"
248
248
 
249
249
  # The version of this app
250
- version = "3.82.1"
250
+ version = "3.83.1"
251
251
 
252
252
  # The python package name providing this app
253
253
  python_package_name = "pulpcore"
@@ -0,0 +1,21 @@
1
+ # Generated by Django 4.2.16 on 2025-07-10 14:53
2
+
3
+ import django.contrib.postgres.fields
4
+ from django.db import migrations, models
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+
9
+ dependencies = [
10
+ ("core", "0132_task_profile_options"),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.AddField(
15
+ model_name="repositoryversion",
16
+ name="content_ids",
17
+ field=django.contrib.postgres.fields.ArrayField(
18
+ base_field=models.UUIDField(), default=None, null=True, size=None
19
+ ),
20
+ ),
21
+ ]
@@ -11,11 +11,11 @@ import logging
11
11
  import django
12
12
  from asyncio_throttle import Throttler
13
13
  from django.conf import settings
14
- from django.contrib.postgres.fields import HStoreField
14
+ from django.contrib.postgres.fields import HStoreField, ArrayField
15
15
  from django.core.validators import MinValueValidator
16
16
  from django.db import models, transaction
17
17
  from django.db.models import F, Func, Q, Value
18
- from django_lifecycle import AFTER_UPDATE, BEFORE_DELETE, hook
18
+ from django_lifecycle import AFTER_UPDATE, BEFORE_CREATE, BEFORE_DELETE, hook
19
19
  from rest_framework.exceptions import APIException
20
20
 
21
21
  from pulpcore.app.util import (
@@ -771,6 +771,7 @@ class RepositoryVersionQuerySet(models.QuerySet):
771
771
  Returns:
772
772
  django.db.models.QuerySet: Repository versions which contains content.
773
773
  """
774
+ # TODO: Evaluate if this can be optimized with content_ids field
774
775
  query = models.Q(pk__in=[])
775
776
  repo_content = RepositoryContent.objects.filter(content__pk__in=content)
776
777
 
@@ -822,6 +823,7 @@ class RepositoryVersion(BaseModel):
822
823
  complete = models.BooleanField(db_index=True, default=False)
823
824
  base_version = models.ForeignKey("RepositoryVersion", null=True, on_delete=models.SET_NULL)
824
825
  info = models.JSONField(default=dict)
826
+ content_ids = ArrayField(models.UUIDField(), default=None, null=True)
825
827
 
826
828
  class Meta:
827
829
  default_related_name = "versions"
@@ -840,6 +842,31 @@ class RepositoryVersion(BaseModel):
840
842
  repository_id=self.repository_id, version_added__number__lte=self.number
841
843
  ).exclude(version_removed__number__lte=self.number)
842
844
 
845
+ def _get_content_ids(self):
846
+ """
847
+ Returns the content ids for a repository version
848
+ """
849
+ if self.content_ids is not None:
850
+ return self.content_ids
851
+ return self._content_relationships().values_list("content_id", flat=True)
852
+
853
+ @hook(BEFORE_CREATE)
854
+ def set_content_ids(self):
855
+ """
856
+ Sets the content ids for the new repository version based on the previous version.
857
+ """
858
+ try:
859
+ previous = self.previous()
860
+ except self.DoesNotExist:
861
+ pass
862
+ else:
863
+ if previous.content_ids is not None:
864
+ self.content_ids = previous.content_ids
865
+ if self.content_ids is None:
866
+ self.content_ids = list(
867
+ self._content_relationships().values_list("content_id", flat=True)
868
+ )
869
+
843
870
  def get_content(self, content_qs=None):
844
871
  """
845
872
  Returns a set of content for a repository version
@@ -863,7 +890,15 @@ class RepositoryVersion(BaseModel):
863
890
  if content_qs is None:
864
891
  content_qs = Content.objects
865
892
 
866
- return content_qs.filter(pk__in=self._content_relationships().values_list("content_id"))
893
+ content_ids = self._get_content_ids()
894
+ if isinstance(content_ids, list) and len(content_ids) >= 65535:
895
+ # Workaround for PostgreSQL's limit on the number of parameters in a query
896
+ content_ids = (
897
+ RepositoryVersion.objects.filter(pk=self.pk)
898
+ .annotate(cids=Func(F("content_ids"), function="unnest"))
899
+ .values_list("cids", flat=True)
900
+ )
901
+ return content_qs.filter(pk__in=content_ids)
867
902
 
868
903
  @property
869
904
  def content(self):
@@ -977,9 +1012,9 @@ class RepositoryVersion(BaseModel):
977
1012
  if not base_version:
978
1013
  return Content.objects.filter(version_memberships__version_added=self)
979
1014
 
980
- return Content.objects.filter(
981
- version_memberships__in=self._content_relationships()
982
- ).exclude(version_memberships__in=base_version._content_relationships())
1015
+ return Content.objects.filter(pk__in=self._get_content_ids()).exclude(
1016
+ pk__in=base_version._get_content_ids()
1017
+ )
983
1018
 
984
1019
  def removed(self, base_version=None):
985
1020
  """
@@ -992,9 +1027,9 @@ class RepositoryVersion(BaseModel):
992
1027
  if not base_version:
993
1028
  return Content.objects.filter(version_memberships__version_removed=self)
994
1029
 
995
- return Content.objects.filter(
996
- version_memberships__in=base_version._content_relationships()
997
- ).exclude(version_memberships__in=self._content_relationships())
1030
+ return Content.objects.filter(pk__in=base_version._get_content_ids()).exclude(
1031
+ pk__in=self._get_content_ids()
1032
+ )
998
1033
 
999
1034
  def contains(self, content):
1000
1035
  """
@@ -1003,6 +1038,8 @@ class RepositoryVersion(BaseModel):
1003
1038
  Returns:
1004
1039
  bool: True if the repository version contains the content, False otherwise
1005
1040
  """
1041
+ if self.content_ids is not None:
1042
+ return content.pk in self.content_ids
1006
1043
  return self.content.filter(pk=content.pk).exists()
1007
1044
 
1008
1045
  def add_content(self, content):
@@ -1026,9 +1063,10 @@ class RepositoryVersion(BaseModel):
1026
1063
  .exists()
1027
1064
  )
1028
1065
  repo_content = []
1029
- to_add = set(content.values_list("pk", flat=True)) - set(
1030
- self.content.values_list("pk", flat=True)
1031
- )
1066
+ to_add = set(content.values_list("pk", flat=True)) - set(self._get_content_ids())
1067
+ if to_add:
1068
+ self.content_ids += list(to_add)
1069
+ self.save()
1032
1070
 
1033
1071
  # Normalize representation if content has already been removed in this version and
1034
1072
  # is re-added: Undo removal by setting version_removed to None.
@@ -1071,6 +1109,11 @@ class RepositoryVersion(BaseModel):
1071
1109
  .exclude(pulp_domain_id=get_domain_pk())
1072
1110
  .exists()
1073
1111
  )
1112
+ content_ids = set(self._get_content_ids())
1113
+ to_remove = set(content.values_list("pk", flat=True))
1114
+ if to_remove:
1115
+ self.content_ids = list(content_ids - to_remove)
1116
+ self.save()
1074
1117
 
1075
1118
  # Normalize representation if content has already been added in this version.
1076
1119
  # Undo addition by deleting the RepositoryContent.
@@ -268,7 +268,7 @@ class RepositoryVersionIdentityField(RepositoryVersionFieldGetURLMixin, Identity
268
268
 
269
269
 
270
270
  class RepositoryVersionRelatedField(RepositoryVersionFieldGetURLMixin, RelatedField):
271
- queryset = models.RepositoryVersion.objects.all()
271
+ queryset = models.RepositoryVersion.objects.all().defer("content_ids")
272
272
 
273
273
  def get_object(self, view_name, view_args, view_kwargs):
274
274
  lookup_kwargs = {
@@ -234,7 +234,7 @@ class RepositoryVersionQuerysetMixin:
234
234
  """A mixin to hold the shared get_queryset logic used by RepositoryVersionViewSets."""
235
235
 
236
236
  def get_queryset(self):
237
- qs = super().get_queryset()
237
+ qs = super().get_queryset().defer("content_ids")
238
238
  if getattr(self, "action", "") == "list":
239
239
  # Fetch info for repository (DetailRelatedField),
240
240
  # base_version (RepositoryVersionRelatedField), and
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pulpcore
3
- Version: 3.82.1
3
+ Version: 3.83.1
4
4
  Summary: Pulp Django Application and Related Modules
5
5
  Author-email: Pulp Team <pulp-list@redhat.com>
6
6
  Project-URL: Homepage, https://pulpproject.org
@@ -50,7 +50,7 @@ Requires-Dist: opentelemetry-api<1.35,>=1.27.0
50
50
  Requires-Dist: opentelemetry-sdk<1.35,>=1.27.0
51
51
  Requires-Dist: opentelemetry-exporter-otlp-proto-http<1.35,>=1.27.0
52
52
  Requires-Dist: protobuf<6.0,>=4.21.1
53
- Requires-Dist: pulp-glue<0.34,>=0.28.0
53
+ Requires-Dist: pulp-glue<0.35,>=0.28.0
54
54
  Requires-Dist: pygtrie<=2.5.0,>=2.5
55
55
  Requires-Dist: psycopg[binary]<3.3,>=3.1.8
56
56
  Requires-Dist: pyparsing<3.3,>=3.1.0
@@ -59,7 +59,7 @@ Requires-Dist: PyYAML<6.1,>=5.1.1
59
59
  Requires-Dist: redis<5.3,>=4.3.0
60
60
  Requires-Dist: tablib<3.6,>=3.5.0
61
61
  Requires-Dist: url-normalize<2.3,>=1.4.3
62
- Requires-Dist: uuid6<=2025.0.0,>=2023.5.2
62
+ Requires-Dist: uuid6<=2025.0.1,>=2023.5.2
63
63
  Requires-Dist: whitenoise<6.10.0,>=5.0
64
64
  Requires-Dist: yarl<1.21,>=1.8
65
65
  Provides-Extra: sftp
@@ -1,6 +1,6 @@
1
1
  pulp_certguard/__init__.py,sha256=llnEd00PrsAretsgAOHiNKFbmvIdXe3iDVPmSaKz7gU,71
2
2
  pulp_certguard/pytest_plugin.py,sha256=qhRbChzqN2PROtD-65KuoTfKr5k9T3GPsz9daFgpqpM,852
3
- pulp_certguard/app/__init__.py,sha256=pNyBv0z5czCjZBLtlgnrA0PMQl6eSSSJvf288RYZImY,297
3
+ pulp_certguard/app/__init__.py,sha256=9lqYVKMjF3C3ofxQYAeZaSHCsMQorTCmrdowYOoQuXQ,297
4
4
  pulp_certguard/app/models.py,sha256=xy5IWxf0LQxayIDmQw25Y2YhB_NrlTGvuvdY-YW7QBU,8119
5
5
  pulp_certguard/app/serializers.py,sha256=3jxWu82vU3xA578Qbyz-G4Q9Zlh3MFLGRHzX62M0RF8,1826
6
6
  pulp_certguard/app/utils.py,sha256=O6T1Npdb8fu3XqIkDJd8PQdEFJWPUeQ-i_aHXBl7MEc,816
@@ -49,7 +49,7 @@ pulp_certguard/tests/unit/test_models.py,sha256=TBI0yKsrdbnJSPeBFfxSqhXK7zaNvR6q
49
49
  pulp_file/__init__.py,sha256=0vOCXofR6Eyxkg4y66esnOGPeESCe23C1cNBHj56w44,61
50
50
  pulp_file/manifest.py,sha256=1WwIOJrPSkFcmkRm7CkWifVOCoZvo_nnANgce6uuG7U,3796
51
51
  pulp_file/pytest_plugin.py,sha256=l1PvTxUi5D3uJy4SnHWNhr-otWEYNcm-kc5nSqVJg0Y,10646
52
- pulp_file/app/__init__.py,sha256=IYW8CDg6mH55FE9f_nL4g99mtza5qwz0z_QaaD_vl28,292
52
+ pulp_file/app/__init__.py,sha256=NcMQ_zQr9KMd9sr7EVTGdO4y-iJjD7q7iXpmA_XD_k8,292
53
53
  pulp_file/app/modelresource.py,sha256=v-m-_bBEsfr8wG0TI5ffx1TuKUy2-PsirhuQz4XXF-0,1063
54
54
  pulp_file/app/models.py,sha256=QsrVg_2uKqnR89sLN2Y7Zy260_nLIcUfa94uZowlmFw,4571
55
55
  pulp_file/app/replica.py,sha256=OtNWVmdFUgNTYhPttftVNQnSrnvx2_hnrJgtW_G0Vrg,1894
@@ -110,7 +110,7 @@ pulpcore/pytest_plugin.py,sha256=skubiEUIevVURr4LnmmVMt_ZeH5vT9mI0yiPUYerMnQ,380
110
110
  pulpcore/responses.py,sha256=mIGKmdCfTSoZxbFu4yIH1xbdLx1u5gqt3D99LTamcJg,6125
111
111
  pulpcore/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
112
  pulpcore/app/access_policy.py,sha256=5vCKy6WoHtIt1_-eS5vMaZ7CmR4G-CIpsrB8yT-d88Q,6079
113
- pulpcore/app/apps.py,sha256=k2nBGyQR2utg5pRERo-8aN-pZhbrAwkmRWgCHMRbCnA,17860
113
+ pulpcore/app/apps.py,sha256=jedKiIXxch0HiRB-mnZn88uTBdjadPF364m4r3VJTo8,17860
114
114
  pulpcore/app/authentication.py,sha256=1LIJW6HIQQlZrliHy__jdzkDEh6Oj7xKgd0V-vRcDus,2855
115
115
  pulpcore/app/checks.py,sha256=jbfTF7nmftBbky4AQXHigpyCaGydKasvRUXsd72JZVg,1946
116
116
  pulpcore/app/entrypoint.py,sha256=YIfQpM5UxybBTasiEY5ptq--UmqPqjdIGnwmqVsDC7E,4972
@@ -285,6 +285,7 @@ pulpcore/app/migrations/0130_upstreampulp_policy.py,sha256=PLpgBU6iXTl7gruCe12aA
285
285
  pulpcore/app/migrations/0131_distribution_checkpoint_publication_checkpoint.py,sha256=MXZXQapnSXVfV9FFiIaoMb6M7qAnAJwtEmN6hSlJ8RQ,561
286
286
  pulpcore/app/migrations/0132_alter_content_options.py,sha256=hrhUTsRqQJgwC6wU9Ys5AvyVz2YCzklj2OuVf6hyBfs,477
287
287
  pulpcore/app/migrations/0132_task_profile_options.py,sha256=ljdIm5-NXl_8s87HzkthvUxr7eHhLaETrr5qNtAVKDE,518
288
+ pulpcore/app/migrations/0133_repositoryversion_content_ids.py,sha256=P8H16p6-EWtnyoenomC4R8CvAivfPqUkkRAsoizgm2M,545
288
289
  pulpcore/app/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
289
290
  pulpcore/app/models/__init__.py,sha256=9JKMGKbEV6nJPep_K36rnWnS1QWMKBFSty-Hkr65JVk,3459
290
291
  pulpcore/app/models/access_policy.py,sha256=o4L41RGoZ5UMmh5UeeenmadD5MJgShguphgd4eAVxQA,6071
@@ -301,7 +302,7 @@ pulpcore/app/models/openpgp.py,sha256=3R5p8ZBPq63NzaE2_EwCXEMYPUQu7QUWanMcKCOoWk
301
302
  pulpcore/app/models/progress.py,sha256=osD0cqPWC5oaebKgjpaOLY6tgv1bpjA66ty7nr8TaLU,13499
302
303
  pulpcore/app/models/publication.py,sha256=Ltiwylew7OOrobQRjdy1p6NbppBMXD2uX_IC2Ybgl7E,28869
303
304
  pulpcore/app/models/replica.py,sha256=i_wPxyPaVWpEVTJNVjJsBarxFauqeagtuwLadsmVz-g,2067
304
- pulpcore/app/models/repository.py,sha256=xBMKsryirkpZyrQHnFbwolNbvyX1jHljcqC1ofvkD7A,56185
305
+ pulpcore/app/models/repository.py,sha256=ILEl0YCGL_h-rA42fdKzf-zBFHWRtNoLfk3wV1VH-rE,57850
305
306
  pulpcore/app/models/role.py,sha256=dZklNd2VeAw4cT6dyJ7SyTBt9sZvdqakY86wXGAY3vU,3287
306
307
  pulpcore/app/models/status.py,sha256=72oUOJ7BnCAw3uDbc-XuI72oAyP2llCoBic4zb2JP78,3683
307
308
  pulpcore/app/models/storage.py,sha256=2b-DQWaO31NqjV6FiISALegND-sQZAU7BVAsduUvm3o,6780
@@ -316,7 +317,7 @@ pulpcore/app/serializers/base.py,sha256=ojWmsr2U2Mx8qpSFxqHLNQyfU2Z9q7hY1NUwVs9s
316
317
  pulpcore/app/serializers/content.py,sha256=TKEh774Q-0l1AfUeMmVxPM5lk5UiYZxgkt9NU1RjZ9M,11966
317
318
  pulpcore/app/serializers/domain.py,sha256=y2qXdf2gSvWH5UtYULhX390u6wWmegg-GD9g5QwqZJA,22758
318
319
  pulpcore/app/serializers/exporter.py,sha256=TxAgHDt34YUGPusawn7B8HL3bBymp46__6CnfhXSgGs,11179
319
- pulpcore/app/serializers/fields.py,sha256=kWA6wYNA8dYmDJfFE_3eVUQRj4vCceqjzYPEEP53rxA,16481
320
+ pulpcore/app/serializers/fields.py,sha256=Ql-DXvOFWrJ98ISB-6GGR19K2FD2WNkvV2dJDeTPURM,16502
320
321
  pulpcore/app/serializers/importer.py,sha256=PVSNs5U0dfAm-XlRKpMqOXK0VmUErxJauNJCNro6ONA,8200
321
322
  pulpcore/app/serializers/openpgp.py,sha256=3Svxskj_-HmOVbjay7QI82zXnKTsbtaSlZZ03CoT-MQ,8966
322
323
  pulpcore/app/serializers/orphans.py,sha256=Vhyaj0fqYT4pkiYoNjgmsy1u5BiR_aHwZm2y7rk9cbk,1967
@@ -367,7 +368,7 @@ pulpcore/app/viewsets/orphans.py,sha256=wArGxXMBdvRO3D_MMwlqd1kZkXrLNEFoUOEJDkVT
367
368
  pulpcore/app/viewsets/publication.py,sha256=5os3PVMs0Z7oRJX5HkQ7U8JojLengq7rYCUdVZ7PJd8,19443
368
369
  pulpcore/app/viewsets/reclaim.py,sha256=s8eURE5LItYBwo8c3aBou5SgclnXfDm0-KOW2seIzHQ,1757
369
370
  pulpcore/app/viewsets/replica.py,sha256=SOzcl30r-X5I5Ia_IZlb3BBGC31UqnMSf8uipgPC2sg,4981
370
- pulpcore/app/viewsets/repository.py,sha256=e6oHiLUzF6DcWhu9SttFTftcklYc1jTfY57QLl9AqD0,12954
371
+ pulpcore/app/viewsets/repository.py,sha256=kRk1Ww61bvTiKVTz_o9Gr4sSJcM2s5CXvcYCF8A_Br4,12975
371
372
  pulpcore/app/viewsets/task.py,sha256=pMoOQnhjA91dUgNNAnL3OaCHcVOrQcB-CD3D5Px96YE,16753
372
373
  pulpcore/app/viewsets/upload.py,sha256=Mfy9Vcm5KcqARooH4iExzoXVkL6boDddEqAnGWDWzFg,5452
373
374
  pulpcore/app/viewsets/user.py,sha256=86eMawpaVrvp6ilQmb1C4j7SKpesPB5HgMovYL9rY3Q,13813
@@ -531,9 +532,9 @@ pulpcore/tests/unit/stages/test_artifactdownloader.py,sha256=qB1ANdFmNtUnljg8fCd
531
532
  pulpcore/tests/unit/stages/test_stages.py,sha256=H1a2BQLjdZlZvcb_qULp62huZ1xy6ItTcthktVyGU0w,4735
532
533
  pulpcore/tests/unit/viewsets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
533
534
  pulpcore/tests/unit/viewsets/test_viewset_base.py,sha256=W9o3V6758bZctR6krMPPQytb0xJuF-jb4uBWTNDoD_U,4837
534
- pulpcore-3.82.1.dist-info/licenses/LICENSE,sha256=dhnHU8rJXUdAIgIjveSKAyYG_KzN5eVG-bxETIGrNW0,17988
535
- pulpcore-3.82.1.dist-info/METADATA,sha256=RE9gUWyhJMLJOzYptD2cTBtbQ3IkRgtzf2PnTC82muY,4320
536
- pulpcore-3.82.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
537
- pulpcore-3.82.1.dist-info/entry_points.txt,sha256=OZven4wzXzQA5b5q9MpP4HUpIPPQCSvIOvkKtNInrK0,452
538
- pulpcore-3.82.1.dist-info/top_level.txt,sha256=6h-Lm3FKQSaT_nL1KSxu_hBnzKE15bcvf_BoU-ea4CI,34
539
- pulpcore-3.82.1.dist-info/RECORD,,
535
+ pulpcore-3.83.1.dist-info/licenses/LICENSE,sha256=dhnHU8rJXUdAIgIjveSKAyYG_KzN5eVG-bxETIGrNW0,17988
536
+ pulpcore-3.83.1.dist-info/METADATA,sha256=ZmxqQriPmEEvxKJj4V-W9BOxkIOOfyvVeVZpL7SgA98,4320
537
+ pulpcore-3.83.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
538
+ pulpcore-3.83.1.dist-info/entry_points.txt,sha256=OZven4wzXzQA5b5q9MpP4HUpIPPQCSvIOvkKtNInrK0,452
539
+ pulpcore-3.83.1.dist-info/top_level.txt,sha256=6h-Lm3FKQSaT_nL1KSxu_hBnzKE15bcvf_BoU-ea4CI,34
540
+ pulpcore-3.83.1.dist-info/RECORD,,