Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/pr_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const GITHUB_SUCCESS_CONCLUSIONS = ['SUCCESS', 'NEUTRAL', 'SKIPPED'];
const FAST_TRACK_RE = /^Fast-track has been requested by @(.+?)\. Please 👍 to approve\.$/;
const FAST_TRACK_MIN_APPROVALS = 2;
const GIT_CONFIG_GUIDE_URL = 'https://github.com/nodejs/node/blob/99b1ada/doc/guides/contributing/pull-requests.md#step-1-fork';
const IGNORED_CHECK_SLUGS = ['dependabot', 'codecov'];

// eslint-disable-next-line no-extend-native
Array.prototype.findLastIndex ??= function findLastIndex(fn) {
Expand Down Expand Up @@ -374,9 +373,10 @@ export default class PRChecker {

// GitHub new Check API
for (const { status, conclusion, app } of checkSuites.nodes) {
if (app && IGNORED_CHECK_SLUGS.includes(app.slug)) {
// Ignore Dependabot and Codecov check suites.
// They are expected to show up sometimes and never complete.
if (app.slug !== 'github-actions') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (app.slug !== 'github-actions') {
if (app && app.slug !== 'github-actions') {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (app.slug !== 'github-actions') {
if (app?.slug !== 'github-actions') {

a suggestion upon your suggestion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is needed.

// Ignore all non-github check suites, such as Dependabot and Codecov.
// They are expected to show up on PRs whose head branch is not on a
// fork and never complete.
continue;
}

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/github-ci/both-apis-failure.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "FAILURE"
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/github-ci/both-apis-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "SUCCESS"
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/github-ci/check-suite-failure.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "FAILURE"
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/github-ci/check-suite-pending.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "IN_PROGRESS"
}
]
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/github-ci/check-suite-skipped.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "SKIPPED"
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/github-ci/check-suite-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "SUCCESS"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "SUCCESS"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"checkSuites": {
"nodes": [
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "FAILURE"
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/github-ci/success-dependabot-queued.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"conclusion": null
},
{
"app": { "slug": "github-actions" },
"status": "COMPLETED",
"conclusion": "SUCCESS"
}
Expand Down
Loading