Skip to content

Document Coverage Measurement and Declare Codecov Flags - #1172

Merged
ptr727 merged 3 commits into
developfrom
coverage-phase2
Nov 2, 2026
Merged

ptr727 merged 3 commits into
developfrom
coverage-phase2

Conversation

@ptr727

@ptr727 ptr727 commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Phase 2 of the coverage plan in the coverage handoff (#1171). It provides what the integration, regression, and Windows coverage runs need, before any of those runs exists. No C# changes.

  • Pins dotnet-coverage and ReportGenerator in .config/dotnet-tools.json.
  • Adds Docker/PlexCleaner.coverage.json, the default settings with every off-by-default step turned on: DeInterlace, RemoveUnwantedLanguageTracks, RemoveDuplicateTracks, SidecarUpdateOnToolChange, RestoreFileTimestamp, DeleteInvalidFiles, RegisterInvalidFiles.
  • codecov.yml declares the integration, regression, and windows flags. Only regression and windows carry forward. A fixes rule strips the image builder's /Builder/ source prefix.
  • OPERATIONS.md "Measure code coverage" documents the local unit, image, and merge loop. It explains how a local rate compares with Codecov's, gives the Windows build mode, and names HomeAutomation-Config as the home of the host-specific runs.
  • Adds the 3.24 release-note entries.

Findings that shape later phases

  • No unit flag. The hub's validate-task.yml uploads the .NET unit coverage with no flag, so this repository cannot flag it. Filed as ptr727/ProjectTemplate#3819. Until that lands, unit coverage appears only in the total.
  • The commit SHA is recoverable. A published image's --version prints <version>+<short sha>.
  • Windows needs no special build. The release archive's win-x64 folder is framework-dependent with PlexCleaner.pdb beside the executable, not single-file. dotnet-coverage collect can instrument it as shipped.
  • Early measurement. test.sh over the Matroska test files, run under coverage in the develop image and merged with the unit tests, gives 75.2% locally (ReportGenerator, project sources only, partial lines counted as covered). The image build is one commit behind this branch.

Verification

  • Ran the documented commands verbatim: unit tests under coverage (498 passed), test.sh under dotnet-coverage collect in ptr727/plexcleaner:develop (exit 0, 16 files, 0 errors), and the ReportGenerator merge.
  • codecov.yml validated at codecov.io/validate.
  • Prose gate, markdownlint, cspell, and editorconfig-checker are clean. The commit hook's .NET format check passed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added guidance for measuring and comparing code coverage in local, Docker, and Windows builds, including merging reports and interpreting differences.
    • Updated the version 3.24 release notes to mention coverage measurement.
  • Configuration
    • Added a PlexCleaner settings file with options for media processing, cleanup, and verification, including automatic tool updates and handling for invalid files.

ptr727 and others added 2 commits November 2, 2026 10:27
Phase 2 of the coverage plan: provide what the integration, regression, and
Windows coverage runs consume before any of them exists.

- Pin dotnet-coverage and ReportGenerator in the local tool manifest.
- Add a coverage settings file that turns on every optional processing step.
- Declare the integration, regression, and windows Codecov flags, carrying the
  host-specific ones forward, and strip the image's /Builder source prefix.
- Document the local unit, image, and merge loop in OPERATIONS.md, and how a
  local rate compares with Codecov's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 2, 2026 18:33
@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 49045e78faa4d446b86b23dd12d9c324f9fe5901, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e18ee2d9-f0a7-4e7e-95db-c84aad9d2b69
Commits

Reviewing files that changed from the base of the PR and between 49045e7 and 9a4e4ab.

Files selected for processing: 1
  • OPERATIONS.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The changes add pinned .NET coverage tools, a PlexCleaner coverage settings file, Codecov configuration, and instructions for collecting and merging coverage reports locally, in Docker, and on Windows.

Changes: Coverage measurement and reporting

Layer / File(s) Summary
Coverage tools and Docker settings
.config/dotnet-tools.json, Docker/PlexCleaner.coverage.json
The tool manifest adds pinned dotnet-coverage and ReportGenerator tools. The Docker settings file configures PlexCleaner processing, conversion, and verification options.
Codecov flags and path mapping
codecov.yml
Codecov carryforward is disabled by default and enabled for the regression and windows flags. The configuration also declares the integration flag and adds a /Builder/ fix mapping.
Coverage workflows and release notes
OPERATIONS.md, HISTORY.md, README.md
The operations guide adds local, Docker, report-merging, and Windows coverage instructions. The release notes mention local and Docker coverage measurement.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Coverage as dotnet-coverage
  participant UnitTests as PlexCleanerTests
  participant DockerTest as Docker test.sh
  participant ReportGenerator
  Developer->>Coverage: Run local coverage command
  Coverage->>UnitTests: Collect test coverage
  UnitTests-->>Coverage: Cobertura report
  Developer->>Coverage: Run Docker coverage command
  Coverage->>DockerTest: Collect in-container coverage
  DockerTest-->>Coverage: Coverage report
  Developer->>ReportGenerator: Merge Cobertura reports
  ReportGenerator-->>Developer: Merged report
Loading

Possibly related issues

  • ptr727/PlexCleaner#1171: The pull request implements several Phase 2 coverage requirements described in the issue, including coverage tools, flags, path mapping, settings, and documentation.

Possibly related PRs

Suggested labels: chore

Merge Risk: Low · up to 9a4e4

The coverage instructions can produce an invalid image report when checkout paths contain sed metacharacters. This narrow limitation does not block merging with owner awareness; the existing finding remains unresolved.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: documenting coverage measurement and declaring Codecov flags.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Document coverage measurement and configure future Codecov flags

📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Pin coverage tools and add settings that exercise optional media-processing paths.
• Document how to collect and merge unit and Docker coverage, including Windows guidance.
• Declare future Codecov flags and normalize image source paths for coverage uploads.
Diagram

graph TD
  Settings["Coverage settings"] --> Image["Docker test run"] --> Reports["Cobertura reports"] --> Merge["ReportGenerator merge"]
  Tools["Pinned coverage tools"] --> Image
  Unit["Unit test run"] --> Reports
  Reports --> Codecov["Codecov uploads"]
  Flags["Codecov configuration"] --> Codecov
  Tools --> Merge
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Generate coverage settings from defaults
  • ➕ Avoids maintaining a full copy when default settings change.
  • ➖ Adds generation logic to the measurement workflow and makes the exercised settings less immediately visible.

Recommendation: Keep the explicit coverage settings file: it makes optional paths and reproducible runs easy to inspect without adding a generator. Recheck it against the defaults when processing options change.

Files changed (6) +205 / -0

Documentation (3) +39 / -0
HISTORY.mdRecord coverage guidance in release history +1/-0

Record coverage guidance in release history

• Adds a 3.24 release note for local and Docker coverage measurement and its expanded processing settings.

HISTORY.md

OPERATIONS.mdDocument the coverage collection and comparison workflow +37/-0

Document the coverage collection and comparison workflow

• Provides commands for collecting unit and image coverage, clearing stale reports, rewriting image paths, and merging results. Explains Codecov flag ownership, rate differences, commit matching, and Windows instrumentation.

OPERATIONS.md

README.mdNote coverage documentation in the release summary +1/-0

Note coverage documentation in the release summary

• Adds a brief 3.24 summary entry pointing readers to the new coverage guidance.

README.md

Other (3) +166 / -0
dotnet-tools.jsonPin local coverage and report-generation tools +14/-0

Pin local coverage and report-generation tools

• Adds fixed versions of dotnet-coverage and ReportGenerator for repeatable local coverage collection and merging.

.config/dotnet-tools.json

PlexCleaner.coverage.jsonAdd settings for broad Docker processing coverage +139/-0

Add settings for broad Docker processing coverage

• Adds a default-derived settings file that enables otherwise-disabled processing and verification options for coverage runs.

Docker/PlexCleaner.coverage.json

codecov.ymlDeclare planned coverage flags and image path fix +13/-0

Declare planned coverage flags and image path fix

• Declares integration, regression, and Windows flags; only the sporadic regression and Windows uploads carry forward. Strips the image builder's /Builder/ source prefix from uploaded paths.

codecov.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Coverage instructions fail without jq 🐞 Bug ≡ Correctness
Description
The image-coverage command reads the tool version with jq, but the runbook does not list jq as a
prerequisite. On a host with the declared .NET SDK and Docker but no jq, version lookup fails
before the documented tool mount can be constructed.
Code

OPERATIONS.md[83]

+version="$(jq -r '.tools["dotnet-coverage"].version' .config/dotnet-tools.json)"
Evidence
The new command invokes jq to obtain the version needed by the following find and Docker mount
commands. The repository's host-tool declaration lists only the .NET SDK, and the coverage runbook
gives no jq installation step.

OPERATIONS.md[72-90]
host-tools.json[2-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The image-coverage runbook invokes `jq` on hosts where it is not a documented prerequisite, so the command fails before locating the coverage tool.
## Fix Focus Areas
- OPERATIONS.md[82-90]
## Recommended Fix
Extract the pinned version using an already-required tool, or explicitly document `jq` as a prerequisite before the command block.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread OPERATIONS.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The reviewed coverage tooling, configuration, and documentation changes have no remaining active issues requiring resolution.

No open issues 🎉

What changed in this PR

This pull request adds the tooling, configuration, and documentation needed to measure unit and Docker-based coverage and prepare future Codecov integration, regression, and Windows coverage runs.

Changes:

  • Pins dotnet-coverage and ReportGenerator as local .NET tools.
  • Adds coverage-specific Docker settings and Codecov flags.
  • Documents local, Docker, merged-report, and Windows coverage workflows.
  • Adds the related 3.24 release notes.

Review findings:

  • Moderate ([P2]): Disable automatic updates in the Linux coverage settings to avoid repeated external GitHub API requests.
  • Nit ([P2]): Make the documented sed -i merge command portable across GNU and BSD sed.
File Description
README.md Adds the coverage measurement entry to the 3.24 summary.
OPERATIONS.md Documents unit, Docker, merged-report, and Windows coverage procedures.
HISTORY.md Records the coverage tooling and settings addition under version 3.24.
Docker/​PlexCleaner.coverage.json Enables optional processing and verification paths for coverage runs.
codecov.yml Declares integration, regression, and Windows flags and normalizes Docker source paths.
.config/​dotnet-tools.json Pins the coverage collection and report-generation tools.

Review effort: Lite

@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 9a4e4ab55ca1443f182c48489c138567f97a2476, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Answers to the review findings that opened no thread:

  • Qodo, "Coverage instructions fail without jq": declined. jq is a required fleet host tool. The hub's spec/host-tools.json lists it with "required": true and a 1.7 minimum, so every host this runbook targets already has it. @qodo-free-for-open-source-projects please dismiss finding 1 for this reason.
  • CodeRabbit, "Disable automatic updates in the Linux coverage settings": declined. On Linux, AutoUpdate makes no network request. Tools.CheckForNewTools (PlexCleaner/Tools.cs, the non-Windows branch at the top) logs a warning, sets AutoUpdate to false, and returns before any download or API call. The settings file stays an exact copy of the defaults except for the optional steps it turns on.
  • CodeRabbit, "Make the documented sed -i merge command portable": fixed in 9a4e4ab. The image step now writes image.xml, and a plain sed with a redirect produces image.cobertura.xml from it. That works the same with GNU and BSD sed, and running it again is harmless.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Answers to the review findings that opened no thread:

  • Qodo, "Coverage instructions fail without jq": declined. jq is a required fleet host tool. The hub's spec/host-tools.json lists it with "required": true and a 1.7 minimum, so every host this runbook targets already has it. @qodo-free-for-open-source-projects please dismiss finding 1 for this reason.
  • CodeRabbit, "Disable automatic updates in the Linux coverage settings": declined. On Linux, AutoUpdate makes no network request. Tools.CheckForNewTools (PlexCleaner/Tools.cs, the non-Windows branch at the top) logs a warning, sets AutoUpdate to false, and returns before any download or API call. The settings file stays an exact copy of the defaults except for the optional steps it turns on.
  • CodeRabbit, "Make the documented sed -i merge command portable": fixed in 9a4e4ab. The image step now writes image.xml, and a plain sed with a redirect produces image.cobertura.xml from it. That works the same with GNU and BSD sed, and running it again is harmless.

I can dismiss the Qodo finding titled “Coverage instructions fail without jq” at OPERATIONS.md:83, but its stable finding ID is not available in the current findings catalog. Please confirm that this is the intended finding, or provide its stable ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants