[Django] #36620: Automate test coverage check on pull requests

24 views
Skip to first unread message

Django

unread,
Sep 25, 2025, 1:01:34 PMSep 25
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Type:
| Cleanup/optimization
Status: new | Component: Core
| (Other)
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
We could automate a significant part of checking test coverage on pull
requests. Instead of using a cloud service, there's an implementation
using `diff-cover` in a PR.

[https://github.com/django/django/pull/19777 PR]

[https://forum.djangoproject.com/t/rfc-prioritizing-tasks-for-automate-
processes-within-django-contribution-workflow-gsoc-2025/41960 Forum post]
--
Ticket URL: <https://code.djangoproject.com/ticket/36620>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 25, 2025, 1:01:52 PMSep 25
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* owner: (none) => Saurabh
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:1>

Django

unread,
Sep 25, 2025, 1:17:33 PMSep 25
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

I think the last time this was attempted the efforts stalled due the
difficulty of combining coverage reports from different suite runs. Some
part of the code is only covered by tests run on Postgres or a particular
Python version for example so there needs to be a coordinated job that
collects all of the `.coverage` artifacts and
[https://coverage.readthedocs.io/en/7.10.7/commands/cmd_combine.html then
combine them] otherwise the resulting coverage report will be lacking or
improperly reporting that some areas are not covered (e.g. if we only use
the SQLite test run and Postgres only changes are introduced).
--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:2>

Django

unread,
Sep 25, 2025, 2:02:35 PMSep 25
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

(The linked implementation just treats that complexity as outside of MVP
and makes this caveat explicit in the posted comment.)
--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:3>

Django

unread,
Sep 29, 2025, 3:03:50 AMSep 29
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
--------------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Sarah Boyce):

* stage: Unreviewed => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:4>

Django

unread,
Sep 30, 2025, 4:22:03 AMSep 30
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
--------------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1
* needs_docs: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:5>

Django

unread,
Nov 20, 2025, 4:00:23 PMNov 20
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:6>

Django

unread,
Nov 21, 2025, 3:14:14 PMNov 21
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
--------------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:7>

Django

unread,
Nov 21, 2025, 4:23:42 PMNov 21
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:8>

Django

unread,
Nov 21, 2025, 4:27:09 PMNov 21
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"a89183e63844a937aacd3ddb73c4952ef869d2cc" a89183e6]:
{{{#!CommitTicketReference repository=""
revision="a89183e63844a937aacd3ddb73c4952ef869d2cc"
Fixed #36620 -- Added coverage workflow to summarize coverage in pull
requests.

Part of GSoC 2025. Thanks Lily for mentorship, and Sarah Boyce and
Jacob Walls for reviews.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:9>

Django

unread,
Nov 25, 2025, 5:17:11 PM (10 days ago) Nov 25
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"e4c4a178aa642f8493b7ae2c0ad58527af51f67e" e4c4a17]:
{{{#!CommitTicketReference repository=""
revision="e4c4a178aa642f8493b7ae2c0ad58527af51f67e"
Reverted "Fixed #36620 -- Added coverage workflow to summarize coverage in
pull requests."

This reverts commit a89183e63844a937aacd3ddb73c4952ef869d2cc.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:10>

Django

unread,
Nov 25, 2025, 5:24:27 PM (10 days ago) Nov 25
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
--------------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1
* resolution: fixed =>
* stage: Ready for checkin => Accepted
* status: closed => new

Comment:

Revision is being progressed here:
https://github.com/django/django/pull/20302
--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:11>

Django

unread,
Dec 4, 2025, 10:25:32 AM (yesterday) Dec 4
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
--------------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: Cleanup/optimization | Status: closed
Component: Core (Other) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by GitHub <noreply@…>):

* resolution: => fixed
* status: new => closed

Comment:

In [changeset:"26b0e2bb92caf2d16cabe455792350f20d6f42ca" 26b0e2bb]:
{{{#!CommitTicketReference repository=""
revision="26b0e2bb92caf2d16cabe455792350f20d6f42ca"
Fixed #36620 -- Fixed workflow to summarize coverage in PRs.

Follow-up to a89183e63844a937aacd3ddb73c4952ef869d2cc, which was
reverted in e4c4a178aa642f8493b7ae2c0ad58527af51f67e because a change
to the workflow trigger resulted in the PR branch not being checked out.

We used this opportunity to reimplement the coverage tracing and coverage
commenting in a two-workflow pattern with more granular permissions.

To reduce duplicative workflows, we removed the existing python test
workflow
on PRs, at least until we run more distinct configurations on GitHub
actions. The
run with coverage tracing enabled is sufficient for now. The existing
workflow still
runs on pushes to main. We can revisit when adding more test
configurations.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:12>

Django

unread,
Dec 4, 2025, 10:26:01 AM (yesterday) Dec 4
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:13>

Django

unread,
10:11 AM (9 hours ago) 10:11 AM
to django-...@googlegroups.com
#36620: Automate test coverage check on pull requests
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Saurabh
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by GitHub <noreply@…>):

In [changeset:"1dfd5aa2b5beb2d5354527eae4f2589b828ac06c" 1dfd5aa]:
{{{#!CommitTicketReference repository=""
revision="1dfd5aa2b5beb2d5354527eae4f2589b828ac06c"
Refs #36620 -- Removed PR number null check from coverage_comment
workflow.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36620#comment:14>
Reply all
Reply to author
Forward
0 new messages