Closed Bug 1839843 Opened 3 years ago Closed 3 years ago

Exceptions in Prettier are not correctly shown on treeherder

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox116 fixed)

RESOLVED FIXED
Tracking Status
firefox116 --- fixed

People

(Reporter: standard8, Assigned: standard8)

Details

Attachments

(1 file)

I noticed that a missing comma caused a syntax error that failed to be reported properly on treeherder, and additionally caused it not to be picked up by the review bot.

https://treeherder.mozilla.org/logviewer?job_id=420254734&repo=try

The output was:

[task 2023-06-22T09:38:38.156Z] An error occurred running prettier. Please check the following error messages:
[task 2023-06-22T09:38:38.156Z] 
[task 2023-06-22T09:38:38.157Z] [error] remote/cdp/JSONHandler.sys.mjs: SyntaxError: Unexpected token, expected "," (10:3)
[task 2023-06-22T09:38:38.157Z] [error]    8 |   Log: "chrome://remote/content/shared/Log.sys.mjs",
[task 2023-06-22T09:38:38.157Z] [error]    9 |   HTTP_404: "chrome://remote/content/server/httpd.sys.mjs"
[task 2023-06-22T09:38:38.157Z] [error] > 10 |   HTTP_405: "chrome://remote/content/server/httpd.sys.mjs",
[task 2023-06-22T09:38:38.157Z] [error]      |   ^
[task 2023-06-22T09:38:38.157Z] [error]   11 |   HTTP_505: "chrome://remote/content/server/httpd.sys.mjs",
[task 2023-06-22T09:38:38.157Z] [error]   12 |   Protocol: "chrome://remote/content/cdp/Protocol.sys.mjs",
[task 2023-06-22T09:38:38.157Z] [error]   13 |   RemoteAgentError: "chrome://remote/content/cdp/Error.sys.mjs",

The problem is that we're not returning this sort of error as an error to the lint harness. Therefore we print out the custom error and report failure, but it doesn't get parsed correctly.

I have a patch to try and fix this. We won't be able to mark it as a specific file, but we should at least be able to get the error reported.

Attachment #9340477 - Attachment description: Bug 1839843 - Ensure exceptions from Prettier are correctly shown on treeherder and reviewbot. → Bug 1839843 - Ensure exceptions from Prettier are correctly shown on treeherder and reviewbot. r?#linter-reviewers!
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/451f8e9bcede Ensure exceptions from Prettier are correctly shown on treeherder and reviewbot. r=linter-reviewers,andi
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: