Skip to content
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

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

Merged
merged 3 commits into from
Sep 26, 2024

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.

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

lib/pr_checker.js Outdated Show resolved Hide resolved
@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
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants