#1411 Get built RPMs via API or python-copr
Closed: Fixed a year ago by praiskup. Opened 2 years ago by lachmanfrantisek.

Is there some way to get a list of RPMs via API or, ideally, using python client?
- I would like to get NVR (name, version and release) for given build_id and chroot.
- context: https://github.com/packit-service/packit-service/issues/642


  • I can't find anything in the API/proxies using version 3.
  • In version 2, there is a built_packages attribute (list of the built packages, each hash map has two keys: name and version).
    • I don't think that's the info I am looking for.
    • I would rather use the new version of API.

Thank you in advance!


There's an RFE for this, any help with implementing that would be awsome!
https://pagure.io/copr/copr/issue/74

I'm going to try to prioritize this in our team.

Metadata Update from @praiskup:
- Issue close_status updated to: Duplicate
- Issue status updated to: Closed (was: Open)

2 years ago

Sorry that I missed that issue and thanks for quick response.

Unfortunately, the fix of the linked issue doesn't solve our problem. Can this be revisited?

Unfortunately, the fix of the linked issue doesn't solve our problem. Can this be revisited?

Please (re-)specify what you are missing there. There's still #74, and you can of course
open a new issue.

@praiskup I was a bit confused because of this comment in the #74 issue:

Commit 3f45b32 fixes this issue

And it does not look like it is what we need.

As it is in the first comment, we would like to get NVR of the build packages for a given build.
= The list of full-name of built RPMs, not SRPMs.

Usecase:
- We trigger a copr built and after that, we want to install all the packages from that built to the testing-farm environment. (We have currently some repo-query magic which is not 100% reliable.)
- Also, we want to provide specific commands to our users about how they can install the built packages. (Including the NVR of the packages that were built.)

Sorry if it was not clear in the first comment.

Thanks!

Ok, reopening. We could have something like this structure (per each build-chroot info):

{
    "built_packages": [
        {
            "name": "foo",
            "epoch": "1",
            "version": "1",
            "release": "1",
            "arch": "src"
        },
        {
            "name": "foo",
            "epoch": "1",
            "version": "1",
            "release": "1",
            "arch": "x86_64"
        },
        {
            "name": "foo-debuginfo",
            "epoch": "1",
            "version": "1",
            "release": "1",
            "arch": "x86_64"
        }
    ]
}

Metadata Update from @praiskup:
- Issue status updated to: Open (was: Closed)

2 years ago

Metadata Update from @praiskup:
- Issue tagged with: API, RFE

2 years ago

Thank you, that's exactly what we need.

Ideally, it would be nice to have it in the python client as well since this is the way we are using Copr API. (I hope it will not be so hard.)

Concrete route proposal:

/built-packages/<build-id>/  => returns {<chroot>: <info>}
/built-packages/<build-id>/<chroot>/ => returns just <info>

I think that <info> can look just like (should be json, but I'm using yaml-like
format for simplicity (please scratch my proposal above):

- name: ...
  version: ...
  epoch: ...
  release: ...
  arch: ...
  download_url: ...
...

@praiskup thanks, that will work well for us.

Will this be available also in the Python client?
Thanks

Will this be available also in the Python client?

I can say yes (we try to support cli, and it implies python-copr support too).

But the overall feature is non-trivial to implement so at this point in time
we have only proposal, and no ETA promise. Patches are welcome of course
if you can help!

But the overall feature is non-trivial to implement so at this point in time

I thought it will be easy but you were right, the information about built packages that we store in the database is very limited, e.g.

coprdb=> select built_packages from build where id=863087;
    built_packages    
----------------------
 python3-tracer 0.7.5+
 tracer-common 0.7.5

Thanks for the update! How hard would it be to store the info in the database? Are DB schema migrations a common practice in your development cycle?

Thanks for the update! How hard would it be to store the info in the database? Are DB schema migrations a common practice in your development cycle?

Jakub just reacted to arguments on CPT meeting related "how difficult" it is to implement the feature. This still is a work-in-progress task, that will likely require some DB scheme update. :-)

I started working on this issue in PR#1780

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1780 Merged a year ago