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

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

Merged
merged 1 commit into from Dec 24, 2021

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 22, 2021

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
Collaborator

Review requested:

  • @nodejs/actions

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

@richardlau richardlau left a comment

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
Contributor

aduh95 commented Dec 22, 2021

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
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
Member Author

Trott commented Dec 23, 2021

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.

Copy link
Contributor

@aduh95 aduh95 left a comment

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
Copy link
Member Author

Trott commented Dec 23, 2021

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

OK, done. PTAL.

@Trott Trott 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
Contributor

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

@aduh95 aduh95 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.sh Dec 23, 2021
@Trott Trott 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-bot nodejs-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:master Dec 24, 2021
@nodejs-github-bot
Copy link
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>
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>
Linkgoron pushed a commit to Linkgoron/node 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: nodejs#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>
@danielleadams danielleadams mentioned this pull request Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants