KRPC-580: Make GenerateBufYaml cacheable#700
Merged
Merged
Conversation
🔒 AI PR Safety: SAFEAll comments on this bot-authored PR are from authorized repository collaborators. |
Contributor
Author
Internal code reviewAll items addressed. Fixed
Deferred to follow-up
|
Contributor
Author
CI ReportPassed
FailedNone
|
Mr3zee
requested changes
Apr 23, 2026
Mr3zee
reviewed
Apr 23, 2026
…ic KDoc, import annotation
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.
Subsystem
gradle-plugin(proto/buf tasks)Problem
YouTrack: KRPC-580
Solution
Make
GenerateBufYamlandGenerateBufGenYamlcacheable; annotate the remaining proto/buf task classes so:gradle-plugin:validatePluginsno longer fails on unannotated task types.Cacheable tasks (
@CacheableTask):GenerateBufYaml— previously read filesystem state viaFile.exists()inside the@TaskAction. Those reads are now captured as@Input Booleanproperties (protoSourceDirExists,importSourceDirExists), wired from the caller viaprovider { ... }so existence is evaluated at task-fingerprinting time.GenerateBufGenYaml— inputs were already fully declared; only the annotation was missing.sourceSetName: Property<String>as an@Inputso cache keys are unique per source set. Without this, source sets with coincidentally-matching inputs would share a cache entry and produce cross-source-setFROM_CACHEhits. With it, the existing test assertions (strictSUCCESS/UP_TO_DATE/FROM_CACHE) remain correct with no test-side changes — the test file is byte-identical to main.Explicitly non-cacheable tasks (
@DisableCachingByDefault(because = ...)) — these previously produced validation errors because Gradle 9.x requires abstract and concrete task classes to declare caching intent:BufExecTask(abstract base) — custom user subclasses must opt in via@CacheableTask.DefaultProtoTask(abstract base) — carries no inputs/outputs; subclasses declare their own.ProcessProtoFiles(concrete Sync subclass) — file-copy task; caching overhead outweighs benefit per Gradle's default heuristic.Local verification:
:gradle-plugin:buildpasses end-to-end includingvalidatePlugins(which was failing on main with 5 errors), 205/205 tests pass with strict assertions, ABI + detekt clean.Follow-ups filed during the audit: KRPC-594 (BufGenerateTask
overlapping_outputsarchitectural fix), KRPC-595 (bisect +126 non-cacheable task regression at CI#463), KRPC-596 (make conformance test generator tasks cacheable).Note
Fully autonomous AI-generated PR — no human reviewed the code before submission.
Problem analysis and root cause details: KRPC-580