Skip to content

Commit

Permalink
Adds initial domain support.
Browse files Browse the repository at this point in the history
This adds domain support for the Pulp REST API. However, we still need to add domain support for the maven
deploy API.

closes: pulp#244
  • Loading branch information
dkliban committed Feb 24, 2025
1 parent 3c980bc commit d7c5b34
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-421-g204a709
2021.08.26-426-g3a3f8a1
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
test:
if: "endsWith(github.base_ref, 'main')"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-latest"
defaults:
run:
working-directory: "pulp_maven"
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
no-test:
if: "!endsWith(github.base_ref, 'main')"
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-latest"
steps:
- run: |
echo "Skip docs testing on non-main branches."
2 changes: 1 addition & 1 deletion .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if [ "$TEST" = "s3" ]; then
sed -i -e '$a s3_test: true\
minio_access_key: "'$MINIO_ACCESS_KEY'"\
minio_secret_key: "'$MINIO_SECRET_KEY'"\
pulp_scenario_settings: null\
pulp_scenario_settings: {"domain_enabled": true}\
pulp_scenario_env: {}\
test_storages_compat_layer: true\
' vars/main.yaml
Expand Down
1 change: 1 addition & 0 deletions CHANGES/244.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds domain support for the Pulp API. No support for maven deploy (yet).
1 change: 1 addition & 0 deletions pulp_maven/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ class PulpMavenPluginAppConfig(PulpPluginAppConfig):
label = "maven"
version = "0.9.0.dev"
python_package_name = "pulp-maven"
domain_compatible = True
14 changes: 12 additions & 2 deletions pulp_maven/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.db import models

from pulpcore.plugin.models import Content, Remote, Repository, Distribution
from pulpcore.plugin.util import get_domain_pk

logger = getLogger(__name__)

Expand Down Expand Up @@ -46,14 +47,15 @@ class MavenArtifact(MavenContentMixin, Content):

TYPE = "artifact"

_pulp_domain = models.ForeignKey("core.Domain", default=get_domain_pk, on_delete=models.PROTECT)
group_id = models.CharField(max_length=255, null=False)
artifact_id = models.CharField(max_length=255, null=False)
version = models.CharField(max_length=255, null=False)
filename = models.CharField(max_length=255, null=False)

class Meta:
default_related_name = "%(app_label)s_%(model_name)s"
unique_together = ("group_id", "artifact_id", "version", "filename")
unique_together = ("group_id", "artifact_id", "version", "filename", "_pulp_domain")

@staticmethod
def init_from_artifact_and_relative_path(artifact, relative_path):
Expand Down Expand Up @@ -86,6 +88,7 @@ class MavenMetadata(MavenContentMixin, Content):

TYPE = "metadata"

_pulp_domain = models.ForeignKey("core.Domain", default=get_domain_pk, on_delete=models.PROTECT)
group_id = models.CharField(max_length=255, null=False)
artifact_id = models.CharField(max_length=255, null=False)
version = models.CharField(max_length=255, null=True)
Expand All @@ -94,7 +97,14 @@ class MavenMetadata(MavenContentMixin, Content):

class Meta:
default_related_name = "%(app_label)s_%(model_name)s"
unique_together = ("group_id", "artifact_id", "version", "filename", "sha256")
unique_together = (
"group_id",
"artifact_id",
"version",
"filename",
"sha256",
"_pulp_domain",
)

@staticmethod
def init_from_artifact_and_relative_path(artifact, relative_path):
Expand Down
3 changes: 2 additions & 1 deletion template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pulp_scheme: https
pulp_settings: null
pulp_settings_azure: null
pulp_settings_gcp: null
pulp_settings_s3: null
pulp_settings_s3:
domain_enabled: true
pydocstyle: true
release_email: pulp-infra@redhat.com
release_user: pulpbot
Expand Down

0 comments on commit d7c5b34

Please sign in to comment.