Skip to content

🛡️ Add coverage XML validation #69

@jordanpartridge

Description

@jordanpartridge

Problem

Code assumes coverage.xml exists and is valid, leading to cryptic errors when it's not.

Current Risk

File: app/Services/CloverParser.php

  • No validation that coverage file exists
  • No validation that XML is well-formed
  • Silent failures or PHP warnings

Proposed Implementation

if (!file_exists($cloverPath)) {
    throw new \RuntimeException("Coverage file not found: {$cloverPath}");
}

$xml = @simplexml_load_file($cloverPath);
if ($xml === false) {
    throw new \RuntimeException("Invalid coverage XML at: {$cloverPath}");
}

Benefits

  • Clear error messages for missing/invalid coverage files
  • Prevents XML parsing errors
  • Better debugging experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions