Skip to content

Conversation

@abstratt
Copy link
Member

@abstratt abstratt commented Dec 16, 2025

Issue: #36046 (see reproducer there)

Without the fix:

5000 problems were found storing the configuration cache, only the first 4096 were considered, 1 of which seems unique.
- Build file 'child/build.gradle': line 2: Project ':child' cannot dynamically look up a property in the parent project ':'

Report size: 107M

With the fix:

5000 problems were found storing the configuration cache, 1 of which seems unique.
- Build file 'child/build.gradle': line 2: Project ':child' cannot dynamically look up a property in the parent project ':'

Report size: 153K

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@abstratt abstratt added this to the 9.4.0 RC1 milestone Dec 16, 2025
@abstratt

This comment has been minimized.

@bot-gradle

This comment has been minimized.

@abstratt abstratt force-pushed the rchaves/master/max-unique-problems branch from 03fa21f to 0f1ecef Compare December 16, 2025 17:42
@abstratt abstratt self-assigned this Dec 16, 2025
withProblem("Task `:problems` of type `BrokenTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.")
totalProblemsCount = 6
problemsWithStackTraceCount = 2
problemsWithStackTraceCount = 1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are unique counts now

addNotReportedDegradingTasks()
addDegradingFeatures()
val summary = summarizer.get()
val hasNoProblemsForConsole = summary.reportableProblemCount == 0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got confused by reportableProblemCount - it really means a count of problems we report to the console

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry 😄

@abstratt abstratt force-pushed the rchaves/master/max-unique-problems branch from 0f1ecef to 0b30add Compare December 16, 2025 17:58
val lock = ReentrantLock()

fun get(): Summary = lock.withLock {
Summary(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many parameters here have same type, wanted to make the data flows more explicit

totalProblemCount = totalProblemCount,
uniqueProblemCount = problemCauses.size,
deferredProblemCount = deferredProblemCount,
consoleProblemCount = totalProblemCount - suppressedSilentlyProblemCount,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an actual change

uniqueProblemCount = problemCauses.size,
deferredProblemCount = deferredProblemCount,
consoleProblemCount = totalProblemCount - suppressedSilentlyProblemCount,
consoleProblemCauses = ImmutableMap.copyOf(problemCauses.filterValues { it != ProblemSeverity.SuppressedSilently }),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is this. Since we only care for problem causes we can show on the console, decided to filter it here, and reflect that in the property name

overflowed = true
return false
}
if (severity != ProblemSeverity.SuppressedSilently) {
Copy link
Member Author

@abstratt abstratt Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, we would not apply deduplication to problems with this severity, now we do

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Do we cover this by integTest?

Copy link
Member Author

@abstratt abstratt Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do with a unit test:

Also, integration tests had to be updated to reflect this, including a smoke test.

fun onIncompatibleFeature() {
fun onIncompatibleFeature(problem: PropertyProblem) {
lock.withLock {
onProblem(problem, ProblemSeverity.SuppressedSilently)
Copy link
Member Author

@abstratt abstratt Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For incompatible features, we were adding a problem to the report without letting the summarizer know - now we do report the problem so it is reflected on totalProblemCount and suppressedSilentlyProblemCount.

* Returns whether problem was accepted.
*/
private
fun recordProblemCause(problem: PropertyProblem, severity: ProblemSeverity): Boolean {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, this may return false even if the new problem upgraded the severity of a previous one

@abstratt abstratt force-pushed the rchaves/master/max-unique-problems branch 2 times, most recently from be5eed3 to fad4665 Compare December 16, 2025 18:19
abstratt