-
Notifications
You must be signed in to change notification settings - Fork 7
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: PR lookup for PRs with no backports #34
Conversation
9cba3e6
to
a1a0983
Compare
@@ -1,7 +1,6 @@ | |||
const Handlebars = require('handlebars'); | |||
const { Router } = require('express'); | |||
const semver = require('semver'); | |||
const MarkdownIt = require('markdown-it'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left from previous PR
@@ -132,7 +128,6 @@ async function getPRReleaseStatus(prNumber) { | |||
|
|||
// This is the primary PR, we can scan from here for backports | |||
return { | |||
highlightPR: prNumber, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beyond the stated fix, this PR also makes data fetching more consistent and adds error logging in event of failure. This caused an issue for me while i was debugging as I'd not properly authenticated with octokit and was getting rate limited without realizing it.
I'm not a fan of wrapping these in try
/catch
with empty results since they're memoized and the empty results will be cached. Especially for getReleasesOrUpdate
, I wouldn't want a transient error causing an empty response which is then cached. Users hitting those endpoints should get some kind of error so that they know the response is not valid.
Can we find a middle ground with extra logging but still throwing the errors there?
@dsanders11 fair enough - i can at minimum split it into another PR |
4c5fd05
to
2133501
Compare
2133501
to
85a8a17
Compare
This PR fixes an issue where the user would incorrectly be redirected to the homepage when trying to look up certain PRs. This was happening because of an incorrect assumption being made that the base ref would be main if it was merged to the default branch, which wouldn't be true for older branches merged to
master
before the rename.