Project

General

Profile

Bug #32407

import/export metadata.json needs to be trimmed

Added by Partha Aji over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Inter Server Sync
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

The metadata.json file generated when exporting bunch of repositories that are part of the same product, the product details like name and gpg keys are repeated multiple times. We need to trim this information better
It looks like below at present.

{
    "organization": "export-3439",
    "repository_mapping": {
        <.....other mappings .....>
        "misc-33384": {
            "name": "misc",
            "label": "misc",
            "description": null,
            "arch": "x86_64",
            "content_type": "yum",
            "unprotected": true,
            "checksum_type": "sha256",
            "os_versions": [
                "rhel-7" 
            ],
            "major": null,
            "minor": null,
            "product": {
                "name": "prod",
                "label": "prod",
                "description": null,
                "gpg_key": {

                }
            },
            "gpg_key": {
                "name": "great",
                "content_type": "gpg_key",
                "content": "great gatsby" 
            },
            "redhat": false
        }
    },
    "content_view": {
        "name": "Export-Library",
        "label": "Export-Library",
        "description": null
    },
    "content_view_version": {
        "major": 9,
        "minor": 0
    },
    "incremental": false,
    "toc": "export-5e1ca0f7-1af7-49b2-97d5-f9417760d11a-20210421_0159-toc.json" 
}

It needs to look like

{
    "organization": "export-3439",
    "products": {
       "prod" : {
                "name": "prod",
                "label": "prod",
                "description": null,
                "gpg_key": {

                }
     },
     "gpg_keys": {
        "great" : : {
                "name": "great",
                "content_type": "gpg_key",
                "content": "great gatsby" 
            },
     }
    "repositories": {
        <.....other mappings .....>
        "misc-33384": {
            "name": "misc",
            "label": "misc",
            "description": null,
            "arch": "x86_64",
            "content_type": "yum",
            "unprotected": true,
            "checksum_type": "sha256",
            "os_versions": [
                "rhel-7" 
            ],
            "major": null,
            "minor": null,
            "product": { "label": "prod" }          
            "gpg_key": { "name": "great" }
            },
            "redhat": false
        }
    },
    "content_view": {
        "name": "Export-Library",
        "label": "Export-Library",
        "description": null
    },
    "content_view_version": {
        "major": 9,
        "minor": 0
    },
    "incremental": false,
    "toc": "export-5e1ca0f7-1af7-49b2-97d5-f9417760d11a-20210421_0159-toc.json" 
}

Associated revisions

Revision 0f3220e6 (diff)
Added by Partha Aji over 1 year ago

Fixes #32407 - Trim the Metadata json (#9315)

  • Fixes #32407 - Trim the Metadata json

Trimmed the json to have the products and gpg_keys in separate lists.
Also moved some of the metadata generation to a Metadata Generator
class.

History

#1 Updated by The Foreman Bot over 1 year ago

  • Assignee set to Partha Aji
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/9315 added

#2 Updated by James Jeffers over 1 year ago

  • Triaged changed from No to Yes

#3 Updated by The Foreman Bot over 1 year ago

  • Fixed in Releases Katello 4.2.0 added

#4 Updated by Partha Aji over 1 year ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF