Skip to content

CI Failure DoctorCI Failure - Per-Class Coverage Gate Regression in PR #4271 #4313

@github-actions

Description

@github-actions

Failure Details

Failed Jobs and Errors

Job Step Conclusion
Per-Class Coverage Gate Enforce Per-Class Coverage Gate ❌ failure
allBuildAndTestSuccessful Verify all jobs passed ❌ failure (depends on above)

The "Enforce Per-Class Coverage Gate" step failed. All build/test jobs passed successfully.

Root Cause

PR #4271 adds a new validation rule VARIABLES_NOT_ALLOWED_IN_DIRECTIVES_ON_VARIABLE_DEFINITIONS with approximately 29 new lines in OperationValidator.java (method validateVariableNotAllowedInConstantDirective at ~line 997, plus changes to checkVariable).

The test-baseline.json was last updated by merging master, so it reflects master branch coverage for OperationValidator — specifically:

  • graphql.validation.OperationValidator: 97.8% line, 92.2% branch, 99.0% method

However, after the PR adds new code, the actual JaCoCo report shows lower coverage because the test-baseline.json was not updated to account for the new lines/branches added by this PR. The coverage gate then detects a regression when comparing actual CI coverage against the (now stale) baseline.

Specifically, there is a branch in validateVariableNotAllowedInConstantDirective that is likely uncovered:

} else if (ancestor instanceof VariableDefinition) {
    if (inDirective) {
        // error – covered by test
    }
    return; // ← this path (inDirective=false when VariableDefinition found) may not be exercised
}

This "variable reference inside a VariableDefinition but NOT inside a Directive" path is a case where the loop terminates via the return without an error. The current test suite may not directly exercise this path (e.g., a variable reference used as a default value, though that's normally disallowed by the grammar).

Recommended Fix

  • Run the test suite locally with JaCoCo and update test-baseline.json with the actual coverage numbers produced by the PR's code (the test-baseline.json in the PR only reflects master numbers, not the new code's actual coverage).
  • Alternatively, add a test case that exercises the remaining branch in validateVariableNotAllowedInConstantDirective (e.g., variable reference inside a VariableDefinition default value, or in a nested object within a directive argument), then update the baseline.
  • The baseline update command can be triggered by running ./gradlew test jacocoTestReport and re-running the baseline update workflow to regenerate test-baseline.json.

Relevant file: src/main/java/graphql/validation/OperationValidator.java (method validateVariableNotAllowedInConstantDirective, ~line 997)

Generated by CI Failure Doctor

To install this workflow, run gh aw add githubnext/agentics/workflows/ci-doctor.md@ee50a3b7d1d3eb4a8c409ac9409fd61c9a66b0f5. View source at https://github.com/githubnext/agentics/tree/ee50a3b7d1d3eb4a8c409ac9409fd61c9a66b0f5/workflows/ci-doctor.md.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions