Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(repology): Properly handle of response with multiple package versions #8489

Merged
merged 4 commits into from
Feb 3, 2021
Merged

fix(repology): Properly handle of response with multiple package versions #8489

merged 4 commits into from
Feb 3, 2021

Conversation

zeldigas
Copy link
Contributor

@zeldigas zeldigas commented Feb 1, 2021

Changes:

Some repos available in repology api produce multiple versions, and while not all of them can be downloaded, it should not result in invalid result at all. Instead all found versions that match criteria should be returned from data source just like in more regular one like npm or maven.

This change adjust handling of multiple returned versions and produce all of them as result after filtering by repo and package types

Context:

Closes #8482

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or
  • Unit tests + ran on a real repository

…ions (#8482)

Some repos produce multiple versions, and while not all of them can be downloaded, it should not result in invalid result at all. Instead all found versions that match criteria should be returned from data source just like in more regular one like npm or maven
…ions (#8482)

cleaned up tests and snapshot expectations
@rarkins rarkins requested a review from ppmathis February 2, 2021 07:40
@rarkins
Copy link
Collaborator

rarkins commented Feb 2, 2021

@danez could you also add your review?

Copy link
Contributor

@danez danez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the API and it indeed returns multiple versions for the same exact package. So overall this sounds good. Added one minor comment and another question about the caching which I'm not sure it will work.

lib/datasource/repology/index.ts Outdated Show resolved Hide resolved
lib/datasource/repology/index.ts Show resolved Hide resolved
zeldigas and others added 2 commits February 2, 2021 12:45
Co-authored-by: Daniel Tschinder <duck+github@mailbox.org>
@rarkins
Copy link
Collaborator

rarkins commented Feb 3, 2021

Can someone test this on a real repo first before we merge?

@zeldigas
Copy link
Contributor Author

zeldigas commented Feb 3, 2021

@rarkins are you looking for real project or test repository showing that change works properly will do?

@rarkins
Copy link
Collaborator

rarkins commented Feb 3, 2021

Test repository is fine, as long as it validates both list and non-list return types

@zeldigas
Copy link
Contributor Author

zeldigas commented Feb 3, 2021

@rarkins test repository - https://github.com/zeldigas/renovate-repology

It has 2 packages to update - version of jdk in alpine (worked prior to PR as repology returns one version) and version of jdk for centos_8 (does not work without PR).

Right now it works (see associated PRs). Log can be found here: https://pastebin.com/FMTLW4JZ

@rarkins rarkins merged commit 8032ffd into renovatebot:master Feb 3, 2021
@rarkins
Copy link
Collaborator

rarkins commented Feb 3, 2021

Thanks, @zeldigas

@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 24.35.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repology datasource fails to retrieve version info in case of multiple versions
4 participants