Collection namespaces need to be moved into pulp ansible so that pulp ansible can carry the namespaces API and provide namespace sync functionality.
Data model:
class Namespace(Content):
# fields on the existing model in galaxy_ng
name = models.CharField(max_length=64, blank=False)
company = models.CharField(max_length=64, blank=True)
email = models.CharField(max_length=256, blank=True)
description = models.CharField(max_length=256, blank=True)
resources = models.TextField(blank=True)
# this used to be modelled as a one to many
# [mdellweg] Gerrod: "Why not an ArrayField"
links = models.JSONField(defaul=[])
# [mdellweg] Can we call this `avatar_sha256`?
avatar_hash = models.TextField(blank=True)
# Hash of the values of all the fields mentioned above.
# Content uniqueness constraint.
# [mdellweg] Same here, `metadata_sha256` or just `sha256`?
# [mdellweg] We need a stable way to calculate this digest, and blank should be impossible. Maybe we can make this an auto-field.
# [Gerrod] Agree with trying to make this an auto-field.
metadata_hash = models.TextField(blank=True)
def calc_metadata_sha256(self):
...
Collection serializer:
{
"href": "/api/galaxy/v3/plugin/ansible/content/published/collections/index/newswangerd/main_collection/",
"name": "main_collection",
"namespace": "newswangerd",
"namespace_metadata_hash": "xyz...."
[...]
}
Sync pipeline:
foo.collection
and bar.collection
, and am only syncing bar.collection
, then only bar
should synced, not foo
.Namespaces are a global object (ie not part of any repository). They are linked to a inbound-{namespace_name}
repo where user's are expected to upload collections for the namespace. When users upload collections they are required to upload them to an inbound repo that matches the namespace on the collection. The user's permissions are then checked against the namespace to verify that they have permission to upload the collection.
PUT /v3/namespaces/<name>/
allows users to update all of the namespace informationPOST /v3/namespaces/<name>/
allows users to create new namespacesConvert the namespace object to a Content type. This will allow namespaces to be synced from remote sources, but will greatly complicate the proces of updating namespace metadata and moving collections between repositories.
This is technically possible because even though namespaces don't belong to any repository right now, they are part of the V3 api which is currently scoped to a specific repo, so they can be moved to a repository without breaking changes on the public API.
Pros:
Cons:
Move the data model and implement the current galaxy_ng data model as it is.
Pros:
Cons:
Maintain collection ownership information on a global namespaces object (like it is now) but treat namespace metadata as content. Ownership can't be synced, so it's fine to manage this locally.
Pros:
Cons: