Skip to content

fix(git-node): ignore all non-gha nodes when checking for GitHub CI#857

Merged
aduh95 merged 3 commits intonodejs:mainfrom
aduh95:ignnore-apps-for-github-ci
Sep 26, 2024
Merged

fix(git-node): ignore all non-gha nodes when checking for GitHub CI#857
aduh95 merged 3 commits intonodejs:mainfrom
aduh95:ignnore-apps-for-github-ci

Conversation

@aduh95
Copy link
Contributor

@aduh95 aduh95 commented Sep 24, 2024

Implements #838 (comment). The problem has come back now that we have a new jenkins-node-js-ci (see nodejs/admin#916), and IMO it only makes sense to check for GHA-related jobs only when checking the state of the GitHub CI.

// 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') {
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.

aduh95 and others added 2 commits September 24, 2024 16:10
Co-authored-by: Aviv Keller <redyetidev@gmail.com>
@targos
Copy link
Member

targos commented Sep 25, 2024

The problem has come back now that we have a new jenkins-node-js-ci

Now I don't understand:

  • How this can affect "production" jobs. I have only tried to use the plugin on a copy of the linter job
  • How can I see these checks? I have still been unable to see any effect of the option on the job copy (in GitHub UI or Jenkins output).
@aduh95
Copy link
Contributor Author

aduh95 commented Sep 25, 2024

  • How can I see these checks?

One way is to apply the following diff and run git node land on a PR which head branch in on nodejs/node.

diff --git a/lib/pr_checker.js b/lib/pr_checker.js index 064c647..129b9a5 100644 --- a/lib/pr_checker.js +++ b/lib/pr_checker.js @@ -381,6 +381,7 @@ export default class PRChecker { } if (status !== 'COMPLETED') { + console.log(checkSuites.nodes); cli.error('GitHub CI is still running'); return false; } @@ -395,6 +396,7 @@ export default class PRChecker { if (commit.status) { const { state } = commit.status; if (state === 'PENDING') { + console.log(checkSuites.nodes); cli.error('GitHub CI is still running'); return false; }
@aduh95 aduh95 merged commit 342ff5b into nodejs:main Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants