- Notifications
You must be signed in to change notification settings - Fork103
fix: mark tasks as cacheable#478
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chadlwilson commentedOct 13, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Honestly, this is a bit scary. Can you please hold off?
|
chadlwilson commentedOct 13, 2025
I think the OP in#100 (comment) is highlighting what I mention in#3) by suggesting that the "update" bits would need to be factored out into a separate task which can basically run every time to check NVD/OssIndex etc. If those don't lead to a change in the Unfortunately, the way the engine is set up and the way many analyzers are "online" (not cacheable), I think it probably makes it a bit difficult to do this task/build caching in a predictable manner and to be useful? Conceptually, you'd want every analyzer to be marked as to whether it depends on a "mutable online source" and then for the up-to-date-ness of the Gradle tasks to depend on the analyzers enabled. |
jeremylong commentedOct 13, 2025
This PR and#474 are not going to be merged without a lot more review, testing, and consideration of consequences. Regarding point 3 above - I understand the need/desire to re-run the task if a day or more has passed and nothing has changed. However, if I run a build back-to-back that invokes the task, I believe it is fair to expect the task to be skipped if none of the inputs or outputs have been changed. |
chadlwilson commentedOct 13, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ok, cool - I thouhht perhaps you wanted to get it into the fix release today 😅 But yes I agree it'd be nice to define some semantics on up-to-date-ness here that are cache-aware (for NVD) and allow the user to, say, opt-out of rechecking certain online sources more frequently than X minutes even if they don't support caching of their results |
chadlwilson commentedOct 13, 2025
I guess you could try and make this dynamic based on information using customhttps://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskOutputs.html if the engine configuration can answer some questions somehow. Like in pseudo-code: outputs.cacheIf("All enabled analyzers are cacheable") {task-> task.forceCachingOfOnlineAnalyzers.get()|| task.engine.allEnabledAnalyzersAreCacheable()}outputs.upToDateWhen {task->!task.engine.needsDataSourceCacheRefresh()} |
resolves#100
This should only be merged after#476.