-
Notifications
You must be signed in to change notification settings - Fork 30
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
Prevent duplicate issues on GitHub reports #1111
Conversation
Prevent duplicate GitHub issues by stopping on getIssue failures
337b6a2
to
aa3b7f5
Compare
Nock versions < 14 cannot mock native `fetch` requests used by Octokit > 2.0.2. However, Nock 14.0.0-beta.15 can handle these requests. This serves as a temporary fix until Nock v14 is officially released.
88b6ab4
to
88d3771
Compare
src/reporter/github.js
Outdated
} | ||
} catch (error) { | ||
logger.error(`🤖 Failed to handle repository labels: ${error.message}`); |
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.
What is the point of this “robot” emoji in the logs?
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 is just legacy
src/reporter/github.js
Outdated
|
||
return this.closeIssue(openedIssue); | ||
return logger.info(`🤖 Closed issue #${openedIssue.number}: ${openedIssue.html_url}`); |
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.
Why do we log this?
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.
I find it useful to log the changes made to the reported issues.
src/reporter/github.js
Outdated
return this.closeIssue(openedIssue); | ||
return logger.info(`🤖 Closed issue #${openedIssue.number}: ${openedIssue.html_url}`); | ||
} catch (error) { | ||
logger.error(`🤖 Failed to handle issue "${title}": ${error.message}`); |
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.
logger.error(`🤖 Failed to handle issue "${title}": ${error.message}`); | |
logger.error(`Failed to update issue "${title}": ${error.message}`); |
src/reporter/github.js
Outdated
const [managedLabel] = issue.labels.filter(label => managedLabelsNames.includes(label.name)); // it is assumed that only one specific reason for failure is possible at a time, making managed labels mutually exclusive | ||
if (issue.state == GitHub.ISSUE_STATE_CLOSED) { | ||
await this.openIssue(issue); | ||
logger.info(`🤖 Reopen issue #${issue.number}: ${issue.html_url}`); |
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.
Do we really need to log this?
logger.info(`🤖 Reopen issue #${issue.number}: ${issue.html_url}`); | |
logger.info(`Reopened issue #${issue.number}: ${issue.html_url}`); |
src/reporter/github.js
Outdated
await this.addCommentToIssue({ issue, comment: description }); | ||
logger.info(`🤖 Updated issue #${issue.number}: ${issue.html_url}`); | ||
} catch (error) { | ||
logger.error(`🤖 Failed to handle issue "${title}": ${error.message}`); |
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.
logger.error(`🤖 Failed to handle issue "${title}": ${error.message}`); | |
logger.error(`Failed to update issue "${title}": ${error.message}`); |
No description provided.