-
Notifications
You must be signed in to change notification settings - Fork 61
Hotfix: check org and repo for linked issue #789
base: development
Are you sure you want to change the base?
Hotfix: check org and repo for linked issue #789
Conversation
✅ Deploy Preview for ubiquibot-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
… into feat/check-org-and-repo-for-linked-issue
QA: https://github.com/wannacfuture/Battleship/pull/36 (see linked issues if they are assigned correctly) |
const issue = await getIssueByNumber(context, +linkedIssueNumber); | ||
if (!issue?.assignees) continue; | ||
const issue = await getIssueByNumber(context, +linkedIssueNumber); | ||
if (!issue?.assignees) continue; |
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.
If there's no assignee, we don't need to assign the opener of the linked PR to the issue?
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.
It doesn't mean there is no assinee.
It just wants to make sure if assinees
field exists on the issue not if(issue?.assignees.length === 0)
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.
Sounds like the same thing. No assignee means the assignees
field doesn't exist, right?
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.
No assignee means assignees field is empty array, not undefined.
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 if statement will only execute if assignees
is undefined or null, but not if its empty array. github should always send empty array if there's no assignees but if they don't send the field, this could possibly be a bug.
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.
Exactly. we need to go on, to assign the author of the linked PR to the issue if assignees is empty array.
If it is undefined or null, it should skip the loop.
Resolves #666