Closed Bug 2086579 Opened 22 days ago Closed 16 days ago

./mach lint --fix runs too much on simple android frontend changes

Categories

(Firefox for Android :: Tooling, enhancement)

All
Android
enhancement

Tracking

()

RESOLVED FIXED
161 Branch
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.

See Also: → 2052251

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.

Assignee: nobody → ahochheiden
Status: NEW → ASSIGNED

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.

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.

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.

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.

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.

Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f0cbed472244 https://hg.mozilla.org/integration/autoland/rev/85d31ce680c8 Part 1 - Limit the GeckoView linters to the directories their Gradle tasks check r=adhingra https://github.com/mozilla-firefox/firefox/commit/c8db3e7d2758 https://hg.mozilla.org/integration/autoland/rev/1067e1a58803 Part 2 - List the inputs of the GeckoView linters in their `support-files` r=linter-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/26db924dc575 https://hg.mozilla.org/integration/autoland/rev/b8d005d4c40d Part 3 - Schedule the android-lints task on the inputs of its linters r=linter-reviewers,sergesanspaille https://github.com/mozilla-firefox/firefox/commit/ceea4077dd25 https://hg.mozilla.org/integration/autoland/rev/31813abcd82d Part 4 - List the inputs of the fenix, focus and android-components linters in their `support-files` r=adhingra https://github.com/mozilla-firefox/firefox/commit/aee57d96c6f4 https://hg.mozilla.org/integration/autoland/rev/fca1d66fdbad Part 5 - Schedule the GeckoView docs task on the inputs of its Gradle build r=adhingra
Pushed by ahochheiden@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cecd0f3a1ef0 https://hg.mozilla.org/integration/autoland/rev/5b5f040688c6 Part 6 - Run the Android lint tasks only when the Android linters change r=adhingra
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: