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

feat(datasource/hex): extract deprecated versions #26392

Merged

Conversation

RahulGautamSingh
Copy link
Collaborator

Changes

Extract retired versions from the response and use it to populate the isDepreceated field in release info.

Context

Closes: #26391

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 select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Needs a test

@rarkins
Copy link
Collaborator

rarkins commented Dec 21, 2023

Where is this schema from?

@rarkins
Copy link
Collaborator

rarkins commented Dec 21, 2023

I can see this example: https://hex.pm/api/packages/ueberauth

But I can't find anywhere on the net where retirements is standardized

@RahulGautamSingh
Copy link
Collaborator Author

The docs are outdated hence we have to confirm the details by visting the api source code at https://github.com/hexpm/hexpm/blob/main/lib/hexpm_web/views/api

For our use-case we need to check the package-view and confirm the structure of the response:
https://github.com/hexpm/hexpm/blob/d6bfdb1ecae7f05b826b252be2e53f6a59da7a38/lib/hexpm_web/views/api/package_view.ex#L61

PS: Here is a comment from the owner confirming that the docs are outdated.

@rarkins rarkins changed the title feat(datasource/hex): extract depreceated versions feat(datasource/hex): extract deprecated versions Dec 21, 2023
@rarkins rarkins requested a review from viceice December 21, 2023 16:17
@rarkins rarkins added this pull request to the merge queue Dec 21, 2023
Merged via the queue into renovatebot:main with commit 6b4d5fc Dec 21, 2023
36 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.106.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Cikey
Copy link

Cikey commented Jan 17, 2024

This breaks for hackney:

 WARN: Error fetching https://hex.pm/api/packages/hackney (repository=foobaR)
       "datasource": "hex",
       "packageName": "hackney",
       "err": {
         "message": "Schema error",
         "stack": "ZodError: Schema error\n    at Object.get error [as error] (/opt/containerbase/tools/renovate/37.137.3/node_modules/zod/lib/types.js:43:31)\n    at ZodEffects.parseAsync (/opt/containerbase/tools/renovate/37.137.3/node_modules/zod/lib/types.js:166:22)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at Http.requestJson (/opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/util/http/index.ts:316:18)\n    at HexDatasource.getReleases (/opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/modules/datasource/hex/index.ts:45:34)\n    at /opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/util/cache/package/decorator.ts:119:18\n    at getRegistryReleases (/opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/modules/datasource/index.ts:77:15)\n    at fetchReleases (/opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/modules/datasource/index.ts:289:15)\n    at lookupUpdates (/opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/workers/repository/process/lookup/index.ts:115:56)\n    at withLookupStats (/opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/workers/repository/process/fetch.ts:27:18)\n    at fetchDepUpdates (/opt/containerbase/tools/renovate/37.137.3/node_modules/renovate/lib/workers/repository/process/fetch.ts:72:30)\n    at /opt/containerbase/tools/renovate/37.137.3/node_modules/p-map/index.js:57:22",
         "issues": {
           "retirements": {
             "1.6.4": {"message": "Expected string, received null"},
             "1.6.6": {"message": "Expected string, received null"}
           }
         }
       }
bunyan: ERROR: Exception thrown from the "err" Bunyan serializer. This should never happen. This is a bug in that serializer function.

For whatever reasons, hackney has a null message: https://hex.pm/api/packages/hackney

@viceice
Copy link
Member

viceice commented Jan 17, 2024

@Cikey next time please open a new discussion instead of commenting on merged / closed PR's

@Cikey
Copy link

Cikey commented Jan 17, 2024

I tried, but i didn't realize i had to use the discussion option to open a bug report 🤷🏻 next time..

zT-1337 pushed a commit to scm-manager/renovate that referenced this pull request Jan 22, 2024
zT-1337 pushed a commit to scm-manager/renovate that referenced this pull request Jan 24, 2024
zT-1337 pushed a commit to scm-manager/renovate that referenced this pull request Jan 24, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2024
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.

Ignore depreceated versions for mix dependencies
5 participants