Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

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

@wannacfuture wannacfuture Oct 16, 2023

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

@wannacfuture wannacfuture Oct 17, 2023

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
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