Actions
Issue #4920
closedCollection - Repository versions not being update after successive syncs
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 54
Quarter:
Description
Attempt to sync using collection content type.
How to reproduce it: (Using pulp-smash shell)
Having `pulp-smash` installed do
$ cd pulp_ansible
$ export PULP_SMASH_CONFIG_FILE=path/to/settings.json
$ pulp-smash shell
Now inside pulp-smash shell run the following script (if ipython is installed you must be able to copy-paste the whole script)
from pprint import pprint
from urllib.parse import urljoin
from pulp_smash.pulp3.constants import BASE_REMOTE_PATH
ANSIBLE_COLLECTION_REMOTE_PATH = urljoin(
BASE_REMOTE_PATH,
'ansible/collection/'
)
ANSIBLE_GALAXY_COLLECTION_URL = 'https://galaxy-dev.ansible.com'
COLLECTION_WHITELIST = 'testing.ansible_testing_content'
# create a repo
repo = api.client.post(pulp3.constants.REPO_PATH, pulp3.utils.gen_repo())
# create collections remote
_body = pulp3.utils.gen_remote(
url=ANSIBLE_GALAXY_COLLECTION_URL,
whitelist=COLLECTION_WHITELIST
)
remote = api.client.post(ANSIBLE_COLLECTION_REMOTE_PATH, _body)
# sync it
pulp3.utils.sync(cfg, remote, repo)
repo = api.client.get(repo['_href'])
pprint(repo)
for _ in range(3):
pulp3.utils.sync(cfg, remote, repo)
repo = api.client.get(repo['_href'])
pprint(repo)
- Running the script against a pulp installation in clean slate.
# repo after first sync
{'_created': '2019-06-05T14:03:26.895051Z',
'_href': '/pulp/api/v3/repositories/6d7283e9-a5c4-448d-a942-87ff53b9afd7/',
'_latest_version_href': '/pulp/api/v3/repositories/6d7283e9-a5c4-448d-a942-87ff53b9afd7/versions/1/',
'_versions_href': '/pulp/api/v3/repositories/6d7283e9-a5c4-448d-a942-87ff53b9afd7/versions/',
'description': None,
'name': '220aef27-2754-4d2d-b898-4c66ecd268bb'}
# repo after successive syncs
{'_created': '2019-06-05T14:03:26.895051Z',
'_href': '/pulp/api/v3/repositories/6d7283e9-a5c4-448d-a942-87ff53b9afd7/',
'_latest_version_href': '/pulp/api/v3/repositories/6d7283e9-a5c4-448d-a942-87ff53b9afd7/versions/1/',
'_versions_href': '/pulp/api/v3/repositories/6d7283e9-a5c4-448d-a942-87ff53b9afd7/versions/',
'description': None,
'name': '220aef27-2754-4d2d-b898-4c66ecd268bb'}
Even after multiple syncs the ``_latest_version_href`` points to the first repo version.
Run the script again after the first run.
# repo after first sync
{'_created': '2019-06-05T14:06:15.539106Z',
'_href': '/pulp/api/v3/repositories/0c5acf8d-720a-444b-ba3a-939da10fdbfa/',
'_latest_version_href': None,
'_versions_href': '/pulp/api/v3/repositories/0c5acf8d-720a-444b-ba3a-939da10fdbfa/versions/',
'description': None,
'name': '5e9e4cf4-39e6-400d-8a2f-ae3ab9059f07'}
# repo after successive syncs
{'_created': '2019-06-05T14:06:15.539106Z',
'_href': '/pulp/api/v3/repositories/0c5acf8d-720a-444b-ba3a-939da10fdbfa/',
'_latest_version_href': None,
'_versions_href': '/pulp/api/v3/repositories/0c5acf8d-720a-444b-ba3a-939da10fdbfa/versions/',
'description': None,
'name': '5e9e4cf4-39e6-400d-8a2f-ae3ab9059f
_latest_version_href is set to None in both cases.
Tested against source installation from June04.
pulp) [root@localhost ~]# pip list | grep pulp
pulp-ansible 0.2.0b1
pulp-certguard 0.1.0rc1
pulp-docker 4.0.0b4
pulp-file 0.1.0b1
pulp-rpm 3.0.0b3
pulpcore 3.0.0rc2
pulpcore-plugin 0.1.0rc2
selinux
(pulp) [root@localhost ~]# getenforce
Permissive
Related issues
Actions
Sync now always creates a RepositoryVersion
This change ensures there is always a repository version generated for every sync, even if no content changed.
Prior to this change a re-sync that received no new Collection content would not create a new repository verison. This deviates from other plugin behaviors, and is also not desirable based on feedback.
https://pulp.plan.io/issues/4920 closes #4920