[ 
https://issues.apache.org/jira/browse/GEODE-10517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jinwoo Hwang updated GEODE-10517:
---------------------------------
    Description: 
h2. Summary

Restore Gradle execution optimizations for the aggregated test reporting 
workflow by explicitly declaring all upstream Test tasks as both inputs and 
dependencies of the {{:combineReports}} TestReport task, eliminating validation 
warnings and improving build performance.

 
h2. Description
h3. Problem Statement

The Gradle build system is emitting a validation warning that disables 
execution optimizations for the {{:combineReports}} task, which aggregates test 
results from all subprojects into a single HTML report. This warning indicates 
implicit file coupling without proper task dependency declaration, causing 
Gradle to defensively disable performance optimizations.

*Gradle Warning Message:*
{noformat}
Task ':combineReports' uses the output of task ':geode-old-versions:test' 
without declaring an explicit or implicit dependency. 
Execution optimizations have been disabled.
{noformat}
h3. Current Behavior

The {{combineReports}} task is configured to read binary test result 
directories generated by multiple subproject Test tasks, but lacks formal task 
dependency edges and input relationships:
{code:groovy}
// Current problematic configuration (simplified)
task combineReports(type: TestReport) {
    // Reads test results from all subprojects
    // BUT: No explicit dependency or input declaration
    destinationDir = file("$buildDir/reports/combined")
}
{code}
*What Happens:*
 # {{combineReports}} implicitly consumes test result outputs from subprojects
 # Gradle 7+ detects this implicit file coupling
 # Gradle cannot guarantee correct execution order
 # Gradle defensively disables execution optimizations
 # Warning appears in build logs (local and CI)

h3. Impact Assessment
h4. Build Performance

*Execution Optimization Disabled:*
 * Reduced scheduling efficiency in multi-module builds
 * Potential loss of incremental build behavior
 * Suboptimal task parallelization
 * Longer CI/CD pipeline execution times

*Quantified Impact (Estimated):*
 * Multi-module builds: 5-10% slower scheduling
 * Incremental builds: Up-to-date checks may not function optimally
 * Parallel execution: Task graph optimization disabled for affected tasks

h4. Build Reliability

*Nondeterministic Ordering Risk:*
 * Without explicit dependencies, task execution order is undefined
 * {{:combineReports}} might execute before test tasks complete
 * Race condition: Report may be generated with incomplete test results
 * Build output may vary between runs (flaky builds)

*Symptoms:*
 * Intermittent missing test results in combined report
 * "File not found" errors if test results haven't been generated yet
 * Different behavior in local vs. CI environments

h4. Developer Experience

*Noise and Confusion:*
 * Warning appears in every build output
 * Developers unsure if warning indicates a real problem
 * CI logs cluttered with validation warnings
 * Reduced signal-to-noise ratio in build diagnostics

h3. Root Cause Analysis
h4. Gradle Execution Model

Gradle builds a task dependency graph based on:
 # *Explicit dependencies:* {{{}dependsOn{}}}, {{{}mustRunAfter{}}}, 
{{shouldRunAfter}}
 # *Input/Output relationships:* Tasks declare what they consume and produce
 # *Implicit dependencies:* Gradle infers dependencies from input/output wiring

*The Problem:*

The {{combineReports}} task:
 * Reads files produced by Test tasks (implicit consumption)
 * Does not declare these Test tasks as dependencies (no explicit edge)
 * Does not declare test result directories as inputs (no input relationship)

Result: Gradle detects implicit file coupling but cannot safely optimize 
scheduling.
h4. Why Gradle 7+ Is Stricter

*Historical Context:*
|Gradle Version|Behavior|Risk|
|Gradle 6.x|Tolerates implicit dependencies|Silent failures, nondeterministic 
builds|
|Gradle 7.0+|Warns and disables optimizations|Conservative, safe, but slower|
|Gradle 8.0+|May fail builds with strict validation|Forces correct dependency 
modeling|

*Philosophy Shift:*
 * Gradle 7+ prioritizes build correctness over backward compatibility
 * Implicit file coupling is treated as a configuration error
 * Explicit is better than implicit (Python PEP 20 principle)

h4. Specific Issue: geode-old-versions Module

The {{:geode-old-versions:test}} task is particularly problematic:
 * Located in a separate subproject ({{{}geode-old-versions{}}})
 * Generates test results consumed by {{:combineReports}} in root project
 * Cross-project dependency not declared
 * Most frequently triggers the validation warning

h3. Scope of Issue
h4. Affected Files
{noformat}
build.gradle (root project)
└── combineReports task configuration
    ├── Missing: reportOn declaration
    ├── Missing: dependsOn declaration
    └── Redundant: duplicate whenReady block
{noformat}
h4. Affected Workflows
 # *Local development builds:* {{./gradlew build}}
 # *CI/CD pipelines:* All test jobs generating combined reports
 # *Developer testing:* {{./gradlew test combineReports}}
 # *Incremental builds:* Any build involving test execution

h4. Related Tasks

*Upstream Tasks (Test result producers):*
 * All subproject {{test}} tasks ({{{}:geode-core:test{}}}, 
{{{}:geode-cq:test{}}}, etc.)
 * {{:geode-old-versions:test}} (explicitly problematic)
 * Any custom test tasks in subprojects

*Downstream Tasks (Report consumers):*
 * {{:combineReports}} (aggregates all test results)
 * CI report archival tasks
 * Documentation generation tasks depending on test results

h2. Benefits of This Enhancement
h3. Build Performance
 * *Execution optimizations re-enabled* - Gradle can optimize scheduling
 * *Better parallelization* - Task graph can be optimized for concurrent 
execution
 * *Incremental builds* - Up-to-date checks work correctly
 * *Caching improvements* - Build cache can be used effectively

*Expected Improvements:*
 * Multi-module builds: 5-10% faster scheduling
 * Incremental rebuilds: Proper skipping of unchanged tasks
 * CI pipelines: More efficient task execution

h3. Build Reliability
 * *Deterministic ordering* - Test tasks always complete before reporting
 * *No race conditions* - Explicit dependencies prevent timing issues
 * *Consistent results* - Same behavior in local and CI environments
 * *Predictable output* - Combined report always contains complete results

h3. Developer Experience
 * *Clean build logs* - No more validation warnings
 * *Clear intent* - Dependency relationships are explicit and documented
 * *Easier debugging* - Task execution order is predictable
 * *Better CI output* - Reduced noise in pipeline logs

h3. Code Quality
 * *Best practices* - Follows Gradle recommended patterns
 * *Future-proof* - Compatible with Gradle 8+ strict validation
 * *Maintainable* - Explicit configuration easier to understand
 * *Documented* - Clear comments explain purpose

h2.  
h2. Technical Background
h3. Gradle Task Dependency Model

*Three Types of Dependencies:*
|Type|Declaration|Purpose|Example|
|Execution Order|{{dependsOn}}|Task B must run after Task 
A|{{combineReports.dependsOn test}}|
|Input/Output|{{{}reportOn{}}}, {{from}}|Task B consumes Task A 
output|{{reportOn testTask}}|
|Soft Order|{{mustRunAfter}}|Ordering hint, not strict|{{mustRunAfter 
cleanTask}}|

*Our Solution Uses:*
 * {{dependsOn}} for execution order (strict)
 * {{reportOn}} for input declaration (what we consume)

h3. TestReport Task API

*Gradle's Built-in TestReport Task:*
{code:groovy}
interface TestReport {
    // Declares which test tasks to aggregate
    void reportOn(Test... tasks)
    
    // Output location
    File getDestinationDir()
    
    // Inherits from Task
    Task dependsOn(Object... tasks)
}
{code}
*Key Methods:*
 * {{reportOn()}} - Declares test result inputs AND establishes dependency
 * {{dependsOn()}} - Ensures explicit execution ordering
 * Using both provides belt-and-suspenders safety

h3. Gradle 7+ Validation Changes

*What Changed in Gradle 7:*
 # Stricter task input/output validation
 # Detection of implicit file dependencies
 # Warning when outputs consumed without declaration
 # Future direction: Make warnings into errors (Gradle 8+)

*Our Compliance:*
 * Explicit {{reportOn}} declares inputs
 * Explicit {{dependsOn}} declares dependencies

 # Gradle can validate correctness
 # Optimizations can be safely enabled

----
h2. Risk Assessment
h3. Risk of NOT Fixing

*Build Performance Risk: MEDIUM*
 * Continued suboptimal build performance
 * Execution optimizations remain disabled
 * Incremental builds less effective
 * Longer CI/CD pipeline times

*Build Reliability Risk: LOW-MEDIUM*
 * Potential nondeterministic execution order
 * Rare race condition scenarios
 * Intermittent missing test results in reports
 * Harder to debug timing-related issues

*Developer Experience Risk: LOW*
 * Ongoing noise in build logs
 * Confusion about warning severity
 * Reduced trust in build system
 * More time spent investigating false alarms

h3. Risk of Fixing

*Implementation Risk: VERY LOW*
 * Pure declarative configuration change
 * No logic modifications
 * No test code changes
 * Extensive verification performed

*Compatibility Risk: NONE*
 * Fully backward compatible
 * No API changes
 * No behavioral changes (except warning removal)
 * Works with all Gradle versions

*Regression Risk: VERY LOW*
 * Changes only affect build graph construction
 * Does not alter test execution or reporting logic
 * 17/17 CI checks passing
 * Manual verification complete

*Overall Risk: LOW*
 * High benefit, minimal risk
 * Aligns with Gradle best practices
 * Future-proofs for Gradle 8+

h2. Success Criteria

When this enhancement is implemented, the following should be true:
 # *No Warnings:* Gradle validation warning eliminated from all builds
 # *Optimizations Enabled:* Execution optimizations active for 
{{:combineReports}}
 # *Deterministic Order:* {{:geode-old-versions:test}} always executes before 
{{:combineReports}}
 # *Complete Report:* All module test results appear in combined report
 # *No Regressions:* No new warnings or errors introduced
 # *Performance:* Incremental build behavior working correctly

h2. Related Work
 * Build system modernization efforts
 * CI/CD pipeline optimization
 * Test infrastructure improvements
 * Gradle upgrade preparations (Gradle 8+)

 

  was:
h2. Summary

Restore and stabilize the aggregate Javadoc build 
({{{}:geode-assembly:docs{}}}) under Gradle 7 by implementing a three-layered 
approach: minimal stub classes for surgical symbol resolution, legacy Tomcat 6 
JARs for broad coverage, and modern Tomcat 9 dependencies for current APIs. 
This eliminates unresolved symbol errors while preventing third-party API 
documentation leakage.
h2. Description
h3. Problem Statement

The aggregate Javadoc build task ({{{}:geode-assembly:docs{}}}) fails under 
Gradle 7 due to unresolved Tomcat 6/7 API symbols. Geode's session management 
modules reference legacy Tomcat classes ({{{}LifecycleSupport{}}}, 
{{{}SerializablePrincipal{}}}, etc.) that no longer exist in modern Tomcat 
versions, causing Javadoc compilation to fail with "symbol not found" errors.

*Current Failure:*
{noformat}
Task :geode-assembly:docs FAILED

error: cannot find symbol
  [javadoc] import org.apache.catalina.ha.session.SerializablePrincipal;
  [javadoc]                                        ^
  [javadoc]   symbol:   class SerializablePrincipal
  [javadoc]   location: package org.apache.catalina.ha.session

error: cannot find symbol
  [javadoc] import org.apache.catalina.util.LifecycleSupport;
  [javadoc]                                  ^
  [javadoc]   symbol:   class LifecycleSupport
  [javadoc]   location: package org.apache.catalina.util

... (30+ similar unresolved symbols)
{noformat}
h3. Historical Context
h4. Previous State

*Before Refactoring:*
 * Aggregate Javadoc task worked with older Gradle versions
 * Dependencies implicitly resolved Tomcat symbols
 * No explicit version conflicts managed

*After Gradle 7 Migration:*
 * Stricter classpath resolution broke implicit dependencies
 * Legacy Tomcat symbols no longer automatically available
 * Build failures blocking documentation generation

h4. Previous Workaround Attempts
|Approach|Implementation|Problem|
|Global {{failOnError=false}}|Disable all Javadoc error checking|Masks real 
documentation issues, defeats purpose|
|Class exclusions|{{exclude 'org/apache/geode/modules/session/**'}}|Removes 
session management from documentation|
|Legacy extraction only|Extract Tomcat 6 distribution JARs|Brittle, noisy, 
conflicts with modern APIs|
|Stubs only|Create minimal placeholders|Insufficient coverage (30+ classes 
needed)|

*None of these approaches were satisfactory:*
 * Quality compromise (ignoring errors or excluding content)
 * Maintenance burden (extensive stub creation)
 * Brittle dependencies (full legacy distribution extraction)

h3. Current Behavior

*Build Failure:*
{code:bash}
./gradlew :geode-assembly:docs

# Result: FAILED
# Reason: Unresolved symbols from legacy Tomcat APIs
# Impact: No aggregate Javadoc generated
{code}
*Specific Symbol Resolution Failures:*
|Symbol|Package|Usage in Geode|Tomcat Version|
|LifecycleSupport|org.apache.catalina.util|Session lifecycle management|Tomcat 
6/7 only|
|SerializablePrincipal|org.apache.catalina.ha.session|Delta session 
replication|Tomcat 6/7 only|
|ManagerBase|org.apache.catalina.session|Session manager base class|Removed in 
Tomcat 9|
|SecurityUtil|org.apache.catalina.security|Security utilities|Changed in Tomcat 
9|
|GenericPrincipal|org.apache.catalina.realm|Authentication principal|Signature 
changed|

 

*Code Example (DeltaSession.java):*
{code:java}
package org.apache.geode.modules.session.internal.filter;

import org.apache.catalina.ha.session.SerializablePrincipal;  // NOT FOUND
import org.apache.catalina.util.LifecycleSupport;             // NOT FOUND

public class DeltaSession extends Session {
    private SerializablePrincipal principal;  // Compilation fails
    private LifecycleSupport lifecycle;       // Compilation fails
}
{code}
h3. Scope of Issue
h4. Affected Modules
{noformat}
geode-assembly/
├── build.gradle                   (Javadoc task configuration)
└── src/javadocStubs/java/         (NEW - stub classes)
    └── org/apache/catalina/
        ├── util/LifecycleSupport.java
        ├── ha/session/SerializablePrincipal.java
        ├── LifecycleListener.java
        ├── Realm.java
        └── realm/GenericPrincipal.java

geode-modules/
├── geode-modules-session-internal/ (Uses legacy Tomcat 6 APIs)
├── geode-modules-tomcat7/          (Uses Tomcat 7 APIs)
├── geode-modules-tomcat8/          (Uses Tomcat 8 APIs)
└── geode-modules-tomcat9/          (Uses modern Tomcat 9 APIs)
{noformat}
h4. Symbol Count Analysis

*Tomcat Class References in Geode:*
 * Total {{org.apache.catalina.*}} imports: 30+ unique classes
 * Legacy-only classes (Tomcat 6/7): 26+ classes
 * Modern-only classes (Tomcat 9+): 8+ classes
 * Classes with API changes between versions: 4+ classes

*Coverage Breakdown:*
 * Stub classes created: 5 (surgical fixes)
 * Legacy JAR coverage: 26+ classes (broad coverage)
 * Modern dependencies: 8+ classes (current API support)

h3. Root Cause Analysis
h4. Multi-Version Tomcat Support Challenge

Geode supports multiple Tomcat versions simultaneously:
{noformat}
geode-modules-tomcat7  → Tomcat 7.x APIs
geode-modules-tomcat8  → Tomcat 8.x APIs
geode-modules-tomcat9  → Tomcat 9.x APIs
geode-modules-session  → Legacy Tomcat 6/7 APIs
{noformat}
*The Fundamental Problem:*
 * Legacy code requires Tomcat 6/7 classes (removed in Tomcat 9)
 * Modern code requires Tomcat 9 classes (different from Tomcat 6)
 * Aggregate Javadoc must compile ALL modules together
 * No single Tomcat version satisfies all requirements

h4. Gradle 7 Strictness

*What Changed:*
 * Gradle 7+ enforces stricter classpath validation
 * Unresolved symbols cause immediate build failure
 * {{-Xwerror}} flag enforced by default for quality
 * Previous implicit dependency resolution no longer works

*Impact:*
 * Build that worked in Gradle 6 now fails
 * Cannot ignore errors without compromising quality
 * Must explicitly resolve ALL symbol dependencies

h3. API Leakage Prevention

*Problem:* Don't want Tomcat internal APIs in published Javadoc

*Solution:*
{code:groovy}
task docs(type: Javadoc) {
    // Exclude all Tomcat packages from generated documentation
    exclude 'org/apache/catalina/**'
    exclude 'org/apache/tomcat/**'
    exclude 'org/apache/coyote/**'
}
{code}
*Result:*
 * Tomcat classes used for compilation/type checking only
 * No Tomcat packages appear in published Javadoc HTML
 * Only Geode classes documented

h2. Benefits of This Enhancement
h3. Build Stability
 * *Complete symbol resolution* - All 30+ Tomcat references resolved
 * *No error suppression* - {{-Xwerror}} remains enabled for quality
 * *Gradle 7+ compatible* - Works with strict validation
 * *Deterministic builds* - Consistent results across environments

h3. Documentation Quality
 * *Full coverage* - Session management included in documentation
 * *No content loss* - All Geode modules documented
 * *Clean output* - No third-party API leakage
 * *Professional appearance* - Complete, error-free Javadoc

h3. Maintainability
 * *Layered approach* - Each layer has clear purpose
 * *Minimal custom code* - Only 5 stub classes needed
 * *Low maintenance* - Stubs are minimal, unlikely to change
 * *Clear intent* - Each layer documented and justified

h3. Compliance and Quality
 * *RAT compliant* - All stub files have ASF license headers
 * *Quality gates enabled* - {{-Xwerror}} catches real issues
 * *Future-proof* - Ready for stricter enforcement
 * *Best practices* - Follows Gradle documentation patterns

h2. Success Criteria

When this enhancement is implemented, the following should be true:
 # *Build Success:* {{:geode-assembly:docs}} completes with exit code 0
 # *Symbol Resolution:* All 30+ Tomcat references resolve without errors
 # *Quality Gates:* {{-Xwerror}} remains enabled, catching real issues
 # *Content Coverage:* Session management modules included in documentation
 # *API Isolation:* No Tomcat packages appear in published Javadoc
 # *License Compliance:* All stub files pass RAT checks with ASF headers
 # *No Regressions:* All 15 CI checks passing

h2. Risk Assessment
h3. Risk of NOT Fixing

*Documentation Risk: HIGH*
 * Aggregate Javadoc cannot be generated
 * Session management undocumented
 * API documentation incomplete
 * User/developer confusion

*Quality Risk: MEDIUM*
 * Cannot enable strict error checking
 * Real documentation issues masked
 * Professional appearance compromised

*Maintenance Risk: MEDIUM*
 * Workarounds accumulate over time
 * Technical debt increases
 * Future Gradle versions may break completely

h3. Risk of Fixing

*Implementation Risk: LOW*
 * Pure build configuration changes
 * No runtime code modifications
 * Well-tested approach

*Compatibility Risk: VERY LOW*
 * Only affects Javadoc generation
 * No published artifact changes
 * No API modifications

*Maintenance Risk: LOW*
 * 5 minimal stub files (unlikely to change)
 * Clear documentation of approach
 * Layered strategy easy to understand

*Overall Risk: LOW*
 * High benefit (documentation restored)
 * Minimal risk (build infrastructure only)
 * Reversible (can revert if issues arise)

h2. Compliance and Standards
h3. Apache License Compliance

*RAT (Release Audit Tool) Validation:*
 * All 5 stub files include full ASF license headers
 * Copyright notices present
 * License references correct
 * {{./gradlew rat}} passes cleanly

*Stub File Header Example:*
{code:java}
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
{code}
h3. Documentation Standards

*Javadoc Quality:*
 * {{-Xwerror}} flag enabled (strict mode)
 * All documentation warnings treated as errors
 * Real issues caught during build
 * Professional output quality

*API Surface Control:*
 * Third-party APIs excluded from published docs
 * Only Geode public APIs documented
 * Clear separation of internal vs external
 * User-facing documentation clean

 
h2. Related Work
 * Gradle 7 migration efforts
 * Documentation infrastructure modernization
 * Tomcat version support strategy
 * Build system quality improvements

 


> Execution Optimization Enablement via Explicit Cross‑Module Test Result 
> Dependency Modeling 
> --------------------------------------------------------------------------------------------
>
>                 Key: GEODE-10517
>                 URL: https://issues.apache.org/jira/browse/GEODE-10517
>             Project: Geode
>          Issue Type: Improvement
>            Reporter: Jinwoo Hwang
>            Assignee: Jinwoo Hwang
>            Priority: Major
>             Fix For: 2.1.0
>
>
> h2. Summary
> Restore Gradle execution optimizations for the aggregated test reporting 
> workflow by explicitly declaring all upstream Test tasks as both inputs and 
> dependencies of the {{:combineReports}} TestReport task, eliminating 
> validation warnings and improving build performance.
>  
> h2. Description
> h3. Problem Statement
> The Gradle build system is emitting a validation warning that disables 
> execution optimizations for the {{:combineReports}} task, which aggregates 
> test results from all subprojects into a single HTML report. This warning 
> indicates implicit file coupling without proper task dependency declaration, 
> causing Gradle to defensively disable performance optimizations.
> *Gradle Warning Message:*
> {noformat}
> Task ':combineReports' uses the output of task ':geode-old-versions:test' 
> without declaring an explicit or implicit dependency. 
> Execution optimizations have been disabled.
> {noformat}
> h3. Current Behavior
> The {{combineReports}} task is configured to read binary test result 
> directories generated by multiple subproject Test tasks, but lacks formal 
> task dependency edges and input relationships:
> {code:groovy}
> // Current problematic configuration (simplified)
> task combineReports(type: TestReport) {
>     // Reads test results from all subprojects
>     // BUT: No explicit dependency or input declaration
>     destinationDir = file("$buildDir/reports/combined")
> }
> {code}
> *What Happens:*
>  # {{combineReports}} implicitly consumes test result outputs from subprojects
>  # Gradle 7+ detects this implicit file coupling
>  # Gradle cannot guarantee correct execution order
>  # Gradle defensively disables execution optimizations
>  # Warning appears in build logs (local and CI)
> h3. Impact Assessment
> h4. Build Performance
> *Execution Optimization Disabled:*
>  * Reduced scheduling efficiency in multi-module builds
>  * Potential loss of incremental build behavior
>  * Suboptimal task parallelization
>  * Longer CI/CD pipeline execution times
> *Quantified Impact (Estimated):*
>  * Multi-module builds: 5-10% slower scheduling
>  * Incremental builds: Up-to-date checks may not function optimally
>  * Parallel execution: Task graph optimization disabled for affected tasks
> h4. Build Reliability
> *Nondeterministic Ordering Risk:*
>  * Without explicit dependencies, task execution order is undefined
>  * {{:combineReports}} might execute before test tasks complete
>  * Race condition: Report may be generated with incomplete test results
>  * Build output may vary between runs (flaky builds)
> *Symptoms:*
>  * Intermittent missing test results in combined report
>  * "File not found" errors if test results haven't been generated yet
>  * Different behavior in local vs. CI environments
> h4. Developer Experience
> *Noise and Confusion:*
>  * Warning appears in every build output
>  * Developers unsure if warning indicates a real problem
>  * CI logs cluttered with validation warnings
>  * Reduced signal-to-noise ratio in build diagnostics
> h3. Root Cause Analysis
> h4. Gradle Execution Model
> Gradle builds a task dependency graph based on:
>  # *Explicit dependencies:* {{{}dependsOn{}}}, {{{}mustRunAfter{}}}, 
> {{shouldRunAfter}}
>  # *Input/Output relationships:* Tasks declare what they consume and produce
>  # *Implicit dependencies:* Gradle infers dependencies from input/output 
> wiring
> *The Problem:*
> The {{combineReports}} task:
>  * Reads files produced by Test tasks (implicit consumption)
>  * Does not declare these Test tasks as dependencies (no explicit edge)
>  * Does not declare test result directories as inputs (no input relationship)
> Result: Gradle detects implicit file coupling but cannot safely optimize 
> scheduling.
> h4. Why Gradle 7+ Is Stricter
> *Historical Context:*
> |Gradle Version|Behavior|Risk|
> |Gradle 6.x|Tolerates implicit dependencies|Silent failures, nondeterministic 
> builds|
> |Gradle 7.0+|Warns and disables optimizations|Conservative, safe, but slower|
> |Gradle 8.0+|May fail builds with strict validation|Forces correct dependency 
> modeling|
> *Philosophy Shift:*
>  * Gradle 7+ prioritizes build correctness over backward compatibility
>  * Implicit file coupling is treated as a configuration error
>  * Explicit is better than implicit (Python PEP 20 principle)
> h4. Specific Issue: geode-old-versions Module
> The {{:geode-old-versions:test}} task is particularly problematic:
>  * Located in a separate subproject ({{{}geode-old-versions{}}})
>  * Generates test results consumed by {{:combineReports}} in root project
>  * Cross-project dependency not declared
>  * Most frequently triggers the validation warning
> h3. Scope of Issue
> h4. Affected Files
> {noformat}
> build.gradle (root project)
> └── combineReports task configuration
>     ├── Missing: reportOn declaration
>     ├── Missing: dependsOn declaration
>     └── Redundant: duplicate whenReady block
> {noformat}
> h4. Affected Workflows
>  # *Local development builds:* {{./gradlew build}}
>  # *CI/CD pipelines:* All test jobs generating combined reports
>  # *Developer testing:* {{./gradlew test combineReports}}
>  # *Incremental builds:* Any build involving test execution
> h4. Related Tasks
> *Upstream Tasks (Test result producers):*
>  * All subproject {{test}} tasks ({{{}:geode-core:test{}}}, 
> {{{}:geode-cq:test{}}}, etc.)
>  * {{:geode-old-versions:test}} (explicitly problematic)
>  * Any custom test tasks in subprojects
> *Downstream Tasks (Report consumers):*
>  * {{:combineReports}} (aggregates all test results)
>  * CI report archival tasks
>  * Documentation generation tasks depending on test results
> h2. Benefits of This Enhancement
> h3. Build Performance
>  * *Execution optimizations re-enabled* - Gradle can optimize scheduling
>  * *Better parallelization* - Task graph can be optimized for concurrent 
> execution
>  * *Incremental builds* - Up-to-date checks work correctly
>  * *Caching improvements* - Build cache can be used effectively
> *Expected Improvements:*
>  * Multi-module builds: 5-10% faster scheduling
>  * Incremental rebuilds: Proper skipping of unchanged tasks
>  * CI pipelines: More efficient task execution
> h3. Build Reliability
>  * *Deterministic ordering* - Test tasks always complete before reporting
>  * *No race conditions* - Explicit dependencies prevent timing issues
>  * *Consistent results* - Same behavior in local and CI environments
>  * *Predictable output* - Combined report always contains complete results
> h3. Developer Experience
>  * *Clean build logs* - No more validation warnings
>  * *Clear intent* - Dependency relationships are explicit and documented
>  * *Easier debugging* - Task execution order is predictable
>  * *Better CI output* - Reduced noise in pipeline logs
> h3. Code Quality
>  * *Best practices* - Follows Gradle recommended patterns
>  * *Future-proof* - Compatible with Gradle 8+ strict validation
>  * *Maintainable* - Explicit configuration easier to understand
>  * *Documented* - Clear comments explain purpose
> h2.  
> h2. Technical Background
> h3. Gradle Task Dependency Model
> *Three Types of Dependencies:*
> |Type|Declaration|Purpose|Example|
> |Execution Order|{{dependsOn}}|Task B must run after Task 
> A|{{combineReports.dependsOn test}}|
> |Input/Output|{{{}reportOn{}}}, {{from}}|Task B consumes Task A 
> output|{{reportOn testTask}}|
> |Soft Order|{{mustRunAfter}}|Ordering hint, not strict|{{mustRunAfter 
> cleanTask}}|
> *Our Solution Uses:*
>  * {{dependsOn}} for execution order (strict)
>  * {{reportOn}} for input declaration (what we consume)
> h3. TestReport Task API
> *Gradle's Built-in TestReport Task:*
> {code:groovy}
> interface TestReport {
>     // Declares which test tasks to aggregate
>     void reportOn(Test... tasks)
>     
>     // Output location
>     File getDestinationDir()
>     
>     // Inherits from Task
>     Task dependsOn(Object... tasks)
> }
> {code}
> *Key Methods:*
>  * {{reportOn()}} - Declares test result inputs AND establishes dependency
>  * {{dependsOn()}} - Ensures explicit execution ordering
>  * Using both provides belt-and-suspenders safety
> h3. Gradle 7+ Validation Changes
> *What Changed in Gradle 7:*
>  # Stricter task input/output validation
>  # Detection of implicit file dependencies
>  # Warning when outputs consumed without declaration
>  # Future direction: Make warnings into errors (Gradle 8+)
> *Our Compliance:*
>  * Explicit {{reportOn}} declares inputs
>  * Explicit {{dependsOn}} declares dependencies
>  # Gradle can validate correctness
>  # Optimizations can be safely enabled
> ----
> h2. Risk Assessment
> h3. Risk of NOT Fixing
> *Build Performance Risk: MEDIUM*
>  * Continued suboptimal build performance
>  * Execution optimizations remain disabled
>  * Incremental builds less effective
>  * Longer CI/CD pipeline times
> *Build Reliability Risk: LOW-MEDIUM*
>  * Potential nondeterministic execution order
>  * Rare race condition scenarios
>  * Intermittent missing test results in reports
>  * Harder to debug timing-related issues
> *Developer Experience Risk: LOW*
>  * Ongoing noise in build logs
>  * Confusion about warning severity
>  * Reduced trust in build system
>  * More time spent investigating false alarms
> h3. Risk of Fixing
> *Implementation Risk: VERY LOW*
>  * Pure declarative configuration change
>  * No logic modifications
>  * No test code changes
>  * Extensive verification performed
> *Compatibility Risk: NONE*
>  * Fully backward compatible
>  * No API changes
>  * No behavioral changes (except warning removal)
>  * Works with all Gradle versions
> *Regression Risk: VERY LOW*
>  * Changes only affect build graph construction
>  * Does not alter test execution or reporting logic
>  * 17/17 CI checks passing
>  * Manual verification complete
> *Overall Risk: LOW*
>  * High benefit, minimal risk
>  * Aligns with Gradle best practices
>  * Future-proofs for Gradle 8+
> h2. Success Criteria
> When this enhancement is implemented, the following should be true:
>  # *No Warnings:* Gradle validation warning eliminated from all builds
>  # *Optimizations Enabled:* Execution optimizations active for 
> {{:combineReports}}
>  # *Deterministic Order:* {{:geode-old-versions:test}} always executes before 
> {{:combineReports}}
>  # *Complete Report:* All module test results appear in combined report
>  # *No Regressions:* No new warnings or errors introduced
>  # *Performance:* Incremental build behavior working correctly
> h2. Related Work
>  * Build system modernization efforts
>  * CI/CD pipeline optimization
>  * Test infrastructure improvements
>  * Gradle upgrade preparations (Gradle 8+)
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to