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

Hotfix: check org and repo for linked issue #789

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

wannacfuture
Copy link
Contributor

Resolves #666

@netlify
Copy link

netlify bot commented Sep 20, 2023

Deploy Preview for ubiquibot-staging ready!

Name Link
🔨 Latest commit 3a31f58
🔍 Latest deploy log https://app.netlify.com/sites/ubiquibot-staging/deploys/652c98dc3d64070008374a5c
😎 Deploy Preview https://deploy-preview-789--ubiquibot-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/helpers/parser.ts Outdated Show resolved Hide resolved
@wannacfuture
Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

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.

Automatic Assign on Opened Pull Request (Assigned to Unrelated Task!)
3 participants