Skip to content

tools: be intentional about masking possible error in start-ci.sh - #41284

Merged
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
Trott:start-ci-shellcheck
Dec 24, 2021
Merged

tools: be intentional about masking possible error in start-ci.sh#41284
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
Trott:start-ci-shellcheck

Conversation

@Trott

Copy link
Copy Markdown
Member

Revise start-ci.sh to conform with shellcheck 0.8.0 default checks.

Refs: https://www.shellcheck.net/wiki/SC2312

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/actions

@nodejs-github-botnodejs-github-bot added the tools Issues and PRs related to the tools directory. label Dec 22, 2021
@Trott
Trott requested a review from aduh95December 22, 2021 17:19

@richardlaurichardlau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving, but I have a vague recollection that ncu-ci doesn't actually return a non-zero exit code when it fails to start a CI.

@aduh95

Copy link
Copy Markdown
Contributor

Approving, but I have a vague recollection that ncu-ci doesn't actually return a non-zero exit code when it fails to start a CI.

Yes I don't think this code is ever run currently.
And if it was ever run, since we're in the error path at this point, I don't think this change is what we want to do: if cat output was to return an error, we wouldn't want to crash, but rather ignore the error and comment with an empty <details> to notify of the error.

@richardlau

Copy link
Copy Markdown
Member

Approving, but I have a vague recollection that ncu-ci doesn't actually return a non-zero exit code when it fails to start a CI.

I think I looked into #39746 back when it was opened and determined that the Jenkins rest API correctly returned an error but that was lost somewhere (I wasn't able to track down where) inside node-core-utils and ncu-ci was still exiting with a zero exit code.

@Trott

Copy link
Copy Markdown
MemberAuthor

And if it was ever run, since we're in the error path at this point, I don't think this change is what we want to do: if cat output was to return an error, we wouldn't want to crash,

Then I guess the thing to do is to add || true to it or suppress the lint warning with a # shellcheck disable comment.

@aduh95aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's mask the possible error so GH Actions can still send the comment reporting the previous error.

Revise start-ci.sh to conform with shellcheck 0.8.0 default checks.
Refs: https://www.shellcheck.net/wiki/SC2312
@Trott
Trottforce-pushed the start-ci-shellcheck branch from 0f852ce to 578620dCompareDecember 23, 2021 00:33
@Trott

Copy link
Copy Markdown
MemberAuthor

Let's mask the possible error so GH Actions can still send the comment reporting the previous error.

OK, done. PTAL.

@TrottTrott added fast-track PRs that do not need to wait for 48 hours to land. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Dec 23, 2021
@github-actions

Copy link
Copy Markdown
Contributor

Fast-track has been requested by @Trott. Please 👍 to approve.

@aduh95aduh95 changed the title tools: do not mask possible error from command in start-ci.sh tools: be intentional about masking possible error in start-ci.shDec 23, 2021
@TrottTrott added commit-queue Add this label to land a pull request using GitHub Actions. and removed fast-track PRs that do not need to wait for 48 hours to land. labels Dec 24, 2021
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 24, 2021
@nodejs-github-bot
nodejs-github-bot merged commit 5cc4b69 into nodejs:masterDec 24, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 5cc4b69

@Trott
Trott deleted the start-ci-shellcheck branch December 24, 2021 23:27
targos pushed a commit that referenced this pull request Jan 14, 2022
Revise start-ci.sh to conform with shellcheck 0.8.0 default checks.
Refs: https://www.shellcheck.net/wiki/SC2312
PR-URL: #41284
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@targostargos mentioned this pull request Jan 16, 2022
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
Revise start-ci.sh to conform with shellcheck 0.8.0 default checks.
Refs: https://www.shellcheck.net/wiki/SC2312
PR-URL: #41284
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
Revise start-ci.sh to conform with shellcheck 0.8.0 default checks.
Refs: https://www.shellcheck.net/wiki/SC2312
PR-URL: #41284
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@danielleadamsdanielleadams mentioned this pull request Feb 1, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@Trott@nodejs-github-bot@aduh95@richardlau@lpinca@tniessen