Story #7015
Updated by daviddavis over 4 years ago
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
## Modeling
Add a many-to-many foreign key between Repositories and Remotes. This association should be optional.
## API Changes
### Repositories
Expose a remote hrefs field for repository endpoints. Users should be able to create/read/update this field. Validate that the types match between remotes and repositories.
### Remotes
Expose a repository hrefs field for remote endpoints. Users should be able to create/read/update this field. Validate that the types match between remotes and repositories.
### Syncing
Make the remote parameter on sync optional. If no remote is supplied, the sync task locks on all remotes and the repository. It syncs down content from all remotes and generates a new repo version.
If a repository does not have any remotes and no remote is supplied, raise an error.