Experimental read code coverage metrics

From chromium/chromium · View interactive version

Experimental read code coverage metrics is an AI agent skill from the GitHub repository chromium/chromium. Retrieves and analyzes Chromium per-CL code coverage data from the Findit API. Records per-CL coverage metrics for all modified source files and extracts unexecuted code lines.

How to use this skill

Skill file

Read Code Coverage Metrics

This skill fetches and processes code coverage data for a given Gerrit CL and

patchset. It uses the live Findit API to retrieve coverage percentages and

line-by-line details, records coverage metrics for all modified source files,

and extracts the code blocks corresponding to uncovered lines.

When to Use This Skill

Activate this skill when:

jobs.

blocks* are untested.

Inputs (Passed directly in prompt)

When invoked as a subagent, the parent agent MUST explicitly pass:

Workflow

  1. Extract CL Details & Run Coverage Metrics Script: Use

tools/code_coverage/parse_gerrit_url.py to extract host, project,

change, and patchset from cl_url:

```bash

vpython3 tools/code_coverage/parse_gerrit_url.py <cl_url>

```

Execute fetch_coverage_metrics.py passing the extracted parameters and optional --files filter:

```bash

vpython3 tools/code_coverage/fetch_coverage_metrics.py --host <host> \

--project <project> --change <change> --patchset <patchset> \

--output <artifact_path> --files <target_files>

```

  1. Verify Coverage Artifact: Confirm the script generated the artifact at

<artifact_path>. The artifact maps modified source files to their coverage

metrics and uncovered lines:

```json

{

"chrome/browser/.../CommerceBottomSheetContentMediator.java": {

"metrics": {

"absolute_coverage": 80.0,

"incremental_coverage": 65.0,

"absolute_unit_tests_coverage": 80.0,

"incremental_unit_tests_coverage": 65.0

},

"low_coverage_type": [

"incremental_coverage",

"incremental_unit_tests_coverage"

],

"uncovered_lines": {

"77": " mBottomSheetContent.setConfirmBoxVisible(false);",

"78": " mBottomSheetContent.setConfirmButtonEnabled(false);"

}

}

}

```

Output

The skill stores the detailed coverage JSON artifact directly at

<artifact_path> (scratch/original_metrics.json,

scratch/control_metrics.json, or scratch/fix_metrics.json). It should return

a summary message indicating the coverage metrics and unexecuted line counts

across modified source files.

Important Considerations

LUCI_AUTH_TOKEN in the environment.

API or decoding failures.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.