Project

Profile

Help

Story #7795

As a user, I can associate a remote with a repository

Added by ipanova@redhat.com 12 months ago. Updated 5 months ago.

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

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 96
Quarter:

Description

Currently there is no way to link a repository with a remote, and as such, each time you wish to sync a repository against it's upstream link, you have to keep a record (or query for) the appropriate remote for that repo.

This can be done with careful consideration around naming conventions, however it would be nice if an optional link between a Repository and Remote was possible.

As such, once the Repository and Remote have been created an paired, a simply repository sync would be able to work out which remote to use, and sync.

Design

Model

Add a many-to-many foreign key between Repositories and Remotes. This association should be optional. For now Repositories can only have 0 or 1 remotes. Remotes can belong to any number of repositories.

Note: In the future we want to be able to support multiple remotes for repositories that can be synced at once. See https://pulp.plan.io/issues/7031. This is the purpose of having a many-to-many instead of one-to-many.

REMOTE_TYPES

Add an iterable to Repository similar to CONTENT_TYPES. This iterable will check that when a remote is added to a repo, it is of one of these types.

API

Repositories

Expose a remote hrefs field for repository endpoints. Users should be able to create/read/update this field. Validate the remote type against REMOTE_TYPES and that a user is only supplying 0..1 remote. Also, indicate in the help text that this field is optional.

Remotes

Expose a repository hrefs field for remotes. Users should be able to view this field to see which repos a remote belongs to. Also, indicate in the help text that this field is optional.

Syncing

Make the remote parameter on sync optional. If no remote is supplied, the sync task uses the remote field on Repository when syncing.

If a repository does not have a remote and no remote is supplied, raise an error.


Related issues

Copied from File Support - Story #7135: As a user, I can associate a remote with a repositoryCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision f7f489ef View on GitHub
Added by mdellweg 6 months ago

Support associating Remotes with Repositories

fixes #7795 https://pulp.plan.io/issues/7795

Revision f7f489ef View on GitHub
Added by mdellweg 6 months ago

Support associating Remotes with Repositories

fixes #7795 https://pulp.plan.io/issues/7795

History

#1 Updated by ipanova@redhat.com 12 months ago

  • Copied from Story #7135: As a user, I can associate a remote with a repository added

#2 Updated by ipanova@redhat.com 12 months ago

  • Assignee deleted (daviddavis)

#3 Updated by ipanova@redhat.com 6 months ago

  • Sprint/Milestone set to 2.6.0

#4 Updated by mdellweg 6 months ago

#7031 has been closed WONTFIX. And the Repository base model has a foreign key to remotes. Does this mean, the many-to-many relation mentioned in this ticket is superseeded?

#5 Updated by pulpbot 6 months ago

  • Status changed from NEW to POST

#6 Updated by ipanova@redhat.com 6 months ago

mdellweg wrote:

#7031 has been closed WONTFIX. And the Repository base model has a foreign key to remotes. Does this mean, the many-to-many relation mentioned in this ticket is superseeded?

Correct, this ticket was written at the times we were planning to add support for 1+ remotes.

#7 Updated by mdellweg 6 months ago

  • Status changed from POST to MODIFIED

#8 Updated by mdellweg 6 months ago

  • Assignee set to mdellweg
  • Sprint set to Sprint 96

#9 Updated by pulpbot 5 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF