Task #3222

Updated by bmbouter about 3 years ago

h2. Motivation

There needs to be a way to prevent the RepositoryVersion from being used before it is completely constructed.

h2. Design

Here is a recap of the approach used with Publications in #3184 rewritten to apply to repo versions.

* Add an attribute called 'complete' to RepositoryVersion which defaults to False.
* Update the viewset so that it excludes RepositoryVersion objects that have complete=False
* Update the filterset for RepositoryVersion objects to also exclude RepositoryVersion that have complete=False
* After the plugin code returns control to core, have core set complete=True on the RepositoryVersion and then call save() before setting the <code>created_resources</code> on the Task

h2. Additional Requirements:

Only 'complete' repo versions can be published
Also add docs for plugin writers specifically for when they need to create RepositoryVersion objects. They need to understand the pattern regarding 'complete'. set complete=True