From ee1fdbfeabe07b84db4742ab48c35f9492e865e4 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 24 Sep 2024 10:17:59 +0200 Subject: [PATCH 1/3] fix(git-node): ignore all non-gha nodes when checking for GitHub CI --- lib/pr_checker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pr_checker.js b/lib/pr_checker.js index b37314e4..064c647c 100644 --- a/lib/pr_checker.js +++ b/lib/pr_checker.js @@ -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) { @@ -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)) { + if (app.slug !== 'github-actions') { // Ignore Dependabot and Codecov check suites. - // They are expected to show up sometimes and never complete. + // They are expected to show up on PRs whose head branch is not on a + // fork and never complete. continue; } From 67780a32e552370e958277adc6608634a1245054 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 24 Sep 2024 16:10:30 +0200 Subject: [PATCH 2/3] update fixtures --- test/fixtures/github-ci/both-apis-failure.json | 1 + test/fixtures/github-ci/both-apis-success.json | 1 + test/fixtures/github-ci/check-suite-failure.json | 1 + test/fixtures/github-ci/check-suite-pending.json | 1 + test/fixtures/github-ci/check-suite-skipped.json | 1 + test/fixtures/github-ci/check-suite-success.json | 1 + test/fixtures/github-ci/status-failure-check-suite-succeed.json | 1 + test/fixtures/github-ci/status-succeed-check-suite-failure.json | 1 + test/fixtures/github-ci/success-dependabot-queued.json | 1 + 9 files changed, 9 insertions(+) diff --git a/test/fixtures/github-ci/both-apis-failure.json b/test/fixtures/github-ci/both-apis-failure.json index 3866f56d..aa552cce 100644 --- a/test/fixtures/github-ci/both-apis-failure.json +++ b/test/fixtures/github-ci/both-apis-failure.json @@ -13,6 +13,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "FAILURE" } diff --git a/test/fixtures/github-ci/both-apis-success.json b/test/fixtures/github-ci/both-apis-success.json index 86fb337c..c58e7abc 100644 --- a/test/fixtures/github-ci/both-apis-success.json +++ b/test/fixtures/github-ci/both-apis-success.json @@ -13,6 +13,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "SUCCESS" } diff --git a/test/fixtures/github-ci/check-suite-failure.json b/test/fixtures/github-ci/check-suite-failure.json index 9f34c110..b299e1e7 100644 --- a/test/fixtures/github-ci/check-suite-failure.json +++ b/test/fixtures/github-ci/check-suite-failure.json @@ -10,6 +10,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "FAILURE" } diff --git a/test/fixtures/github-ci/check-suite-pending.json b/test/fixtures/github-ci/check-suite-pending.json index de284a9a..c09d11bf 100644 --- a/test/fixtures/github-ci/check-suite-pending.json +++ b/test/fixtures/github-ci/check-suite-pending.json @@ -10,6 +10,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "IN_PROGRESS" } ] diff --git a/test/fixtures/github-ci/check-suite-skipped.json b/test/fixtures/github-ci/check-suite-skipped.json index 42012526..6a2cb755 100644 --- a/test/fixtures/github-ci/check-suite-skipped.json +++ b/test/fixtures/github-ci/check-suite-skipped.json @@ -10,6 +10,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "SKIPPED" } diff --git a/test/fixtures/github-ci/check-suite-success.json b/test/fixtures/github-ci/check-suite-success.json index ed7f3d6b..1dc5f395 100644 --- a/test/fixtures/github-ci/check-suite-success.json +++ b/test/fixtures/github-ci/check-suite-success.json @@ -10,6 +10,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "SUCCESS" } diff --git a/test/fixtures/github-ci/status-failure-check-suite-succeed.json b/test/fixtures/github-ci/status-failure-check-suite-succeed.json index 98b03e69..28faa58c 100644 --- a/test/fixtures/github-ci/status-failure-check-suite-succeed.json +++ b/test/fixtures/github-ci/status-failure-check-suite-succeed.json @@ -13,6 +13,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "SUCCESS" } diff --git a/test/fixtures/github-ci/status-succeed-check-suite-failure.json b/test/fixtures/github-ci/status-succeed-check-suite-failure.json index cef60ce6..6a336cd8 100644 --- a/test/fixtures/github-ci/status-succeed-check-suite-failure.json +++ b/test/fixtures/github-ci/status-succeed-check-suite-failure.json @@ -13,6 +13,7 @@ "checkSuites": { "nodes": [ { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "FAILURE" } diff --git a/test/fixtures/github-ci/success-dependabot-queued.json b/test/fixtures/github-ci/success-dependabot-queued.json index a798e9f9..557452f5 100644 --- a/test/fixtures/github-ci/success-dependabot-queued.json +++ b/test/fixtures/github-ci/success-dependabot-queued.json @@ -17,6 +17,7 @@ "conclusion": null }, { + "app": { "slug": "github-actions" }, "status": "COMPLETED", "conclusion": "SUCCESS" } From 4b4e6e3739a929fb0d94be4562d2677238e5e2c0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 24 Sep 2024 16:11:37 +0200 Subject: [PATCH 3/3] Update lib/pr_checker.js Co-authored-by: Aviv Keller --- lib/pr_checker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pr_checker.js b/lib/pr_checker.js index 064c647c..754a89c2 100644 --- a/lib/pr_checker.js +++ b/lib/pr_checker.js @@ -374,7 +374,7 @@ export default class PRChecker { // GitHub new Check API for (const { status, conclusion, app } of checkSuites.nodes) { if (app.slug !== 'github-actions') { - // Ignore Dependabot and Codecov check suites. + // 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;