Project

Profile

Help

Issue #4920

closed

Collection - Repository versions not being update after successive syncs

Added by kersom over 5 years ago. Updated about 4 years 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 - COMPLETEkersomActions
Related to Pulp - Task #3308: Skip creating new repo versions when content has not changedCLOSED - CURRENTRELEASEdkliban@redhat.com

Actions
Related to Ansible Plugin - Test #5000: Collection - Test that sucessive syncs do update repo versionCLOSED - COMPLETEkersomActions
Has duplicate Ansible Plugin - Issue #4997: Pulp3 Ansible Collection remote doesn't seem to be able to sync more than 1 repoCLOSED - CURRENTRELEASEbmbouterActions
Actions #1

Updated by kersom over 5 years ago

  • Project changed from Pulp to Ansible Plugin
Actions #2

Updated by kersom over 5 years ago

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

Updated by bmbouter over 5 years 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.

Actions #4

Updated by kersom over 5 years ago

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

Added by bmbouter over 5 years ago

Revision 27b90dfb | View on GitHub

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

Actions #5

Updated by bmbouter over 5 years ago

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

Updated by kersom over 5 years ago

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

Updated by bmbouter over 5 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #8

Updated by bmbouter about 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF