Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pulp_rpm advanced-copy API #990

Closed
ggainey opened this issue Jun 14, 2024 · 6 comments · Fixed by #992
Closed

Support pulp_rpm advanced-copy API #990

ggainey opened this issue Jun 14, 2024 · 6 comments · Fixed by #992
Labels
feature request New feature request (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg

Comments

@ggainey
Copy link
Contributor

ggainey commented Jun 14, 2024

We don't currently support copy_content for pulp_rpm, and we should.

@ggainey ggainey added feature request New feature request (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg labels Jun 14, 2024
ggainey added a commit to ggainey/pulp-cli that referenced this issue Jun 14, 2024
@ggainey
Copy link
Contributor Author

ggainey commented Jun 14, 2024

Fun with openapi - the "config" param and JSONField and drf-spectacular are arguing. Will need to do some api_quirkness.

For posterity, here's the Copy schema :

{
  "type": "object",
  "description": "A serializer for Content Copy API.",
  "properties": {
    "config": {
      "type": "object",
      "description": "A JSON document describing sources, destinations, and content to be copied"
    },
    "dependency_solving": {
      "type": "boolean",
      "default": true,
      "description": "Also copy dependencies of the content being copied."
    }
  },
  "required": [
    "config"
  ]
}

ggainey added a commit to ggainey/pulp-cli that referenced this issue Jun 14, 2024
ggainey added a commit to ggainey/pulp-cli that referenced this issue Jun 17, 2024
@pulpbot pulpbot moved this to Needs review in RH Pulp Kanban board Jun 17, 2024
ggainey added a commit to ggainey/pulp-cli that referenced this issue Jun 17, 2024
@pulpbot pulpbot moved this from Needs review to Done in RH Pulp Kanban board Jun 18, 2024
@mdellweg
Copy link
Member

The dependency_solving parameter seems to be unavailable on pulp_rpm 3.26 at least. Can you find actual version boundaries for it?

@ggainey
Copy link
Contributor Author

ggainey commented Jun 19, 2024

dependency_solving in copy has been there for as long as the command has existed. Here it is in rpm/3.26 : https://github.com/pulp/pulp_rpm/blob/3.26/pulp_rpm/app/serializers/repository.py#L521

@mdellweg
Copy link
Member

Something weird is going on with the api spec here:

$ pulp -p container debug openapi spec | jq '.info'
{
  "title": "Pulp 3 API",
  "version": "v3",
  "description": "Fetch, Upload, Organize, and Distribute Software Packages",
  "contact": {
    "name": "Pulp Team",
    "email": "[email protected]",
    "url": "https://pulpproject.org"
  },
  "license": {
    "name": "GPLv2+",
    "url": "https://raw.githubusercontent.com/pulp/pulpcore/master/LICENSE"
  },
  "x-logo": {
    "url": "https://pulp.plan.io/attachments/download/517478/pulp_logo_word_rectangle.svg"
  },
  "x-pulp-app-versions": {
    "core": "3.54.0",
    "ansible": "0.21.6",
    "container": "2.20.0",
    "deb": "3.2.0",
    "gem": "0.5.1",
    "maven": "0.8.0",
    "ostree": "2.3.0",
    "python": "3.11.1",
    "rpm": "3.26.0",
    "certguard": "3.54.0",
    "file": "3.54.0"
  },
  "x-pulp-domain-enabled": false
}

$ pulp -p container debug openapi schema --name Copy 
{
  "type": "object",
  "description": "A serializer for Content Copy API.",
  "properties": {
    "config": {
      "type": "object",
      "description": "A JSON document describing sources, destinations, and content to be copied"
    }
  },
  "required": [
    "config"
  ]
}

@mdellweg
Copy link
Member

Do we implement a similar Copy concept elsewhere?

@ggainey
Copy link
Contributor Author

ggainey commented Jun 20, 2024

Do we implement a similar Copy concept elsewhere?

I guess we do. Just for historical record, here's what the Copy schema looks like in a system with just core and pulp_rpm installed:

$pulp status
...
  "versions": [
    {
      "component": "core",
      "version": "3.55.0.dev",
      "package": "pulpcore",
      "module": "pulpcore.app",
      "domain_compatible": true
    },
    {
      "component": "rpm",
      "version": "3.28.0.dev",
      "package": "pulp-rpm",
      "module": "pulp_rpm.app",
      "domain_compatible": true
    },
    {
      "component": "certguard",
      "version": "3.56.0.dev",
      "package": "pulpcore",
      "module": "pulp_certguard.app",
      "domain_compatible": true
    },
    {
      "component": "file",
      "version": "3.56.0.dev",
      "package": "pulpcore",
      "module": "pulp_file.app",
      "domain_compatible": true
    }
  ],
...
$ pulp debug openapi schema --name Copy
{
  "type": "object",
  "description": "A serializer for Content Copy API.",
  "properties": {
    "config": {
      "description": "A JSON document describing sources, destinations, and content to be copied"
    },
    "dependency_solving": {
      "type": "boolean",
      "default": true,
      "description": "Also copy dependencies of the content being copied."
    }
  },
  "required": [
    "config"
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants