Bug 1717506 - copr get-package --with-latest-succeeded-build does not return the latest build
Summary: copr get-package --with-latest-succeeded-build does not return the latest build
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Copr
Classification: Community
Component: frontend
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-05 15:51 UTC by Marek Blaha
Modified: 2019-10-03 07:42 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-10-03 07:42:20 UTC
Embargoed:


Attachments (Terms of Use)

Description Marek Blaha 2019-06-05 15:51:07 UTC
Description of problem:

I'm trying to identify version of latest copr build of a package using "copr get-package --with-latest-succeeded-build" but instead of the latest, the first build is returned.

Version-Release number of selected component (if applicable):
copr-cli-1.79-1.fc29.noarch

How reproducible:
100%

Steps to Reproduce:
1. $ copr get-package --name librepo --with-latest-succeeded-build rpmsoftwaremanagement/dnf-backport

Actual results:
The oldest build is returned:
{
    "auto_rebuild": false,
    "id": 334814,
    "latest_succeeded_build": {
        "chroots": [
            "fedora-28-x86_64",
            "fedora-29-x86_64",
            "epel-7-x86_64",
            "fedora-30-x86_64"
        ],
        "ended_on": 1559713016,
        "id": 921199,
        "ownername": "rpmsoftwaremanagement",
        "project_dirname": "dnf-backport",
        "projectname": "dnf-backport",
        "repo_url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport",
        "source_package": {
            "name": "librepo",
            "url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport/srpm-builds/00921199/librepo-1.9.6-2.fc30.src.rpm",
            "version": "1.9.6-2.fc30"
        },
        "started_on": 1559712777,
        "state": "succeeded",
        "submitted_on": 1559712690,
        "submitter": "rpmsoftwaremanagement"
    },
    "name": "librepo",
    "ownername": "rpmsoftwaremanagement",
    "projectname": "dnf-backport",
    "source_dict": {
        "pkg": "librepo-1.9.6-2.fc30.src.rpm",
        "tmp": "tmp1lglxbl1",
        "url": "https://copr.fedorainfracloud.org/tmp/tmp1lglxbl1/librepo-1.9.6-2.fc30.src.rpm"
    },
    "source_type": "upload"
}

Expected results:
The latest succeeded build to be returned.

Additional info:
When I run the command with --with-all-builds switch, you can see that there is newer build of the package. Actually two of them.

$ copr get-package --name $PACKAGE --with-all-builds ${OWNER}/${PROJECT}
{
    "auto_rebuild": false,
    "builds": [
        {
            "chroots": [
                "epel-7-x86_64",
                "fedora-29-x86_64",
                "fedora-30-x86_64",
                "fedora-28-x86_64"
            ],
            "ended_on": 1559749002,
            "id": 921384,
            "ownername": "rpmsoftwaremanagement",
            "project_dirname": "dnf-backport",
            "projectname": "dnf-backport",
            "repo_url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport",
            "source_package": {
                "name": "librepo",
                "url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport/srpm-builds/00921384/librepo-1.10.2-2.fc30.src.rpm",
                "version": "1.10.2-2.fc30"
            },
            "started_on": 1559748685,
            "state": "succeeded",
            "submitted_on": 1559748603,
            "submitter": "rpmsoftwaremanagement"
        },
        {
            "chroots": [
                "fedora-28-x86_64",
                "fedora-29-x86_64",
                "epel-7-x86_64",
                "fedora-30-x86_64"
            ],
            "ended_on": 1559748473,
            "id": 921380,
            "ownername": "rpmsoftwaremanagement",
            "project_dirname": "dnf-backport",
            "projectname": "dnf-backport",
            "repo_url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport",
            "source_package": {
                "name": "librepo",
                "url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport/srpm-builds/00921380/librepo-1.10.2-2.fc30.src.rpm",
                "version": "1.10.2-2.fc30"
            },
            "started_on": 1559748251,
            "state": "succeeded",
            "submitted_on": 1559748108,
            "submitter": "rpmsoftwaremanagement"
        },
        {
            "chroots": [
                "fedora-28-x86_64",
                "fedora-29-x86_64",
                "epel-7-x86_64",
                "fedora-30-x86_64"
            ],
            "ended_on": 1559713016,
            "id": 921199,
            "ownername": "rpmsoftwaremanagement",
            "project_dirname": "dnf-backport",
            "projectname": "dnf-backport",
            "repo_url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport",
            "source_package": {
                "name": "librepo",
                "url": "https://copr-be.cloud.fedoraproject.org/results/rpmsoftwaremanagement/dnf-backport/srpm-builds/00921199/librepo-1.9.6-2.fc30.src.rpm",
                "version": "1.9.6-2.fc30"
            },
            "started_on": 1559712777,
            "state": "succeeded",
            "submitted_on": 1559712690,
            "submitter": "rpmsoftwaremanagement"
        }
    ],
    "id": 334814,
    "name": "librepo",
    "ownername": "rpmsoftwaremanagement",
    "projectname": "dnf-backport",
    "source_dict": {
        "pkg": "librepo-1.9.6-2.fc30.src.rpm",
        "tmp": "tmp1lglxbl1",
        "url": "https://copr.fedorainfracloud.org/tmp/tmp1lglxbl1/librepo-1.9.6-2.fc30.src.rpm"
    },
    "source_type": "upload"
}

Comment 1 Pavel Raiskup 2019-06-06 08:31:16 UTC
taking a look

Comment 2 Pavel Raiskup 2019-06-06 11:54:39 UTC
https://pagure.io/copr/copr/pull-request/791


Note You need to log in before you can comment on or make changes to this bug.