Project

Profile

Help

Task #5198

closed

Move CollectionVersion.metadata JSON field to be top-level fieldson the Model

Added by bmbouter over 5 years ago. Updated about 4 years ago.

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

100%

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

Description

Problem

'metadata' contains data that isn't being exposed in the bindings directly. Here's an example of 'metadata' data:

"metadata": {
    "namespace": "my_namespace", 
    "name": "my_collection", 
    "version": "1.2.0", 
    "description": "A collection that performs...",
    "license": [
      "MIT",
    ],
    "authors": [
      "John Smith <jsmith@example.com>",
    ],
    "readme": "README.md",
    "tags": [
      "deployment",
    ],
    "dependencies": {},
    "documentation": null,
    "license_file": null,
    "issues": null,
    "homepage": null,
    "repository": null,
  },

Solution

Make each it's own field. Use ArrayField, CharField, TextField. Also use some ForeignKey modeling for 'dependencies' and 'tags'. Tags needs to become its own Model and it will needs its own Viewset also. This allows for filter searching on the current known Tags through that viewset.

Actions #1

Updated by daviddavis over 5 years ago

  • Groomed changed from No to Yes
  • Sprint set to Sprint 56
Actions #2

Updated by bmbouter over 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter
Actions #3

Updated by rchan over 5 years ago

  • Sprint changed from Sprint 56 to Sprint 57
Actions #4

Updated by bmbouter over 5 years ago

  • Status changed from ASSIGNED to POST

Added by bmbouter over 5 years ago

Revision ca98cb3b | View on GitHub

Moving 'metadata' to be fields

This adds many fields to CollectionVersion. Also it adds a migration to introduce the field changes. Also the fields are added to the serializer.

A new Tag model is introduced which uniquely tags many CollectionVersion objects.

https://pulp.plan.io/issues/5198 closes #5198

Actions #5

Updated by bmbouter over 5 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #6

Updated by bmbouter over 5 years ago

  • Status changed from MODIFIED to POST

Bringing back to POST for small followup fix.

Added by bmbouter over 5 years ago

Revision f67cd5e1 | View on GitHub

Followup fix to modelling changes

Some inputs would cause an unexpected keyword argument to the model which would be rejected. This ensures those fields returned by the importer but unused by the model don't fail the object creation.

https://pulp.plan.io/issues/5198 closes #5198

Actions #8

Updated by bmbouter over 5 years ago

  • Status changed from POST to MODIFIED
Actions #9

Updated by bmbouter about 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF