./mach lint --fix runs too much on simple android frontend changes
Categories
(Firefox for Android :: Tooling, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox161 | --- | fixed |
People
(Reporter: marcin, Assigned: ahochheiden)
References
(Blocks 1 open bug)
Details
Attachments
(6 external files)
On a simple android frontend change (a single Kotlin file under mobile/android/fenix edited) with artifact builds enabled running ./mach lint --fix (note that it uses --outgoing and --workdir by default) runs the following:
gradlew -Pandroid-lint :fenix:ktfmtFormat :fenix:detekt :fenix:lintDebug -PdisableAndroidComponentsTasks=true --continue
gradlew -Pandroid-lint geckoview:apiLintDebug
gradlew -Pandroid-lint geckoview:testDebugUnitTest
gradlew -Pandroid-lint geckoview:checkstyleDebug
gradlew -Pandroid-lint geckoview:spotlessJavaApply geckoview:spotlessKotlinApply geckoview_example:spotlessJavaApply geckoview_example:spotlessKotlinApply annotations:spotlessJavaApply annotations:spotlessKotlinApply messaging_example:spotlessJavaApply messaging_example:spotlessKotlinApply port_messaging_example:spotlessJavaApply port_messaging_example:spotlessKotlinApply test_runner:spotlessJavaApply test_runner:spotlessKotlinApply
gradlew -Pandroid-lint geckoview:lintDebug :conventions:lint :dependencies:lint :publicsuffixlist:lint :apksize:lint --continue
I would expect just the first line to run based on what's changed. It would match our current recommendation of manually specifying -l android-fenix. I think all the other calls/checks are not relevant and should be dropped to speed up ./mach lint --fix without a specified -l. This would let us align our recommendation with how ./mach lint is expected to be used by engineers on other teams.
| Assignee | ||
Comment 1•20 days ago
|
||
android-api-lint, android-checkstyle, android-format, android-lint and
android-test included all of mobile/android, so a change only to
fenix, focus or android-components also ran their Gradle tasks.
android-javadoc included the GeckoView test sources, which its task
does not read. android-api-lint, android-lint and android-test now also
run for dom/media/systemservices/android_video_capture, whose Java
GeckoView compiles.
Updated•20 days ago
|
| Assignee | ||
Comment 2•20 days ago
|
||
The GeckoView linters treated every *.gradle file as a support file,
so a change to a fenix, focus or android-components build script linted
the whole tree with all of them. They also missed files Gradle reads
while configuring them, such as gradle.properties, the version
catalog, the wrapper and .config.yml. They missed lints.py and the
./mach gradle code it runs, and inputs their java and kt
extensions filter out, such as api.txt, lint.xml and the GeckoView
manifest, resources and AIDL files. android-api-lint also missed
config/milestone.txt, which sets the version it checks deprecations
against. They now list the shared build setup, the plugin builds that
root settings.gradle includes, and the build scripts and other inputs
of the projects each linter checks.
| Assignee | ||
Comment 3•20 days ago
|
||
The task ran on any Java, Kotlin or resource change under
mobile/android and on any Gradle script in the tree, including
changes only to fenix, focus or android-components. It now runs on the
directories and build files the GeckoView linters check.
| Assignee | ||
Comment 4•17 days ago
|
||
android-fenix, android-focus and android-ac treated every *.gradle file in
the tree as a support file, and their tasks ran on any Gradle script change.
They now list the shared build setup, the project each one checks, and the
build scripts of the android-components and GeckoView projects it depends on.
Their tasks run on the same files.
| Assignee | ||
Comment 5•17 days ago
|
||
The task ran on any Gradle script in the tree, including changes only to
fenix, focus or android-components. It now runs on the build files
android-javadoc lists.
| Assignee | ||
Comment 6•17 days ago
|
||
Any change under tools/lint started fenix-lints, focus-lints,
ac-lints and android-lints, though only tools/lint/android and the
android-*.yml definitions affect them. Over two days, 72 of 147
review bot fenix-lints runs came only from other linters' files.
Comment 8•16 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/85d31ce680c8
https://hg.mozilla.org/mozilla-central/rev/1067e1a58803
https://hg.mozilla.org/mozilla-central/rev/b8d005d4c40d
https://hg.mozilla.org/mozilla-central/rev/31813abcd82d
https://hg.mozilla.org/mozilla-central/rev/fca1d66fdbad
Comment 10•15 days ago
|
||
| bugherder | ||
Description
•