Issue #2964
closedToo easy for user to create empy python repo when syncing from feed
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
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
Updated by ttereshc over 7 years ago
- Severity changed from 2. Medium to 1. Low
- Triaged changed from No to Yes
Updated by mansari about 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to mansari
Updated by mansari about 7 years ago
- Status changed from ASSIGNED to POST
Added by Ammar about 7 years ago
Updated by Anonymous about 7 years ago
- Status changed from POST to MODIFIED
Applied in changeset 55edf57a8242805a0964953a6fe4926f990917cc.
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)
Updated by Anonymous about 7 years ago
Applied in changeset 2c991d1501572f5e625a0c14cbbc91b3833314a2.
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']
Updated by pcreech about 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
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