Skip to content

tools: update ESLint to 8.2.0 - #40734

Closed
lpinca wants to merge 1 commit into
nodejs:masterfrom
lpinca:update/eslint
Closed

tools: update ESLint to 8.2.0#40734
lpinca wants to merge 1 commit into
nodejs:masterfrom
lpinca:update/eslint

Conversation

@lpinca

Copy link
Copy Markdown
Member

Update ESLint to 8.2.0

@nodejs-github-botnodejs-github-bot added the tools Issues and PRs related to the tools directory. label Nov 6, 2021
@targostargos added the fast-track PRs that do not need to wait for 48 hours to land. label Nov 6, 2021
@github-actions

Copy link
Copy Markdown
Contributor

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

@TrottTrott 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.

Rubber-stamp LGTM

@TrottTrott added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 6, 2021
@github-actionsgithub-actionsBot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 6, 2021
@targos

Copy link
Copy Markdown
Member

Commit queue failed (https://github.com/nodejs/node/runs/4125859812?check_suite_focus=true) but it only commented on #40720

@targos

Copy link
Copy Markdown
Member

Last lines of the logs:

To finish landing:
1. Run `git push origin master`
2. Post "Landed in 4d01716bcefe" in https://github.com/nodejs/node/pull/40734
+ [ -z --oneCommitMax ]
+ git log -1 --pretty=format:%s
+ git log -1 --pretty=format:%b
+ jq -n --arg title tools: update ESLint to 8.2.0 --arg body PR-URL: https://github.com/nodejs/node/pull/40734
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com> {merge_method:"squash",commit_title:$title,commit_message:$body}
+ cat output.json
{
"merge_method": "squash",
"commit_title": "tools: update ESLint to 8.2.0",
"commit_message": "PR-URL: https://github.com/nodejs/node/pull/40734\nReviewed-By: Michaël Zasso <targos@protonmail.com>\nReviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>\nReviewed-By: Rich Trott <rtrott@gmail.com>"
}
+ mergeUrl 40734
+ echo https://api.github.com/repos/nodejs/node/pulls/40734/merge
+ gitHubCurl https://api.github.com/repos/nodejs/node/pulls/40734/merge PUT --data @output.json
+ url=https://api.github.com/repos/nodejs/node/pulls/40734/merge
+ method=PUT
+ shift 2
+ curl -fsL --request PUT --url https://api.github.com/repos/nodejs/node/pulls/40734/merge --header authorization: *** --header content-type: application/json --data @output.json
Error: Process completed with exit code 22.

@targos

Copy link
Copy Markdown
Member

Exit code 22 means that the HTTP response's code was >=400

@targos

Copy link
Copy Markdown
Member

I tried locally, the response code is 404

@Trott

Trott commented Nov 6, 2021

Copy link
Copy Markdown
Member

Commit queue failed (https://github.com/nodejs/node/runs/4125859812?check_suite_focus=true) but it only commented on #40720

@aduh95 Probably related to 80b8440?

Trott pushed a commit that referenced this pull request Nov 6, 2021
PR-URL: #40734
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott

Trott commented Nov 6, 2021

Copy link
Copy Markdown
Member

Landed in 1977afd

@TrottTrott closed this Nov 6, 2021
@targos

Copy link
Copy Markdown
Member

@aduh95 ^

@aduh95

Copy link
Copy Markdown
Contributor

I tried landing #40664 (comment) using the CQ, and it crashed. However, trying the command manually succeeded for me, I wasn't able to reproduce the 404. Maybe it's token that we use is not allowed to merge PRs?

@targos

Copy link
Copy Markdown
Member

I think we use the default token provided by GitHub. It's supposed to have read/write access to pull requests: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

@aduh95

aduh95 commented Nov 6, 2021

Copy link
Copy Markdown
Contributor

We don't, we set a special one from the repo secrets:

# A personal token is required because pushing with GITHUB_TOKEN will
# prevent commits from running CI after they land. It needs
# to be set here because `checkout` configures GitHub authentication
# for push as well.
token: ${{ secrets.GH_USER_TOKEN }}

@targos

Copy link
Copy Markdown
Member

That's not the one we pass to commit-queue.sh:

run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]')

@aduh95

Copy link
Copy Markdown
Contributor

According to the Set up job section, it does have write permissions:

GITHUB_TOKEN Permissions
Actions: write
Checks: write
Contents: write
Deployments: write
Discussions: write
Issues: write
Metadata: read
Packages: write
Pages: write
PullRequests: write
RepositoryProjects: write
SecurityEvents: write
Statuses: write

Anyway it's very surprising the CQ was working on node-auto-test but doesn't on nodejs/node. Maybe it's related to one of the branch protection rules? None are setup on node-auto-test.

@targos

Copy link
Copy Markdown
Member

Maybe it's related to one of the branch protection rules?

Mmmh, that's possible. We do have a rule that only allows members of @nodejs/collaborators to push to the master branch. That makes me wonder how the commit queue ever worked, because obviously the github-actions bot is not a member of that team.

@aduh95

Copy link
Copy Markdown
Contributor

That makes me wonder how the commit queue ever worked, because obviously the github-actions bot is not a member of that team.

That's probably when the GH_USER_TOKEN is used, according the comment above.

@targos

Copy link
Copy Markdown
Member

Oh I see, the nodejs-github-bot account is in the collaborators team... Then the solution is probably to pass its token to the script instead of the default one.

@targos

Copy link
Copy Markdown
Member

I explicitly added the bot to the list of who can push. I'd remove it from collaborators but I don't know if it would break something else.
image

@lpinca
lpinca deleted the update/eslint branch November 6, 2021 18:53
targos pushed a commit that referenced this pull request Nov 8, 2021
PR-URL: #40734
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@targostargos mentioned this pull request Nov 8, 2021
BethGriggs pushed a commit that referenced this pull request Nov 25, 2021
PR-URL: #40734
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Nov 26, 2021
1 task
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-trackPRs that do not need to wait for 48 hours to land.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@lpinca@targos@Trott@aduh95@VoltrexKeyva@nodejs-github-bot