-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add android and compose lint [WPB-9287] #3021
Conversation
Ups 🫰🟨This PR is too big. Please try to break it up into smaller PRs. |
d9d8c45
to
651f981
Compare
Test Results927 tests 927 ✅ 14m 52s ⏱️ Results for commit 1454e46. ♻️ This comment has been updated with latest results. |
Build 4860 succeeded. The build produced the following APK's: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good but now build will take longer and I'm thinking how to solve that 🤔
(Lint file has 30MB of logs)
Build 4864 succeeded. The build produced the following APK's: |
The logs seem triggered by AboutLibraries. Maybe we can go around it someway. The main issue seems unrelated to that, as more people seem to face issues with GH Actions + Lint: https://stackoverflow.com/a/70010526 |
APKs built during tests are available here. Scroll down to Artifacts! |
Build 4868 succeeded. The build produced the following APK's: |
app/lint-baseline.xml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand those baseline's were added to in future remove those ignores and for future releases already check new places where we may have those issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Using lintDebug
was skipping :app
's lint. Now it's fixed.
Build 4879 succeeded. The build produced the following APK's: |
ecbfc45
to
7b9d2be
Compare
APKs built during tests are available here. Scroll down to Artifacts! |
Build 4893 succeeded. The build produced the following APK's: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fantastic, thanks for picking up an old collective topic 🥇
One question, how this lint vs. a detekt plugin for compose for example differs performance wise or in terms of maintainability ?
Maybe we could be better off reusing the same tool, in this case detekt
, than introducing a new one 🤔
Maybe we can split by parts. This PR adds two things: Android Lint, and Compose checks for Android Lint. Android LintIs the heavier guy here in terms of performance. Unlike Detekt, it will compile the code and check the compiler output for weird things. Because of that, it can analyse more stuff (like class structures) and even analyse resource files and catch localisation issues. I believe adding Android Lint in general is beneficial. It just noticed we have 200+ localisation issues, for example. Compose Checks for Android LintIt's an extra check. By itself doesn't add much to verification time. But continuing on your question: should it be on top of Detekt, or on top of Android Lint? It seems some of these Detekt plugins rely on Detekt's Type Resolution, which we don't have set-up at the moment. And this would mean spinning up the Kotlin Compiler as well for Detekt, which we don't at the moment. The Detekt rulesets for Compose I found were not as popular and actively maintained as this Android Lint alternative by Slack. These aren't the only things to consider, but when selecting such a delicate topic, I'd go with the more commonly used tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the replies, it makes sense, just added another suggestion we might explore before merging, to see how much (if any) time could gain of execution
The Metaspace size parameter has been increased in the codestyle.yml GitHub Actions workflow file. This was just to prevent the linter runs from failing on the GH runner due to limited Metaspace size. The value of the MaxMetaspaceSize option is set to 1g.
c6af054
to
4e2feee
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coool 🚀
APKs built during tests are available here. Scroll down to Artifacts! |
Build 4911 succeeded. The build produced the following APK's: |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
There are many localisation, performance and other hidden bugs in our app that we aren't aware of.
Solutions
We could start by adding Lint checks. Extra: adding compose lint checks.
Add these check to the codestyle workflow to catch new smelly stuff as PRs are raised.
For now, I've added all the current bugs to the baseline files, generated with run
./gradlew updateLintBaseline
.The lint configuration is done in
configureKotlinAndroid
function, shared by all of our Android gradle modules.Testing
Just run
./gradlew lint
on the root of the project.Attachments
When running locally, we can also open the HTML file for easier reading. This is what is currently seen if we take out the baseline file:
Biggest offender is the
ImpliedQuantity
check for localisation:PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.