Project

Profile

Help

Story #7731

As a user, I can use a /metadata endpoint to efficiently tell me if I need to perform a sync at all

Added by bmbouter about 1 month ago. Updated 24 days ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

This story includes both the server and client sync implementation.

The idea is to have the repositoryversion's creation time be exposed as a 'created_at' timestamp at a url in the Galaxy V3 API at /metadata/. That would be listed in the v3 section of urls.py here.

So for a AnsibleDistribution with base_path='my_content' you would be able to fetch:

GET http://example.com/pulp_ansible/galaxy/my_content/api/v3/metadata/ which would return:

{
	"created": 1603308427
}

The value is the unix epoch time. This is taken from the repository verison pulp_created field which already exists.

Sync usage

Add a metadata_created filed to AnsibleRepository which can be None.

When syncing an AnsibleRepository:

  1. If using the Galaxy V3 API specifically, attempt to fetch /metadata/ early in the sync flow and ignore a 404
  2. If it returns a value compare it to the existing one stored on the AnsibleRepository.
  3. If the value is the same as the one stored do not continue syncing
  4. If syncing does continue then save the newly fetched value onto AnsibleRepository.metadata_created for comparison later.

It should not attempt to fetch this for the V2 API if possible, otherwise ignore it.

History

#1 Updated by bmbouter about 1 month ago

  • Project changed from Pulp to Ansible Plugin

#2 Updated by fao89 26 days ago

  • Parent task set to #7777

#3 Updated by fao89 24 days ago

  • Parent task deleted (#7777)

Please register to edit this issue

Also available in: Atom PDF