Project

Profile

Help

Issue #2964

closed

Too easy for user to create empy python repo when syncing from feed

Added by kdelee@redhat.com over 7 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version - Python:
Platform Release:
2.14.2
Target Release - Python:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

When creating a python repo with a feed, it is very easy to create a repo that syncs no content.

If a user is used to the RPM plugin, they may not understand that the --package-names parameter is required if they want any content to sync.

The user documentation mentions this in the middle of a sentence, and in the example it is shown in code block that you must scroll in order to see the parameters.

I have not found any API documentation that indicates this required field.

Even though nothing breaks without this field, since it is required for the repo to be of any use at all, I think there should be some kind of warning or more obvious statement of this when creating a python repo with a feed but no packages specified. While clearer documentation would be great, I think this is something that pulp-admin could complain about during the sync if it notices there is no content to sync.

[admin@fedora25base pulp_smash]$ pulp-admin python repo create --repo-id pypi --feed https://pypi.python.org/ --package-names hamster-lib
Repository [pypi] successfully created

[admin@fedora25base pulp_smash]$ pulp-admin python repo create --repo-id pypi2 --feed https://pypi.python.org/
Repository [pypi2] successfully created

[admin@fedora25base pulp_smash]$ pulp-admin python repo sync run --repo-id pypi
+----------------------------------------------------------------------+
                    Synchronizing Repository [pypi]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading Python metadata.
[\]
... completed

Copying units already in pulp
[-]
... completed

Downloading and processing Python packages.
[\]
... completed

Task Succeeded

Publishing Python Metadata.
[-]
... completed

Publishing Python Content.
[-]
... completed

Making files available via web.
[-]
... completed

Task Succeeded

[admin@fedora25base pulp_smash]$ pulp-admin python repo sync run --repo-id pypi2
+----------------------------------------------------------------------+
                    Synchronizing Repository [pypi2]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading Python metadata.
[\]
... completed

Copying units already in pulp
[-]
... completed

Downloading and processing Python packages.
[\]
... completed

Task Succeeded

Publishing Python Metadata.
[-]
... completed

Publishing Python Content.
[-]
... completed

Making files available via web.
[-]
... completed

Task Succeeded

[admin@fedora25base pulp_smash]$ pulp-admin python repo list
+----------------------------------------------------------------------+
                          Python Repositories
+----------------------------------------------------------------------+

Id:                  pypi
Display Name:        None
Description:         None
Content Unit Counts: 
  Python Package: 12

Id:                  pypi2
Display Name:        None
Description:         None
Content Unit Counts: 
 

Here is an example of the raw HTTP POST that will create a repo with needed "package_names" parameter filled out:

POST request to /pulp/api/v2/repositories/ with parameters 

{
    "display_name": null, 
    "description": null, 
    "distributors": [
        {"distributor_id": "cli_python_distributor", 
         "auto_publish": true, 
         "distributor_config": {},
         "distributor_type_id": "python_distributor"
        }
    ], 
    "notes": {"_repo-type": "PYTHON"}, 
    "importer_type_id": "python_importer", 
    "importer_config": {
        "feed": "https://repos.fedorapeople.org/pulp/pulp/fixtures/python-pypi/",             "package_names": 'shelf-reader', 
        "proxy_host": null, 
        "proxy_password": null, 
        "proxy_port": null, 
        "proxy_username": null, 
        "validate": null}, 
    "id": "pypi" 
}

Here is what I have installed on the machine I recreated this with, though I believe it has always been this way.

rpm -qa | grep pulp
python-pulp-bindings-2.14.0-0.1.beta.fc25.noarch
pulp-deb-plugins-1.5.2-0.1.beta.fc25.noarch
python-pulp-docker-common-3.0.0-0.1.beta.fc25.noarch
pulp-puppet-admin-extensions-2.14.0-0.1.beta.fc25.noarch
python-pulp-rpm-common-2.14.0-0.1.beta.fc25.noarch
pulp-docker-admin-extensions-3.0.0-0.1.beta.fc25.noarch
python-pulp-python-common-2.0.1-0.1.beta.fc25.noarch
pulp-python-plugins-2.0.1-0.1.beta.fc25.noarch
python-pulp-repoauth-2.14.0-0.1.beta.fc25.noarch
pulp-rpm-plugins-2.14.0-0.1.beta.fc25.noarch
pulp-admin-client-2.14.0-0.1.beta.fc25.noarch
pulp-deb-admin-extensions-1.5.2-0.1.beta.fc25.noarch
python-pulp-oid_validation-2.14.0-0.1.beta.fc25.noarch
pulp-puppet-plugins-2.14.0-0.1.beta.fc25.noarch
pulp-rpm-admin-extensions-2.14.0-0.1.beta.fc25.noarch
pulp-ostree-plugins-1.3.0-0.1.beta.fc25.noarch
pulp-selinux-2.14.0-0.1.beta.fc25.noarch
python-pulp-client-lib-2.14.0-0.1.beta.fc25.noarch
python-pulp-streamer-2.14.0-0.1.beta.fc25.noarch
python-pulp-deb-common-1.5.2-0.1.beta.fc25.noarch
python-pulp-common-2.14.0-0.1.beta.fc25.noarch
pulp-server-2.14.0-0.1.beta.fc25.noarch
python-pulp-puppet-common-2.14.0-0.1.beta.fc25.noarch
python-pulp-ostree-common-1.3.0-0.1.beta.fc25.noarch
pulp-python-admin-extensions-2.0.1-0.1.beta.fc25.noarch
pulp-docker-plugins-3.0.0-0.1.beta.fc25.noarch
pulp-ostree-admin-extensions-1.3.0-0.1.beta.fc25.noarch
Actions #1

Updated by kdelee@redhat.com over 7 years ago

  • Subject changed from Too easy for user to create empy python repo when sycing from feed to Too easy for user to create empy python repo when syncing from feed
Actions #2

Updated by ttereshc over 7 years ago

  • Severity changed from 2. Medium to 1. Low
  • Triaged changed from No to Yes
Actions #3

Updated by mansari about 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to mansari
Actions #4

Updated by mansari about 7 years ago

  • Status changed from ASSIGNED to POST

Added by Ammar about 7 years ago

Revision 55edf57a | View on GitHub

Sync succeeds even when feed or package-names is not specified

An appropriate error message will now be displayed when a user tries to sync a python repo that is missing feed or package-names

closes #2964

Actions #5

Updated by Anonymous about 7 years ago

  • Status changed from POST to MODIFIED

Added by Ammar about 7 years ago

Revision 2c991d15 | View on GitHub

Sync succeeds even when feed or package-names is not specified

An appropriate error message will now be displayed when a user tries to sync a python repo that is missing feed or package-names

closes #2964

(cherry picked from commit 55edf57a8242805a0964953a6fe4926f990917cc)

Actions #6

Updated by pcreech about 7 years ago

  • Platform Release set to 2.14.2
Actions #7

Updated by Anonymous about 7 years ago

Actions #8

Updated by pcreech about 7 years ago

  • Status changed from MODIFIED to 5
Actions #9

Updated by pthomas@redhat.com about 7 years ago

Verified


[root@mgmt5 ~]# rpm -qa |grep pulp
python-pulp-common-2.14.2-0.1.beta.el7.noarch
python-kombu-3.0.33-8.pulp.el7.noarch
pulp-rpm-plugins-2.14.2-0.1.beta.el7.noarch
pulp-puppet-admin-extensions-2.14.2-0.1.beta.el7.noarch
pulp-ostree-plugins-1.3.0-1.el7.noarch
python-pulp-rpm-common-2.14.2-0.1.beta.el7.noarch
python-pulp-bindings-2.14.2-0.1.beta.el7.noarch
pulp-python-admin-extensions-2.0.2-0.1.beta.el7.noarch
python-pulp-docker-common-3.0.2-0.1.beta.el7.noarch
pulp-selinux-2.14.2-0.1.beta.el7.noarch
python-pulp-repoauth-2.14.2-0.1.beta.el7.noarch
pulp-puppet-plugins-2.14.2-0.1.beta.el7.noarch
pulp-admin-client-2.14.2-0.1.beta.el7.noarch
python-pulp-ostree-common-1.3.0-1.el7.noarch
python-pulp-python-common-2.0.2-0.1.beta.el7.noarch
pulp-python-plugins-2.0.2-0.1.beta.el7.noarch
python-pulp-streamer-2.14.2-0.1.beta.el7.noarch
pulp-server-2.14.2-0.1.beta.el7.noarch
python-pulp-client-lib-2.14.2-0.1.beta.el7.noarch
pulp-docker-admin-extensions-3.0.2-0.1.beta.el7.noarch
pulp-ostree-admin-extensions-1.3.0-1.el7.noarch
python-pulp-puppet-common-2.14.2-0.1.beta.el7.noarch
python-isodate-0.5.0-4.pulp.el7.noarch
python-pulp-oid_validation-2.14.2-0.1.beta.el7.noarch
pulp-docker-plugins-3.0.2-0.1.beta.el7.noarch
pulp-rpm-admin-extensions-2.14.2-0.1.beta.el7.noarch
[root@mgmt5 ~]# 

[root@mgmt5 ~]# pulp-admin python repo create --repo-id pypi --feed https://pypi.python.org/ --package-names hamster-lib
Repository [pypi] successfully created

[root@mgmt5 ~]# pulp-admin python repo create --repo-id pypi2 --feed https://pypi.python.org/
Repository [pypi2] successfully created

[root@mgmt5 ~]# pulp-admin python repo sync run --repo-id pypi
+----------------------------------------------------------------------+
                    Synchronizing Repository [pypi]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading Python metadata.
[\]
... completed

Copying units already in pulp
[-]
... completed

Downloading and processing Python packages.
[==================================================] 100%
12 of 12 items
... completed

Task Succeeded

Publishing Python Metadata.
[-]
... completed

Publishing Python Content.
[-]
... completed

Making files available via web.
[-]
... completed

Task Succeeded

[root@mgmt5 ~]# pulp-admin python repo sync run --repo-id pypi2
+----------------------------------------------------------------------+
                    Synchronizing Repository [pypi2]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Task Failed

Missing values for: ['package_names']
Actions #10

Updated by pcreech about 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #11

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF