Closed Bug 1651307 Opened 4 years ago Closed 4 years ago

debugger eslint and accessibility-lint node tests fail due to unrecognized property `ignorePatterns`

Categories

(DevTools :: Debugger, task, P3)

task

Tracking

(firefox80 fixed)

RESOLVED FIXED
Firefox 80
Tracking Status
firefox80 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(1 file, 2 obsolete files)

STRs:

If you run the debugger node tests (https://firefox-source-docs.mozilla.org/devtools/tests/node-tests.html#run-tests-locally), you will most likely see that two jobs: Eslint and Eslint (JSX Accessibility). They are reported as "passed" in the test summary, but it's just because we are not parsing the failure.

The stack traces are similar.

Eslint:

[task 2020-07-07T15:30:36.339Z] TEST START | Eslint
[task 2020-07-07T15:30:37.296Z] Error: ESLint configuration in /builds/worker/checkouts/gecko/.eslintrc.js is invalid:
[task 2020-07-07T15:30:37.296Z] 	- Unexpected top-level property "ignorePatterns".
[task 2020-07-07T15:30:37.296Z] 
[task 2020-07-07T15:30:37.296Z]     at validateConfigSchema (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-validator.js:235:15)
[task 2020-07-07T15:30:37.296Z]     at Object.validate (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-validator.js:261:5)
[task 2020-07-07T15:30:37.296Z]     at loadFromDisk (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-file.js:521:19)
[task 2020-07-07T15:30:37.296Z]     at Object.load (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-file.js:564:20)
[task 2020-07-07T15:30:37.296Z]     at Config.getLocalConfigHierarchy (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:227:44)
[task 2020-07-07T15:30:37.296Z]     at Config.getConfigHierarchy (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:179:43)
[task 2020-07-07T15:30:37.296Z]     at Config.getConfigVector (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:286:21)
[task 2020-07-07T15:30:37.296Z]     at Config.getConfig (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:329:29)
[task 2020-07-07T15:30:37.296Z]     at processText (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/cli-engine.js:180:33)
[task 2020-07-07T15:30:37.296Z]     at processFile (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/cli-engine.js:240:12)
[task 2020-07-07T15:30:37.296Z] error Command failed with exit code 2.
[task 2020-07-07T15:30:37.296Z] yarn run v1.9.4
[task 2020-07-07T15:30:37.296Z] $ eslint *.js "src/**/*.js" "packages/*/src/**/*.js" --fix
[task 2020-07-07T15:30:37.296Z] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Eslint (JSX Accessibility):

[task 2020-07-07T15:31:35.883Z] TEST START | Eslint (JSX Accessibility)
[task 2020-07-07T15:31:36.968Z] Error: ESLint configuration in /builds/worker/checkouts/gecko/.eslintrc.js is invalid:
[task 2020-07-07T15:31:36.968Z] 	- Unexpected top-level property "ignorePatterns".
[task 2020-07-07T15:31:36.968Z] 
[task 2020-07-07T15:31:36.968Z]     at validateConfigSchema (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-validator.js:235:15)
[task 2020-07-07T15:31:36.968Z]     at Object.validate (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-validator.js:261:5)
[task 2020-07-07T15:31:36.968Z]     at loadFromDisk (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-file.js:521:19)
[task 2020-07-07T15:31:36.968Z]     at Object.load (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config/config-file.js:564:20)
[task 2020-07-07T15:31:36.968Z]     at Config.getLocalConfigHierarchy (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:227:44)
[task 2020-07-07T15:31:36.968Z]     at Config.getConfigHierarchy (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:179:43)
[task 2020-07-07T15:31:36.968Z]     at Config.getConfigVector (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:286:21)
[task 2020-07-07T15:31:36.968Z]     at Config.getConfig (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/config.js:329:29)
[task 2020-07-07T15:31:36.968Z]     at processText (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/cli-engine.js:180:33)
[task 2020-07-07T15:31:36.969Z]     at processFile (/builds/worker/checkouts/gecko/devtools/client/debugger/node_modules/eslint/lib/cli-engine.js:240:12)
[task 2020-07-07T15:31:36.969Z] error Command failed with exit code 2.
[task 2020-07-07T15:31:36.969Z] yarn run v1.9.4
[task 2020-07-07T15:31:36.969Z] $ eslint *.js "src/**/*.js" "packages/*/src/**/*.js" --plugin=jsx-a11y --config=.eslintrc.jsx-a11y
[task 2020-07-07T15:31:36.969Z] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The issue seems to be that debugger relies on eslint ^5.0.0 (https://searchfox.org/mozilla-central/rev/7ec7ee4a9bde171ba195ab46ed6077e4baaef34d/devtools/client/debugger/package.json#124) but the ignorePatterns feature was only added in version 6.7.0 of eslint: https://eslint.org/blog/2019/11/eslint-v6.7.0-released

In mozilla-central, we started using this ignorePatterns pretty recently in Bug 1607172.

I think there are 2 actions here:

  • update the eslint version used by the debugger (how come we use a different one from the rest of m-c?)
  • detect such failures and fail the test if they occur

After changing the eslint version, we have yet another error:

TEST START | Eslint (JSX Accessibility)
Error: ../../../.eslintrc.js#overrides[3]:
	Environment key "mozilla/xpcshell" is unknown

    at /Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/shared/config-validator.js:169:19
    at Array.forEach (<anonymous>)
    at validateEnvironment (/Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/shared/config-validator.js:163:30)
    at validateConfigArray (/Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/shared/config-validator.js:334:9)
    at CascadingConfigArrayFactory._finalizeConfigArray (/Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:417:13)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:271:21)
    at FileEnumerator._iterateFilesWithFile (/Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/cli-engine/file-enumerator.js:320:43)
    at FileEnumerator._iterateFiles (/Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/cli-engine/file-enumerator.js:301:25)
    at FileEnumerator.iterateFiles (/Users/jdescottes/Development/hg/fx-team-artifact/devtools/client/debugger/node_modules/eslint/lib/cli-engine/file-enumerator.js:251:59)
    at iterateFiles.next (<anonymous>)

I am not sure what is the current state of linting in the debugger nowadays.

What is covered by the main mozilla-central linter?
What is supposed to be handled by the debugger node tests?

Should we just remove the debugger linting tests in https://searchfox.org/mozilla-central/rev/7ec7ee4a9bde171ba195ab46ed6077e4baaef34d/devtools/client/debugger/bin/try-runner.js#120,123 ?

I'd be fine removing the debugger linting. this predates the mc work, which is in good shape.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Attached file Bug 1651307 - Fix eslint and jsx-a11y debugger jobs (obsolete) (deleted) —
Attachment #9163482 - Attachment description: Bug 1651307 - Fix debugger node jobs: eslint & jsx-a11y → Bug 1651307 - Fix eslint and jsx-a11y debugger jobs

Depends on D83500

Spent some time on this. It seems the debugger eslint job actually catches a few things which are not detected by mozilla-central's eslint job.
So I'll leave the decision up to debugger peers. I uploaded patches to either remove or fix the jobs.

Attachment #9163487 - Attachment is obsolete: true
Attachment #9163482 - Attachment is obsolete: true

Hi David!

We have 2 broken jobs in the debugger node suite: eslint and jsx-a11y. They have been broken for 6 months now.
The current eslint running on mozilla-central seems incompatible with the debugger's eslint.
We should be able to rely only mozilla central's eslint, so the plan is to drop the eslint job in the debugger.

However for jsx-a11y, there is currently no equivalent in mozilla-central.
Do you think this job brings some added value? Should we re-enable it or drop it?

Thanks

Flags: needinfo?(dwalsh)

Well, I just tried enabling jsx-a11y only, and it triggers violations in prettier. If fixed they will fail mozilla central's linter. So I think we should forget about this jsx job for now.

Flags: needinfo?(dwalsh)
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9798ec66761d Remove broken debugger node jobs: eslint & jsx-a11y r=loganfsmyth
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: