Closed Bug 1793625 Opened 2 years ago Closed 2 years ago

Mozlint based jobs should optimized based on mozlint config files

Categories

(Thunderbird :: Build Config, task)

Tracking

(thunderbird_esr102 unaffected)

RESOLVED FIXED
107 Branch
Tracking Status
thunderbird_esr102 --- unaffected

People

(Reporter: rjl, Assigned: rjl)

References

(Regression)

Details

Attachments

(4 files)

Taskgraph optimization for mozlint jobs duplicates the when-to-run configuration based on affected files with the mozlint yaml files. This leads to cases where CI does not check files that should be checked because the configs are out of sync.

https://phabricator.services.mozilla.com/D158564#5203901

Let's read the mozlint yaml in an optimization strategy and use it to decide when to run.

To avoid duplication of file lists between mozlint configs and taskgraph job
configs, for mozlint jobs use the include, exclude, extensions, and support-files
from the mozlint config to determine when to run.

Most of the work is handled by mozlint.pathutils.filterpaths.

"extensions" cannot include a leading "."

Thunderbird jobs usually do not want to run on upstream code, so set "include" to
"comm/" when a more specific list of includes is not provided.

Depends on D158590

The optimization only works for Thunderbird when a mozlint file included in
comm/tools/lint. There's a couple of linters that run that use the upstream
configs.

Depends on D158591

Depends on: 1793859, 1793860

I think the OptimizationStrategy is generic enough now that gecko_taskgraph could use it without having to make changes.

Instead of using "when -> files-changed" in source-test/mozlint.yml, use something like:

optimization:
    skip-unless-mozlint:
        root-path: comm
        mozlint-config: codespell.yml

"root-path" is optional, and would not need to be set for Firefox. It's used to find the YAML files in tools/lint/.
"mozlint-config" is the YAML file to use. Most of these line up with a job name, but I think one or two did not, so this is needed.

The strategy uses mozlint.pathutils.filterpaths and the list of changed files from hg.m.o to decide if a particular job needs to run. I've noticed a couple of instances when it runs different jobs than the current optimizations, but when I looked closer, they were different because the changed files lists were more inclusive than mozlint.

jcristau -- Is this useful for gecko_taskgraph? I can put it there and still use for Thunderbird. (Have not tested on Firefox taskgraphs yet.) D158590 and D158592 are most relevant.

Flags: needinfo?(jcristau)
Assignee: nobody → rob
Attachment #9297142 - Attachment description: WIP: Bug 1793625 - Taskgraph optimization strategy for mozlint jobs. → Bug 1793625 - Taskgraph optimization strategy for mozlint jobs. r=dandarnell
Status: NEW → ASSIGNED
Attachment #9297143 - Attachment description: WIP: Bug 1793625 - Adjust mozlint configs to work with taskgraph skip-unless-mozlint optimization. → Bug 1793625 - Adjust mozlint configs to work with taskgraph skip-unless-mozlint optimization. r=#thunderbird-reviewers
Attachment #9297375 - Attachment description: WIP: Bug 1793625 - Fix tbxchannel to work with commlint flake8 config. → Bug 1793625 - Misc mozlint related fixes: codespell and flake8. r=#thunderbird-reviewers
Attachment #9297144 - Attachment description: WIP: Bug 1793625 - Use "skip-unless-mozlint" optimization for mozlint jobs. → Bug 1793625 - Use "skip-unless-mozlint" optimization for mozlint jobs. r=dandarnell

(In reply to Rob Lemley [:rjl] from comment #5)

jcristau -- Is this useful for gecko_taskgraph? I can put it there and still use for Thunderbird. (Have not tested on Firefox taskgraphs yet.) D158590 and D158592 are most relevant.

That looks very nice, yes, thanks!

Flags: needinfo?(jcristau)
Target Milestone: --- → 107 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/00b2693c8fb5
Taskgraph optimization strategy for mozlint jobs. r=dandarnell
https://hg.mozilla.org/comm-central/rev/fe247a4f1566
Adjust mozlint configs to work with taskgraph skip-unless-mozlint optimization. r=mkmelin
https://hg.mozilla.org/comm-central/rev/c53eff8dd08d
Misc mozlint related fixes: codespell and flake8. r=mkmelin
https://hg.mozilla.org/comm-central/rev/3d27c0cc1990
Use "skip-unless-mozlint" optimization for mozlint jobs. r=dandarnell

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Regressed by: 1797759
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: