Skip to content

Return compatibility score#146

Merged
brrygrdn merged 17 commits intodependabot:mainfrom
pangaeatech:get_compat_score
Feb 28, 2022
Merged

Return compatibility score#146
brrygrdn merged 17 commits intodependabot:mainfrom
pangaeatech:get_compat_score

Conversation

@mwaddell
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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