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

Add --json output to advisory info #1970

Merged

Conversation

stewartsmith
Copy link
Contributor

@stewartsmith stewartsmith commented Dec 20, 2024

Enable --json for 'dnf advisory info'. The same information as would be displayed as text is included in the JSON output. While the libscols code could be adapted to produce JSON as well, without serious reworking of key_value_table (and all callers), the produced JSON is quite weird, so we instead choose to implement the JSON output separately.

Example output from dnf5 advisory info --json FEDORA-2024-1ec4cd5fd3:

{
  "FEDORA-2024-1ec4cd5fd3":{
    "Name":"FEDORA-2024-1ec4cd5fd3",
    "Title":"libtirpc-1.3.6-1.fc41",
    "Severity":"None",
    "Type":"unspecified",
    "Status":"stable",
    "Vendor":"[email protected]",
    "Issued":"2024-11-16 02:13:46",
    "Description":"    - Fix regression in NVR\n    - Removed libtirpc-1-3-7-rc1 patch (bz 2325556)\n",
    "Message":"",
    "Rights":"Copyright (C) 2024 Red Hat, Inc. and others.",
    "references":[
      {
        "Title":"[nfs-utils] nfs-server restart times out",
        "Id":"2325556",
        "Type":"bugzilla",
        "Url":"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=2325556"
      }
    ],
    "collections":{
      "packages":[
        "libtirpc-1.3.6-1.fc41.src",
        "libtirpc-debuginfo-1.3.6-1.fc41.i686",
        "libtirpc-1.3.6-1.fc41.i686",
        "libtirpc-debugsource-1.3.6-1.fc41.i686",
        "libtirpc-devel-1.3.6-1.fc41.i686",
        "libtirpc-debuginfo-1.3.6-1.fc41.x86_64",
        "libtirpc-1.3.6-1.fc41.x86_64",
        "libtirpc-devel-1.3.6-1.fc41.x86_64",
        "libtirpc-debugsource-1.3.6-1.fc41.x86_64",
        "libtirpc-debuginfo-1.3.6-1.fc41.aarch64",
        "libtirpc-debugsource-1.3.6-1.fc41.aarch64",
        "libtirpc-devel-1.3.6-1.fc41.aarch64",
        "libtirpc-1.3.6-1.fc41.aarch64",
        "libtirpc-1.3.6-1.fc41.ppc64le",
        "libtirpc-debuginfo-1.3.6-1.fc41.ppc64le",
        "libtirpc-debugsource-1.3.6-1.fc41.ppc64le",
        "libtirpc-devel-1.3.6-1.fc41.ppc64le",
        "libtirpc-devel-1.3.6-1.fc41.s390x",
        "libtirpc-debuginfo-1.3.6-1.fc41.s390x",
        "libtirpc-debugsource-1.3.6-1.fc41.s390x",
        "libtirpc-1.3.6-1.fc41.s390x"
      ]
    }
  }
}

@stewartsmith stewartsmith force-pushed the advisory-info-json branch 2 times, most recently from fce16cc to b8d84f5 Compare December 24, 2024 18:46
@kontura kontura self-assigned this Jan 2, 2025
Copy link
Contributor

@kontura kontura left a comment

Choose a reason for hiding this comment

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

I have only a couple really minor simplification notes.

Otherwise this looks good.
Thank you!

libdnf5-cli/output/advisoryinfo.cpp Outdated Show resolved Hide resolved
libdnf5-cli/output/advisoryinfo.cpp Outdated Show resolved Hide resolved
Enable --json for 'dnf advisory info'. The same information as would be
displayed as text is included in the JSON output. While the libscols
code could be adapted to produce JSON as well, without serious reworking
of key_value_table (and all callers), the produced JSON is quite weird,
so we instead choose to implement the JSON output separately.
@kontura
Copy link
Contributor

kontura commented Jan 14, 2025

Great, thank you again!

@kontura kontura added this pull request to the merge queue Jan 14, 2025
Merged via the queue into rpm-software-management:main with commit b35c4ed Jan 14, 2025
17 checks passed
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
walkerever pushed a commit to walkerever/dnf that referenced this pull request Jan 27, 2025
This is a backporting for the feature introduced to dnf5 by the following
pull requests:
- rpm-software-management/dnf5#1531
- rpm-software-management/dnf5#1970

The feature enables JSON format output for updateinfo command.
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.

2 participants