refactor(testing): Increase code coverage threshold from 50% to 80% #9264

Open
opened 2026-04-14 13:15:31 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: refactor(testing): increase coverage threshold from 50% to 80%
  • Branch: refactor/increase-coverage-threshold

Background and Context

The coverage job in .forgejo/workflows/ci.yml contains a "Surface coverage summary" step that enforces a coverage threshold of 50% — a value that was temporarily lowered to work around issues #4183 and #4184 (both now closed):

threshold = 50  # Temporarily lowered; see issues #4183 and #4184

The project's standard coverage requirement (as stated in CONTRIBUTING.md and all milestone acceptance criteria) is ≥ 97%. The 50% threshold provides almost no safety net: new code can be merged with the vast majority of logic untested, increasing the risk of silent regressions.

Since the blocking issues (#4183 and #4184) are closed, the temporary workaround is no longer needed. The threshold should be raised to a meaningful level. An intermediate target of 80% is proposed as a pragmatic step toward the project standard of 97%, allowing the team to close any remaining coverage gaps incrementally without a hard cutover.

Expected Behavior

The coverage job in ci.yml enforces a minimum threshold of 80%. PRs that reduce coverage below 80% fail CI and cannot be merged until coverage is restored.

Acceptance Criteria

  • The threshold variable in the "Surface coverage summary" step of the coverage job in .forgejo/workflows/ci.yml is changed from 50 to 80.
  • The inline comment referencing issues #4183 and #4184 is removed or updated to reflect the new rationale.
  • The nox -s coverage_report step (which already enforces --fail-under 97 via nox) continues to pass without modification.
  • CI passes on master after the change is merged.
  • No other files require changes for this refactor.

Subtasks

  • Update threshold = 50threshold = 80 in .forgejo/workflows/ci.yml (line ~378)
  • Remove or update the # Temporarily lowered; see issues #4183 and #4184 comment
  • Verify the coverage CI job passes locally (or via a draft PR) with the new threshold
  • Run nox (all default sessions) to confirm no regressions
  • Update CHANGELOG with a one-line entry describing the threshold increase
  • Submit PR targeting master, self-approve, and merge

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (refactor(testing): increase coverage threshold from 50% to 80%), followed by a blank line, then additional lines providing relevant implementation details.
  • The commit is pushed to the remote on the branch refactor/increase-coverage-threshold.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • CI passes with the new 80% threshold enforced.

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `refactor(testing): increase coverage threshold from 50% to 80%` - **Branch**: `refactor/increase-coverage-threshold` ## Background and Context The `coverage` job in `.forgejo/workflows/ci.yml` contains a "Surface coverage summary" step that enforces a coverage threshold of **50%** — a value that was temporarily lowered to work around issues #4183 and #4184 (both now closed): ```python threshold = 50 # Temporarily lowered; see issues #4183 and #4184 ``` The project's standard coverage requirement (as stated in `CONTRIBUTING.md` and all milestone acceptance criteria) is **≥ 97%**. The 50% threshold provides almost no safety net: new code can be merged with the vast majority of logic untested, increasing the risk of silent regressions. Since the blocking issues (#4183 and #4184) are closed, the temporary workaround is no longer needed. The threshold should be raised to a meaningful level. An intermediate target of **80%** is proposed as a pragmatic step toward the project standard of 97%, allowing the team to close any remaining coverage gaps incrementally without a hard cutover. ## Expected Behavior The `coverage` job in `ci.yml` enforces a minimum threshold of **80%**. PRs that reduce coverage below 80% fail CI and cannot be merged until coverage is restored. ## Acceptance Criteria - [ ] The `threshold` variable in the "Surface coverage summary" step of the `coverage` job in `.forgejo/workflows/ci.yml` is changed from `50` to `80`. - [ ] The inline comment referencing issues #4183 and #4184 is removed or updated to reflect the new rationale. - [ ] The `nox -s coverage_report` step (which already enforces `--fail-under 97` via nox) continues to pass without modification. - [ ] CI passes on `master` after the change is merged. - [ ] No other files require changes for this refactor. ## Subtasks - [ ] Update `threshold = 50` → `threshold = 80` in `.forgejo/workflows/ci.yml` (line ~378) - [ ] Remove or update the `# Temporarily lowered; see issues #4183 and #4184` comment - [ ] Verify the `coverage` CI job passes locally (or via a draft PR) with the new threshold - [ ] Run `nox` (all default sessions) to confirm no regressions - [ ] Update `CHANGELOG` with a one-line entry describing the threshold increase - [ ] Submit PR targeting `master`, self-approve, and merge ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`refactor(testing): increase coverage threshold from 50% to 80%`), followed by a blank line, then additional lines providing relevant implementation details. - The commit is pushed to the remote on the branch `refactor/increase-coverage-threshold`. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - CI passes with the new 80% threshold enforced. --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.9.0 milestone 2026-04-14 13:52:34 +00:00
Author
Owner

Triage: Verified [AUTO-OWNR-1]

Valid task: The CI coverage threshold is currently 50% (temporarily lowered for issues #4183 and #4184, both now closed). CONTRIBUTING.md and all milestone acceptance criteria require ≥97%. Raising to 80% is a pragmatic intermediate step.

This is a straightforward change with minimal risk — the nox -s coverage_report step already enforces --fail-under 97, so the CI threshold is just a secondary safety net. Raising it from 50% to 80% closes the gap between the CI threshold and the actual project standard.

Assigning to v3.9.0 as this is CI infrastructure work. Priority High — the 50% threshold provides almost no safety net and should be raised immediately.

MoSCoW: Must Have — a 50% coverage threshold is effectively meaningless. The temporary workaround is no longer needed and must be removed.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Triage: Verified** [AUTO-OWNR-1] Valid task: The CI coverage threshold is currently 50% (temporarily lowered for issues #4183 and #4184, both now closed). CONTRIBUTING.md and all milestone acceptance criteria require ≥97%. Raising to 80% is a pragmatic intermediate step. This is a straightforward change with minimal risk — the `nox -s coverage_report` step already enforces `--fail-under 97`, so the CI threshold is just a secondary safety net. Raising it from 50% to 80% closes the gap between the CI threshold and the actual project standard. Assigning to **v3.9.0** as this is CI infrastructure work. Priority **High** — the 50% threshold provides almost no safety net and should be raised immediately. MoSCoW: **Must Have** — a 50% coverage threshold is effectively meaningless. The temporary workaround is no longer needed and must be removed. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#9264
No description provided.