Project

Profile

Help

Issue #4920

Collection - Repository versions not being update after successive syncs

Added by kersom over 1 year ago. Updated 2 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
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)
  1. 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

Related to Ansible Plugin - Test #4913: Test sync collections from GalaxyCLOSED - COMPLETE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to Pulp - Task #3308: Skip creating new repo versions when content has not changedCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to Ansible Plugin - Test #5000: Collection - Test that sucessive syncs do update repo versionCLOSED - COMPLETE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Has duplicate Ansible Plugin - Issue #4997: Pulp3 Ansible Collection remote doesn't seem to be able to sync more than 1 repoCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 27b90dfb View on GitHub
Added by bmbouter over 1 year ago

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

History

#1 Updated by kersom over 1 year ago

  • Project changed from Pulp to Ansible Plugin

#2 Updated by kersom over 1 year ago

  • Related to Test #4913: Test sync collections from Galaxy added

#3 Updated by bmbouter over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter
  • Sprint set to Sprint 54

I agree this deviates from how all the plugins work so we should switch this to be part of that.

#4 Updated by kersom over 1 year ago

  • Related to Task #3308: Skip creating new repo versions when content has not changed added

#5 Updated by bmbouter over 1 year ago

  • Has duplicate Issue #4997: Pulp3 Ansible Collection remote doesn't seem to be able to sync more than 1 repo added

#6 Updated by kersom over 1 year ago

  • Related to Test #5000: Collection - Test that sucessive syncs do update repo version added

#7 Updated by bmbouter over 1 year ago

  • Status changed from ASSIGNED to MODIFIED

#8 Updated by bmbouter 2 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF