Skip to content

[bug] conan pkglist find-remote swallows binary information if only a package_id is given but no pkg revisions #19082

@ianda

Description

@ianda

Describe the bug

conan pkglist find-remote swallows the binary information if the input package list does not contain "revisions" in the "packages" section of the input pkglist. Instead it just returns the recipe revision, ignoring all binary data.

This is especially interesting if multiple package_ids were requested because then its not possible to distinguish which ones were found.

Example output

All commands in this issue create this output:

{
    "conancenter": {
        "zlib/1.3.1": {
            "revisions": {
                "b8bc2603263cf7eccbd6e17e66b0ed76": {}
            }
        }
    }
}

Note that the output just contains information about the recipe but any information regarding the binary package is missing.

Expected output

The "packages" section should be in the pkglist json, like

{
    "conancenter": {
        "zlib/1.3.1": {
            "revisions": {
                "b8bc2603263cf7eccbd6e17e66b0ed76": {
                    "packages": {
                        "ae9eaf478e918e6470fe64a4d8d4d9552b0b3606": {
                            "revisions": {
                                "94325d06c4fda63535d726ec25ebca76": {
                                    "timestamp": 1733936326.833
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

How to reproduce it

conan pkglist find-remote -cc=core:non_interactive=True --format=json --remote conancenter <(echo '{
    "Local Cache": {
        "zlib/1.3.1": {
            "revisions": {
                "b8bc2603263cf7eccbd6e17e66b0ed76": {
                    "packages": {
                        "ae9eaf478e918e6470fe64a4d8d4d9552b0b3606": {}
                    }
                }
            }
        }
    }
}')

A more complex example that illustrates the problem; here two package_ids exit but one is missing. From the output (it is currently the same as for the other command), this cannot be read.

conan pkglist find-remote -cc=core:non_interactive=True --format=json --remote conancenter <(echo '{
    "Local Cache": {
        "zlib/1.3.1": {
            "revisions": {
                "b8bc2603263cf7eccbd6e17e66b0ed76": {
                    "packages": {
                        "ae9eaf478e918e6470fe64a4d8d4d9552b0b3606": {},
                        "b647c43bfefae3f830561ca202b6cfd935b56205": {},
                        "abcdef1234567890abcdef1234567890abcdef12": {}
                    }
                }
            }
        }
    }
}')

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions