Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36820 - translate modulemd content counts #10765

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

ianballou
Copy link
Member

What are the changes introduced in this pull request?

Module streams weren't translated properly to Katello terms for smart proxy counts.

Considerations taken when implementing this change?

I considered that rpm.modulemd is completely confusing for Katello users.

What are the testing steps for this pull request?

  1. Sync a smart proxy with some module streams
  2. curl -X GET https://hostname/katello/api/capsules/2/content/counts -H "Content-Type: application/json" -uadmin:changeme | jq
  3. See that instead of rpm.modulemd it says "module_stream" for module streams.

@theforeman-bot
Copy link

Issues: #36820

@chris1984
Copy link
Member

Looks good, here is my output:

vagrant@centos8-katello-devel ~]$ curl -X GET https://centos8-katello-devel.area51.example.com/katello/api/capsules/2/content/counts -H "Content-Type: application/json" -uadmin:changeme | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   967  100   967    0     0   4883      0 --:--:-- --:--:-- --:--:--  4859
{
  "content_view_versions": {
    "2": {
      "repositories": {
        "24": {
          "file": 3
        },
        "25": {
          "ansible.collection_version": 14
        },
        "26": {
          "rpm": 35,
          "erratum": 4,
          "package_group": 2,
          "rpm.packagecategory": 1,
          "rpm.packagelangpacks": 1
        },
        "27": {
          "ostree_ref": 2,
          "ostree.commit": 2,
          "ostree.config": 1,
          "ostree.object": 3,
          "ostree.summary": 1
        },
        "28": {
          "python_package": 2
        },
        "29": {
          "rpm": 22,
          "erratum": 7,
          "module_stream": 14,
          "package_group": 2,
          "rpm.packagecategory": 1,
          "rpm.distribution_tree": 1,
          "rpm.modulemd_defaults": 3
        },
        "30": {
          "docker_tag": 3,
          "container.blob": 27,
          "docker_manifest": 9,
          "docker_manifest_list": 3
        }
      },
      "cv_version_content_counts": {
        "rpm": 57,
        "file": 3,
        "erratum": 11,
        "docker_tag": 3,
        "ostree_ref": 2,
        "module_stream": 14,
        "ostree.commit": 2,
        "ostree.config": 1,
        "ostree.object": 3,
        "package_group": 4,
        "container.blob": 27,
        "ostree.summary": 1,
        "python_package": 2,
        "docker_manifest": 9,
        "rpm.packagecategory": 2,
        "docker_manifest_list": 3,
        "rpm.packagelangpacks": 1,
        "rpm.distribution_tree": 1,
        "rpm.modulemd_defaults": 3,
        "ansible.collection_version": 14
      }
    }

One question I have is do we want to change this field too? rpm.modulemd_defaults Looks like a few failing tests too :(

@ianballou
Copy link
Member Author

ianballou commented Oct 12, 2023

One question I have is do we want to change this field too? rpm.modulemd_defaults Looks like a few failing tests too :(

We don't index modulemd_defaults along with some other types, like container.blob. I'm just translating the ones that users would understand. I'll take a look at the failing tests.

@ianballou ianballou force-pushed the 36820-translate-modulemd branch from 3008d4d to 6d13fd5 Compare October 12, 2023 21:12
@ianballou
Copy link
Member Author

I really wish we didn't make the content type for module streams be "modulemd" internally, but I think it'll have to stay for now... we use it all over the place. So, to get around it, I'm just going to hardcode the translation for modulemds to be "module_stream".

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, looks good

@ianballou ianballou force-pushed the 36820-translate-modulemd branch from 6d13fd5 to b762e44 Compare October 16, 2023 14:33
@ianballou
Copy link
Member Author

[test katello]

@ianballou ianballou merged commit 3c152d0 into Katello:master Oct 18, 2023
5 checks passed
@ianballou ianballou deleted the 36820-translate-modulemd branch October 18, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants