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

Return compatibility score #146

Merged
merged 17 commits into from Feb 28, 2022
Merged

Conversation

mwaddell
Copy link
Contributor

closes #98

NOTE: This PR is a branch off of (and depends upon #144), so merging this one first would also merge that one too.

@mwaddell mwaddell requested a review from a team as a code owner February 21, 2022 00:46
@mwaddell mwaddell marked this pull request as draft February 21, 2022 16:40
@mwaddell
Copy link
Contributor Author

I'll add a separate input for this one following the pattern discussed in #144

@mwaddell mwaddell marked this pull request as ready for review February 22, 2022 01:37
@mwaddell
Copy link
Contributor Author

I'll add a separate input for this one following the pattern discussed in #144

Done.

targetBranch: string,
prevVersion: string,
newVersion: string,
compatScore: number
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll need to double check out API to see how we handle Dependency Score unknown in the API as I can't remember off the top of my head.

Copy link
Contributor

@brrygrdn brrygrdn left a comment

Choose a reason for hiding this comment

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

I just need to double check our API behaviour in one case, otherwise this looks great.

Thanks for adding a separate input flag for this lookup as well 🚀

})

const scoreChunk = svg.match(/<title>compatibility: (?<score>\d+)%<\/title>/m)
return scoreChunk?.groups ? parseInt(scoreChunk.groups.score) : 0
Copy link
Contributor

@brrygrdn brrygrdn Feb 28, 2022

Choose a reason for hiding this comment

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

Just double-checking, when we have an incompatible badge, e.g.

Line 114 will extract the word unknown, which evaluates to 0 here, so that's all good 👍🏻

@brrygrdn brrygrdn merged commit 0ca01a5 into dependabot:main Feb 28, 2022
@brrygrdn brrygrdn mentioned this pull request Feb 28, 2022
@mwaddell mwaddell deleted the get_compat_score branch March 1, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose compatibility score
2 participants