node icon indicating copy to clipboard operation
node copied to clipboard

build: update ruff and add `lint-py-fix`

Open avivkeller opened this issue 1 year ago • 5 comments

This PR updates ruff to 0.6.2, and adds two new makefile targets: lint-py-fix lint-py-fix-unsafe

avivkeller avatar Aug 16 '24 16:08 avivkeller

CC @nodejs/python

avivkeller avatar Aug 16 '24 18:08 avivkeller

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.77%. Comparing base (efbba60) to head (5856d01). Report is 529 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54410      +/-   ##
==========================================
- Coverage   88.06%   87.77%   -0.29%     
==========================================
  Files         651      651              
  Lines      183538   183538              
  Branches    35862    35527     -335     
==========================================
- Hits       161635   161109     -526     
- Misses      15142    15678     +536     
+ Partials     6761     6751      -10     

see 65 files with indirect coverage changes

codecov[bot] avatar Aug 16 '24 18:08 codecov[bot]

No objections in a week, how is everyone feeling about this?

avivkeller avatar Aug 23 '24 18:08 avivkeller

Its never ending...

avivkeller avatar Aug 24 '24 18:08 avivkeller

Once this lands? Given that ruff keeps updating, another one shouldn't be opened until the next semver-minor, WDYT @cclauss

P.S. can this land?

avivkeller avatar Aug 26 '24 23:08 avivkeller

(This modifies the Makefile, I don't know why I ever removed needs-ci)

I've also requested a CI, hopefully that's okay.

avivkeller avatar Sep 04 '24 00:09 avivkeller

CI: https://ci.nodejs.org/job/node-test-pull-request/61941/

nodejs-github-bot avatar Sep 04 '24 21:09 nodejs-github-bot

I know ruff 0.6.3 is out, but I don't think it's worth it to upgrade ruff again until the next semver-minor.

avivkeller avatar Sep 04 '24 21:09 avivkeller

@nodejs/python I have given this pull request a positive review and I think it should be merged but I am uncertain him to remove the Merging is blocked comment below.

cclauss avatar Sep 05 '24 03:09 cclauss

IIUC that notice is to prevent accidental merging from the GitHub UI (not the CQ)

avivkeller avatar Sep 05 '24 10:09 avivkeller

What is a CQ?

cclauss avatar Sep 05 '24 10:09 cclauss

Apologies, the Commit Queue

avivkeller avatar Sep 05 '24 11:09 avivkeller

This PR has approvals, and the last (recent) CI was a 💚 . Per the collaborator guide, I've marked this as author ready, but as a triage, LMK if I should've not done that.

avivkeller avatar Sep 10 '24 19:09 avivkeller

This needs a rebase to resolve conflicts.

lpinca avatar Sep 14 '24 14:09 lpinca

Failed to start CI
   ⚠  Something was pushed to the Pull Request branch since the last approving review.
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/10863398686

github-actions[bot] avatar Sep 14 '24 15:09 github-actions[bot]

The CI failed to start. See https://ci.nodejs.org/job/node-test-pull-request/62430/ for information.

Output
Started by user Node.js GitHub Bot
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building remotely on test-mnx-ubuntu2204-x64-1 (jenkins-workspace) in workspace /home/iojs/build/workspace/node-test-pull-request
The recommended git tool is: NONE
using credential 96d5f81c-e9ad-45f7-ba5d-bc8107c0ae2c
 > git rev-parse --resolve-git-dir /home/iojs/build/workspace/node-test-pull-request/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url [email protected]:nodejs/node.git # timeout=10
Fetching upstream changes from [email protected]:nodejs/node.git
 > git --version # timeout=10
 > git --version # 'git version 2.34.1'
using GIT_SSH to set credentials 
Verifying host key using known hosts file
 > git fetch --no-tags --force --progress -- [email protected]:nodejs/node.git +refs/heads/*:refs/remotes/origin/* +refs/pull/54410/head:refs/remotes/origin/_jenkins_local_branch # timeout=20
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from [email protected]:nodejs/node.git
	at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:997)
	at PluginClassLoader for git//hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1239)
	at PluginClassLoader for git//hudson.plugins.git.GitSCM._checkout(GitSCM.java:1310)
	at PluginClassLoader for git//hudson.plugins.git.GitSCM.checkout(GitSCM.java:1277)
	at hudson.scm.SCM.checkout(SCM.java:540)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1247)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:521)
	at PluginClassLoader for jenkins-multijob-plugin//com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:148)
	at hudson.model.Run.execute(Run.java:1894)
	at PluginClassLoader for jenkins-multijob-plugin//com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:76)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:446)
Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags --force --progress -- [email protected]:nodejs/node.git +refs/heads/*:refs/remotes/origin/* +refs/pull/54410/head:refs/remotes/origin/_jenkins_local_branch" returned status code 128:
stdout: 
stderr: kex_exchange_identification: Connection closed by remote host
Connection closed by 140.82.112.3 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2846)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2185)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:170)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:377)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:137)
	at java.base/java.lang.Thread.run(Thread.java:840)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 67.158.54.159/67.158.54.159:56529
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1826)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
		at hudson.remoting.Channel.call(Channel.java:1042)
		at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:153)
		at jdk.internal.reflect.GeneratedMethodAccessor514.invoke(Unknown Source)
		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.base/java.lang.reflect.Method.invoke(Method.java:569)
		at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:138)
		at PluginClassLoader for git-client/jdk.proxy102/jdk.proxy102.$Proxy196.execute(Unknown Source)
		at PluginClassLoader for git//hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:995)
		at PluginClassLoader for git//hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1239)
		at PluginClassLoader for git//hudson.plugins.git.GitSCM._checkout(GitSCM.java:1310)
		at PluginClassLoader for git//hudson.plugins.git.GitSCM.checkout(GitSCM.java:1277)
		at hudson.scm.SCM.checkout(SCM.java:540)
		at hudson.model.AbstractProject.checkout(AbstractProject.java:1247)
		at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:649)
		at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:521)
		at PluginClassLoader for jenkins-multijob-plugin//com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:148)
		at hudson.model.Run.execute(Run.java:1894)
		at PluginClassLoader for jenkins-multijob-plugin//com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:76)
		at hudson.model.ResourceController.execute(ResourceController.java:101)
		at hudson.model.Executor.run(Executor.java:446)
ERROR: Error fetching remote repo 'origin'
Collecting metadata...
Metadata collection done.
Notifying upstream projects of job completion
Finished: FAILURE

avivkeller avatar Sep 14 '24 17:09 avivkeller

CI: https://ci.nodejs.org/job/node-test-pull-request/62434/

nodejs-github-bot avatar Sep 14 '24 18:09 nodejs-github-bot

CI LGTM - The failure is related to an incident with github that has since been resolved.

avivkeller avatar Sep 18 '24 15:09 avivkeller

CI: https://ci.nodejs.org/job/node-test-pull-request/62532/

nodejs-github-bot avatar Sep 18 '24 16:09 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/62533/

nodejs-github-bot avatar Sep 18 '24 16:09 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/62541/

nodejs-github-bot avatar Sep 18 '24 23:09 nodejs-github-bot

CI LGTM

avivkeller avatar Sep 19 '24 20:09 avivkeller

CI: https://ci.nodejs.org/job/node-test-pull-request/62637/

nodejs-github-bot avatar Sep 21 '24 16:09 nodejs-github-bot

CI is passing, can this land?

avivkeller avatar Sep 21 '24 21:09 avivkeller

Ruff is currently at 0.6.7, however, this has a passing CI, and ruff get's updated all the time. For that reason, I'm not updating ruff again. IMO it can be done once v0.7 is released.

avivkeller avatar Sep 22 '24 21:09 avivkeller

@cclauss if you don't mind, could you commit-queue this?

avivkeller avatar Sep 23 '24 20:09 avivkeller

Commit Queue failed
- Loading data for nodejs/node/pull/54410
✔  Done loading data for nodejs/node/pull/54410
----------------------------------- PR info ------------------------------------
Title      build: update ruff and add `lint-py-fix` (#54410)
Author     Aviv Keller <[email protected]> (@RedYetiDev)
Branch     RedYetiDev:ruff-0.6.0 -> nodejs:main
Labels     build, python, author ready, needs-ci, commit-queue-squash
Commits    1
 - build: update ruff and add `lint-py-fix`
Committers 1
 - RedYetiDev <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/54410
Reviewed-By: Christian Clauss <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/54410
Reviewed-By: Christian Clauss <[email protected]>
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - build: update ruff and add `lint-py-fix`
   ℹ  This PR was created on Fri, 16 Aug 2024 16:57:16 GMT
   ✔  Approvals: 1
   ✔  - Christian Clauss (@cclauss): https://github.com/nodejs/node/pull/54410#pullrequestreview-2258871347
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-09-21T16:23:14Z: https://ci.nodejs.org/job/node-test-pull-request/62637/
- Querying data for job/node-test-pull-request/62637/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/11001786432

nodejs-github-bot avatar Sep 23 '24 20:09 nodejs-github-bot

(Sorry for the ping, rerequesting review so this can land)

avivkeller avatar Sep 24 '24 00:09 avivkeller

Landed in a1cd3c8777604fe3fc531186364ce9c2529f087b

nodejs-github-bot avatar Sep 24 '24 15:09 nodejs-github-bot