RepositoriesCollection drops releases of all but the last repository
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in src/Repository/RepositoriesCollection.php at getReleases(), where the generator uses yield from and Collection::create() runs iterator_to_array(), which keeps the colliding integer keys. Remove #[Skip] from RepositoriesCollectionTest::mergesReleasesOfAllRepositories and run vendor/bin/testo --filter=mergesReleasesOfAllRepositories to see the failure first. Done means the test passes and releases from every repository appear in the result.
Written by the indexing model from the issue text.
Description
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]fromRepositoriesCollectionTest::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.
- Dominant language
- PHP
- Stars
- 30
- Forks
- 15
- Avg merge
- 45m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roadrunner-php/cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
roadrunner-php/cli#69 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
roadrunner-php/cli#68 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
roadrunner-php/cli#67 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
roadrunner-php/cli#62 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
roadrunner-php/cli#61 ·
Maintainers usually reply within 1 day
All issues in roadrunner-php/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
scanaislop/aislop#476 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
components-web-app/api-components-bundle#403 ·
Maintainers usually reply within 1 day