Skip to content
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

test(android, lint): enable java lint check in CI #5208

Merged
merged 1 commit into from
Apr 24, 2021

Conversation

mikehardy
Copy link
Collaborator

@mikehardy mikehardy commented Apr 23, 2021

Description

If we say we support minSdkVersion 16 we should check it somehow

It turns out that getting a non-API30 emulator is somewhat difficult in CI, but...

Java lint was not being checked anywhere, and the NewApi check in particular
would have stopped a crash. So add full lint configuration tuned for current status

Cannot enable it on the modules or our modules may fail library-consumer's builds,
but we may configure it on the sub-modules from our test app then check that

Tested and working and would have correctly failed the NewApi violation shown in #5206

Related issues

Related #5206 - Android 7 crash from use of Java8 features in #4981

Release Summary

Conventional commit message

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

The change is literally a test :-)


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link

vercel bot commented Apr 23, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/48MPQYVqTfDPrhdnHcNUvAPjaiNe
✅ Preview: https://react-native-f-git-mikehardy-e2e-android-api21-emulator-dbbd0d.vercel.app

@mikehardy mikehardy added Workflow: Needs Review Pending feedback or review from a maintainer. Workflow: Pending Merge Waiting on CI or similar labels Apr 23, 2021
@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #5208 (1b6509d) into master (49c15f8) will decrease coverage by 52.28%.
The diff coverage is n/a.

❗ Current head 1b6509d differs from pull request most recent head 870705b. Consider uploading reports for the commit 870705b to get more accurate results

@@             Coverage Diff             @@
##           master    #5208       +/-   ##
===========================================
- Coverage   88.87%   36.59%   -52.27%     
===========================================
  Files         109       51       -58     
  Lines        3744     1517     -2227     
  Branches      360      360               
===========================================
- Hits         3327      555     -2772     
- Misses        370      732      +362     
- Partials       47      230      +183     

@mikehardy
Copy link
Collaborator Author

API21 emulator is not easily attainable on github CI runners, probably have to do a local update of SDK tools to get it's definition, and may need to install API21 API as well (unsure) but I did not have success with Detox getting it to run unfortunately, so this needs a lot more investigation

Alternative (or additive) solution for this is to enable a lintRelease check in CI that checks for NewApi (if I recall correctly). This one should be done no matter what but it turns out we are specifically configured the opposite to what I would expect right now, e.g. in the app module:

lintOptions {
disable 'GradleCompatible'
abortOnError false
}

Instead I think we should have a common lint.gradle and all the modules should refer to it, with settings for NewApi to fail - when I toggle abortOnError to true in the file referenced above, this is correctly flagged as a build failure.

Java lint was not being checked anywhere, and the NewApi check in particular
would have stopped a crash. Add full lint configuration tuned for current status

Cannot enable it on the modules or our modules may fail library-consumer's builds,
but we may configure it on the sub-modules from our test app then check that

Tested and working and would have correctly failed the NewApi violation shown in #5206
@mikehardy mikehardy force-pushed the @mikehardy/e2e-android-api21-emulator branch from d68b9d4 to 870705b Compare April 24, 2021 01:30
@mikehardy mikehardy changed the title test(e2e, android): use api21 emulator test(android, lint): enable java lint check in CI Apr 24, 2021
@mikehardy mikehardy removed Workflow: Needs Review Pending feedback or review from a maintainer. Workflow: Pending Merge Waiting on CI or similar labels Apr 24, 2021
@mikehardy
Copy link
Collaborator Author

The most important part - and the only part I changed - was to add lintDebug to the android e2e run, and I verified the log it was perfect. Merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant