Skip to content

RepositoriesCollection drops releases of all but the last repository #60

Description

@roxblnfk

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

  1. Remove #[Skip] from RepositoriesCollectionTest::mergesReleasesOfAllRepositories.
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions