Repository navigation
feat(ci): add handwritten static analysis - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This repo had no handwritten static analysis gate. PHP SDKs fail CI on
composer analyse. Maintainers and GitHub Actions now share one command,./gradlew lint --no-daemon, which runs Error Prone 2.42.0 and NullAway on Java compilation only when the Gradlelinttask is requested../gradlew buildstays the compile-and-package path it is today.yarn distributestill patches onlyversioninbuild.gradle.kts. Tool pins live inplugins { id("…") version "…" }anddependencies {}, so they are not a second project-levelversion =.Scope
build.gradle.ktsregisterslint, depends onclasses, and enables Error Prone plus NullAway whenlintis ingradle.startParameter.taskNames. Kiota paths matching.*/generated/.*are excluded. Kotlin, if present, is covered by compile only. Detekt is not added.gradle.lockfileincludes the newerrorproneartifacts..github/workflows/validate.ymladds a Static analysis step after Build. The step runs./gradlew lint --no-daemon. Build is unchanged.accessTokenfield and its accessors on the handwritten configuration class are marked@Nullableso NullAway accepts them.generate.shis not touched. There is noscripts/analyzewrapper.Tradeoffs
Error Prone 2.42.0 is the last line that runs on the JDK 17 toolchain. 2.43+ would need JDK 21. Analysis stays off
buildso the existing CI Build step still means compile, not lint.Blast Radius
SDK maintainers and the validate workflow gain a new failing step if handwritten Java regresses. Downstream consumers of the published jar see no API change beyond
@NullableongetAccessToken(). Generated Kiota sources still compile and are not judged. A later distribute run can still rewritegenerate.shand the Gradleversionstrings without removing this gate.Verification
./gradlew lint --no-daemonfailed with NullAway errors on uninitialized optionalaccessToken. After@Nullableon that field and its accessors,./gradlew lint --no-daemonexited 0 with 0 findings../gradlew build --no-daemonexited 0.Made with Cursor