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

[Hexpm] Fix badges for pre-release only versions #10112

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

sheerlox
Copy link
Contributor

Hex.pm's API now seems to return null for latest_stable_version, where I assume from shields' code that it previously did not return the property at all:

  },
  "html_url": "https://hex.pm/packages/nodelix",
  "latest_stable_version": null
}

source

This PR aims to support that in order for badges of pre-release-only version packages work again.

Example of a broken badge:

Error logs from npm run badge -- /hexpm/dt/nodelix on master:

 Response did not match schema  🤷 
 "latest_stable_version" must be a string
 Handled error  🙅 
 [ValidationError: "latest_stable_version" must be a string] {
  prettyMessage: 'invalid response data',
  cacheSeconds: undefined,
  response: undefined
}

Copy link
Contributor

Messages
📖 ✨ Thanks for your contribution to Shields, @sheerlox!

Generated by 🚫 dangerJS against e3188a9

@sheerlox sheerlox changed the title [Hex.pm] Fix badges for pre-release only versions [Hexpm] Fix badges for pre-release only versions Apr 23, 2024
Copy link
Contributor

🚀 Updated review app: https://pr-10112-badges-shields.fly.dev

@chris48s chris48s added bug Bugs in badges and the frontend service-badge New or updated service badge labels Apr 24, 2024
Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

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

thanks 👍

@chris48s chris48s added this pull request to the merge queue Apr 24, 2024
Merged via the queue into badges:master with commit edae807 Apr 24, 2024
22 of 24 checks passed
@sheerlox sheerlox deleted the fix/hexpm-validation-schema branch April 24, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants