Skip to content

Commit

Permalink
Add pulpcore 3.25 compatibility
Browse files Browse the repository at this point in the history
closes #1277
  • Loading branch information
ipanova committed May 17, 2023
1 parent 37804f1 commit 4a0a780
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 13 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,11 @@ else
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_container.tests.functional -m 'not parallel' --nightly"


cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and parallel' -n 8 --nightly"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and not parallel' --nightly"

else
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_container.tests.functional -m parallel -n 8"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_container.tests.functional -m 'not parallel'"


cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and parallel' -n 8"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and not parallel'"

fi

fi
Expand Down
1 change: 1 addition & 0 deletions CHANGES/1277.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated compatibility for pulpcore 3.25 and Django 4.2.
152 changes: 152 additions & 0 deletions pulp_container/app/migrations/0035_alter_blob_content_ptr_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Generated by Django 4.2.1 on 2023-05-17 09:51

from django.db import migrations, models
import django.db.models.deletion
import pulpcore.app.models.base


class Migration(migrations.Migration):

dependencies = [
("core", "0106_alter_artifactdistribution_distribution_ptr_and_more"),
("container", "0034_translate_signed_schema"),
]

operations = [
migrations.AlterField(
model_name="blob",
name="content_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.content",
),
),
migrations.AlterField(
model_name="containerdistribution",
name="distribution_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.distribution",
),
),
migrations.AlterField(
model_name="containernamespace",
name="pulp_id",
field=models.UUIDField(
default=pulpcore.app.models.base.pulp_uuid,
editable=False,
primary_key=True,
serialize=False,
),
),
migrations.AlterField(
model_name="containerpushrepository",
name="manifest_signing_service",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="container.manifestsigningservice",
),
),
migrations.AlterField(
model_name="containerpushrepository",
name="repository_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.repository",
),
),
migrations.AlterField(
model_name="containerremote",
name="remote_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.remote",
),
),
migrations.AlterField(
model_name="containerrepository",
name="manifest_signing_service",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="container.manifestsigningservice",
),
),
migrations.AlterField(
model_name="containerrepository",
name="repository_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.repository",
),
),
migrations.AlterField(
model_name="manifest",
name="blobs",
field=models.ManyToManyField(through="container.BlobManifest", to="container.blob"),
),
migrations.AlterField(
model_name="manifest",
name="content_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.content",
),
),
migrations.AlterField(
model_name="manifest",
name="listed_manifests",
field=models.ManyToManyField(
through="container.ManifestListManifest", to="container.manifest"
),
),
migrations.AlterField(
model_name="manifestsignature",
name="content_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.content",
),
),
migrations.AlterField(
model_name="tag",
name="content_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="core.content",
),
),
]
4 changes: 2 additions & 2 deletions pulp_container/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Upload as CoreUpload,
)
from pulpcore.plugin.repo_version_utils import remove_duplicates, validate_repo_version
from pulpcore.plugin.util import verify_signature
from pulpcore.plugin.util import gpg_verify


from . import downloaders
Expand Down Expand Up @@ -458,7 +458,7 @@ def validate(self):
manifest_file.name, env_vars={"REFERENCE": "test", "SIG_PATH": sig_path}
)

verify_signature(signed["signature_path"], self.public_key)
gpg_verify(self.public_key, signed["signature_path"])


class ContainerRepository(
Expand Down
6 changes: 3 additions & 3 deletions pulp_container/tests/unit/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.test import TestCase
from django.conf import settings

from django_currentuser.middleware import _set_current_user
from pulpcore.plugin.util import set_current_user

from pulp_container.app.serializers import ContainerDistributionSerializer, TagOperationSerializer
from pulp_container.app.models import ContainerPushRepository, ContainerRepository
Expand All @@ -28,13 +28,13 @@ def setUp(self):
f"{V3_API_ROOT}repositories/container/container-push/{self.push_repository.pk}/"
)
self.user = get_user_model().objects.create(username="user1", is_staff=False)
_set_current_user(self.user)
set_current_user(self.user)

def tearDown(self):
"""Delete the user."""
super().tearDown()
self.user.delete()
_set_current_user(None)
set_current_user(None)

def test_valid_mirror_data(self):
"""Test that the ContainerDistributionSerializer accepts valid data."""
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ecdsa>=0.14,<=0.18.0
jsonschema>=4.4,<4.18
pulpcore>=3.23.0,<3.25
pulpcore>=3.25.0,<3.40
pyjwkest>=1.4,<=1.4.2
pyjwt[crypto]>=2.4,<2.8
2 changes: 1 addition & 1 deletion template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pypi_username: pulp
python_version: '3.8'
release_email: pulp-infra@redhat.com
release_user: pulpbot
run_pulpcore_tests_for_plugins: true
run_pulpcore_tests_for_plugins: false
single_commit_check: true
stalebot: true
stalebot_days_until_close: 30
Expand Down

0 comments on commit 4a0a780

Please sign in to comment.