-
Notifications
You must be signed in to change notification settings - Fork 92
Add partial Configuration Cache compatibility #433
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
Open
Nouran-11
wants to merge
37
commits into
nebula-plugins:main
Choose a base branch
from
Nouran-11:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
- Create GradleLintPatchAction at configuration time using ProjectInfo - Update console output action to use ProjectInfo instead of project - Avoid accessing project in @TaskAction method
…in LintGradleTask
… and FixGradleLintTask.
WIP : Fix partially compatibility
abstratt
reviewed
Jul 18, 2025
abstratt
reviewed
Jul 18, 2025
src/main/groovy/com/netflix/nebula/lint/plugin/GradleLintReportTask.groovy
Show resolved
Hide resolved
abstratt
reviewed
Jul 18, 2025
abstratt
reviewed
Jul 18, 2025
abstratt
reviewed
Jul 23, 2025
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.
Fixes #309
This pull request introduces the foundational work toward making the Nebula Lint plugin compatible with Gradle's Configuration Cache. The changes here are part of my Google Summer of Code 2025 project with Gradle.
The Problem
The plugin currently accesses the Project model directly during the task execution phase . This behavior is a direct violation of Configuration Cache rules and prevents Gradle from caching the task graph, leading to slower builds.
The Solution
This PR adopts the Data Projection Pattern to decouple linting logic from the live Gradle model and introduces partial Configuration Cache support:
ProjectInfo & ProjectTree: New serializable data classes that act as snapshots of the project state, created at configuration time and injected into tasks as Inputs.
Refactored LintGradleTask and Services: The task logic and supporting services now operate on the projected data instead of directly accessing Project.
Introduced a Supplier for use in rules that still require access to the live model (e.g., subclasses of ModelAwareGradleLintRule).
Calling .get() on this supplier at execution time will break Configuration Cache for that run. It's intended as a temporary measure to support ongoing refactoring.
Next Steps
This PR is not the final solution—it introduces partial compatibility. To achieve full compliance, the following work remains:
Refactor Rules Using Project.configurations
Move dependency-based rules to consume data via the ProjectInfo or another serializable projection.
Update ModelAwareGradleLintRule Implementations
The Supplier is a transitional mechanism. The rules using it should be rewritten to operate on static snapshots, removing the need for live model access.