Closed Bug 2076535 Opened 1 month ago Closed 20 days ago

The glean-parser linter doesn't report metrics.yaml schema validation errors

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: jcristau, Assigned: jcristau)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

A metrics.yaml with, e.g., an unknown property in a metric passes mach lint -l glean-parser (and the source-test-mozlint-glean-parser job) with "0 problems", while the build fails to parse it.

glean_parser reports schema validation errors as blocks separated by lines of =, while the linter only turns lines starting with WARNING: or ERROR: (the glinter nits) into results, so validation errors are silently dropped.

Reporting those blocks as errors also uncovers that toolkit/crashreporter/crashping/static_metrics.yaml is linted together with generated_metrics.yaml, which contains the same metrics (glean_metrics.py merges them), so it needs to be excluded.

Blocks: 2076540

Per bug 2076540, schema validation is on the critical path in particular for artifact builds, so I'm looking at skipping it there, relying on the linter to catch issues instead.

glean_parser reports schema validation errors as blocks separated by
lines of "=", not as "WARNING:"/"ERROR:" lines like the glinter nits,
so the linter silently dropped them and passed files that fail
validation. Turn those blocks into lint errors too.

This uncovered that static_metrics.yaml is linted together with
generated_metrics.yaml, which contains the same metrics, so exclude it.

Pushed by jcristau@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/383d49004338 https://hg.mozilla.org/integration/autoland/rev/f38b03d1ea59 Report schema validation errors from the glean-parser linter r=linter-reviewers,janerik,sylvestre
Status: NEW → RESOLVED
Closed: 20 days ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: