Skip to content

tools: remove lint-js.js - #30955

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:simplify-lint
Closed

tools: remove lint-js.js#30955
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:simplify-lint

Conversation

@Trott

Copy link
Copy Markdown
Member

lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:

  • It results in occasional (and puzzling) yellow CI runs for
    node-test-linter because the tap file is corrupted somehow.
    Interleaved maybe? I don't know, but a simple solution is removing it
    and running ESLint directly.

  • On my local laptop, it reduces the linting from about 75 seconds to
    about 55 seconds. This kind of savings is not worth the added
    complexity and the instability noted above.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Dec 13, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

We will need to check the removed lines from vcbuild.bat are not used anywhere in the CI.

Comment threadvcbuild.bat Outdated
@Trott

Copy link
Copy Markdown
MemberAuthor

We will need to check the removed lines from vcbuild.bat are not used anywhere in the CI.

Yeah, running full CI to check, although obviously that won't necessarily catch things in other jobs. Kinda doubt it would be in other jobs and not in the main one, though.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mscdex

mscdex commented Dec 14, 2019

Copy link
Copy Markdown
Contributor

Before removing, it would be a good idea to see the performance impact on all of the CI machines (especially the ARM-based ones).

@Trott

Copy link
Copy Markdown
MemberAuthor

Before removing, it would be a good idea to see the performance impact on all of the CI machines (especially the ARM-based ones).

We only run lint on one machine these days.

@TrottTrott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 14, 2019
@richardlau

Copy link
Copy Markdown
Member

Looks like the linter job failed to parse the tap file with tap2junit:
https://ci.nodejs.org/job/node-test-linter/31548/console

02:42:08 + tap2junit -i test-eslint.tap -o out/test.xml02:42:09 Traceback (most recent call last):02:42:09 File "/usr/local/bin/tap2junit", line 11, in <module>02:42:09 sys.exit(main())02:42:09 File "/usr/local/lib/python2.7/dist-packages/tap2junit/__main__.py", line 44, in main02:42:09 result = parse(os.path.splitext(args.input.name)[0], data)02:42:09 File "/usr/local/lib/python2.7/dist-packages/tap2junit/__main__.py", line 15, in parse02:42:09 t = TestCase(test.description, None, test.yaml['duration_ms'])02:42:09 TypeError: 'NoneType' object has no attribute '__getitem__'02:42:09 POST BUILD TASK : FAILURE

@Trott

Copy link
Copy Markdown
MemberAuthor

Looks like the linter job failed to parse the tap file with tap2junit:

That's alarming. It parses just fine when I do it locally....

@TrottTrott removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 14, 2019
@Trott

Copy link
Copy Markdown
MemberAuthor

Looks like the linter job failed to parse the tap file with tap2junit:

That's alarming. It parses just fine when I do it locally....

Argh, the version of tap2junit on the linter machine is different than what I get with pip install tap2junit....

@Trott

Trott commented Dec 14, 2019

Copy link
Copy Markdown
MemberAuthor

tap2junit on the linter box is 0.1.4 but the current release is 0.1.5.

@Trott

Trott commented Dec 14, 2019

Copy link
Copy Markdown
MemberAuthor

Oh, interesting. So I managed to replicate the bug that I mention above where I surmise that its interleaved output or something, but actually it's a bug in tap2junit 0.1.4.

Input file:

TAP version 131..1ok 1 - /Users/trott/io.js/.eslintrc.jsTAP version 131..2ok 1 - /Users/trott/io.js/benchmark/net/tcp-raw-pipe.jsok 2 - /Users/trott/io.js/benchmark/net/tcp-raw-s2c.js

With tap2junit 0.1.4:

$ tap2junit -i test.tap -o fooTraceback (most recent call last): File "/usr/local/bin/tap2junit", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/site-packages/tap2junit/__main__.py", line 44, in main result = parse(os.path.splitext(args.input.name)[0], data) File "/usr/local/lib/python2.7/site-packages/tap2junit/__main__.py", line 11, in parse tap_parser.parse(data) File "/usr/local/lib/python2.7/site-packages/tap2junit/tap13.py", line 124, in parse self._parse(StringIO.StringIO(source)) File "/usr/local/lib/python2.7/site-packages/tap2junit/tap13.py", line 102, in _parse raise ValueError("Descending test id on line: %r" % line)ValueError: Descending test id on line: 'ok 1 - /Users/trott/io.js/benchmark/net/tcp-raw-pipe.js'
$

0.1.5 processes it normally.

Any chance we want to update to 0.1.5, at least on the linter boxes? It contains the changes for Python 3 compatibility, if that's any encouragement.

/ping @nodejs/python

@Trott

Copy link
Copy Markdown
MemberAuthor

(And, naturally, it seems exceedingly likely that the other problem we're seeing now with the tap file from this PR is also a bug in tap2junit 0.1.4. The file is processed without a problem by tap2junit 0.1.5.)

@Trott

Copy link
Copy Markdown
MemberAuthor

Any chance we want to update to 0.1.5, at least on the linter boxes? It contains the changes for Python 3 compatibility, if that's any encouragement.

@nodejs/build ^^^^^^

@cclauss

cclauss commented Dec 14, 2019

Copy link
Copy Markdown
Contributor

StringIO.StringIO(source) in Python2 would be io.StringIO(source) in Python 3 so I would strongly encourage the use of the latest version of tap2junit.

https://github.com/nodejs/tap2junit/search?q=stringio&unscoped_q=stringio

@mscdex

Copy link
Copy Markdown
Contributor

So we should just upgrade tap2junit instead of making the changes in this PR?

@Trott

Copy link
Copy Markdown
MemberAuthor

So we should just upgrade tap2junit instead of making the changes in this PR?

Perhaps. There's still the issue of cost/benefit ratio where cost is code complexity and extra time spent troubleshooting issues like this. But yeah, this PR suddenly becomes less compelling for sure.

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

Whether or not this fixes the issue, given the minimal improvements in run time and extra incurred complexity, I think removing this is actually still a good thing.

@richardlau

Copy link
Copy Markdown
Member

The machines in question are test-packetnet-ubuntu1604-x64-1 and test-packetnet-ubuntu1604-x64-2. I think that's it, but if you know how to check https://ci.nodejs.org/job/node-test-linter/ to see what other machines it might use, then those machines too.

Based on https://ci.nodejs.org/job/node-test-linter/buildTimeTrend it looks like only the jobs that ran on test-packetnet-ubuntu1604-x64-2 are yellow:
image

@rvagg

Copy link
Copy Markdown
Member

test-softlayer-ubuntu1604-x64-1 too, it's just offline for now cause it's wonky and needs some of my time

https://ci.nodejs.org/label/jenkins-workspace/ are the machines.

@BridgeAR

Copy link
Copy Markdown
Member

Ref: eslint/eslint#3565
Ref: eslint/eslint#12191

I suggest to remove this as soon as the feature landed in eslint itself but not before? It should hopefully not take much more time to be implemented.

@Trott

Copy link
Copy Markdown
MemberAuthor

Ref: eslint/eslint#3565
Ref: eslint/eslint#12191

I suggest to remove this as soon as the feature landed in eslint itself but not before? It should hopefully not take much more time to be implemented.

Going the other way, the CLIEngine class used by lint-js.js will be deprecated in ESLint 7.0.0 (in alpha right now). So that's an argument for doing it sooner. We can always enable the parallel linting when it becomes available in ESLint.

@Trott

Copy link
Copy Markdown
MemberAuthor

tap2junit updated for Python 2 on test-packetnet-ubuntu1604-x64-2. It was already on the correct version on test-packetnet-ubuntu1604-x64-1. Removing blocked label.

@TrottTrott removed the blocked PRs that are blocked by other issues or PRs. label Jan 27, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Copy link
Copy Markdown
MemberAuthor

tap2junit updated for Python 2 on test-packetnet-ubuntu1604-x64-2.

test-softlayer-ubuntu1604-x64-1 too.

@nodejs-github-bot

nodejs-github-bot commented Feb 1, 2020

Copy link
Copy Markdown
Collaborator

@BridgeAR
BridgeARforce-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72CompareMay 31, 2020 12:19
@jasnelljasnell added the stalled Issues and PRs that are stalled. label Jun 25, 2020
@jasnell

Copy link
Copy Markdown
Member

Ping @Trott

lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:
* It results in occasional (and puzzling) yellow CI runs for
node-test-linter because the tap file is corrupted somehow.
Interleaved maybe? I don't know, but a simple solution is removing it
and running ESLint directly.
* On my local laptop, it reduces the linting from about 75 seconds to
about 55 seconds. This kind of savings is not worth the added
complexity and the instability noted above.
@nodejs-github-bot

nodejs-github-bot commented Jun 26, 2020

Copy link
Copy Markdown
Collaborator

@TrottTrott removed the stalled Issues and PRs that are stalled. label Jun 26, 2020

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

LGTM

jasnell pushed a commit that referenced this pull request Jul 3, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:
* It results in occasional (and puzzling) yellow CI runs for
node-test-linter because the tap file is corrupted somehow.
Interleaved maybe? I don't know, but a simple solution is removing it
and running ESLint directly.
* On my local laptop, it reduces the linting from about 75 seconds to
about 55 seconds. This kind of savings is not worth the added
complexity and the instability noted above.
PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in 92f8781

@jasnelljasnell closed this Jul 3, 2020
MylesBorins pushed a commit that referenced this pull request Jul 14, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:
* It results in occasional (and puzzling) yellow CI runs for
node-test-linter because the tap file is corrupted somehow.
Interleaved maybe? I don't know, but a simple solution is removing it
and running ESLint directly.
* On my local laptop, it reduces the linting from about 75 seconds to
about 55 seconds. This kind of savings is not worth the added
complexity and the instability noted above.
PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Jul 14, 2020
MylesBorins pushed a commit that referenced this pull request Jul 16, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:
* It results in occasional (and puzzling) yellow CI runs for
node-test-linter because the tap file is corrupted somehow.
Interleaved maybe? I don't know, but a simple solution is removing it
and running ESLint directly.
* On my local laptop, it reduces the linting from about 75 seconds to
about 55 seconds. This kind of savings is not worth the added
complexity and the instability noted above.
PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
lint-js.js was implemented before ESLint had a caching feature. It is
now only used in CI. Let's remove it on the following grounds:
* It results in occasional (and puzzling) yellow CI runs for
node-test-linter because the tap file is corrupted somehow.
Interleaved maybe? I don't know, but a simple solution is removing it
and running ESLint directly.
* On my local laptop, it reduces the linting from about 75 seconds to
about 55 seconds. This kind of savings is not worth the added
complexity and the instability noted above.
PR-URL: #30955
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@codebyterecodebytere mentioned this pull request Sep 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.toolsIssues and PRs related to the tools directory.windowsIssues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

13 participants

@Trott@nodejs-github-bot@mscdex@richardlau@cclauss@sam-github@rvagg@BridgeAR@jasnell@apapirovski@watilde@gengjiawen@mhdawson