Description
RepositoriesCollection::getReleases() loses releases when it aggregates more than one repository. Two repositories with one release each produce a collection with only the second release.
getReleases() builds the collection from a generator that uses yield from over each repository's releases. Collection::create() turns it into an array with iterator_to_array(), which keeps the keys. Every repository yields keys starting at 0, so a later repository overwrites the releases of an earlier one at the same index.
Today Command::getRepository() passes a single GitHub repository, so the CLI is not affected yet. Any second source added to the collection would silently replace the first one's releases.
Steps to reproduce
- Remove
#[Skip] from RepositoriesCollectionTest::mergesReleasesOfAllRepositories.
- Run
vendor/bin/testo --filter=mergesReleasesOfAllRepositories.
Additional context
The release lookup may be replaced by DLoad in #49, in which case this code goes away.
Description
RepositoriesCollection::getReleases()loses releases when it aggregates more than one repository. Two repositories with one release each produce a collection with only the second release.getReleases()builds the collection from a generator that usesyield fromover each repository's releases.Collection::create()turns it into an array withiterator_to_array(), which keeps the keys. Every repository yields keys starting at0, so a later repository overwrites the releases of an earlier one at the same index.Today
Command::getRepository()passes a single GitHub repository, so the CLI is not affected yet. Any second source added to the collection would silently replace the first one's releases.Steps to reproduce
#[Skip]fromRepositoriesCollectionTest::mergesReleasesOfAllRepositories.vendor/bin/testo --filter=mergesReleasesOfAllRepositories.Additional context
The release lookup may be replaced by DLoad in #49, in which case this code goes away.