Repository navigation
Separate report rows from report metrics - #8249
Merged
Merged
Conversation
donnapep
force-pushed
the
update/hpps-report-rows-metrics
branch
from
September 11, 2026 16:47
711136e to
6869c3c
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Preserve translation and legacy filter semantics before approval, and strengthen bulk metric assertions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR separates report-row retrieval from lesson metric aggregation, adding bulk status and grade calculations for comments and HPPS storage.
Changes:
- Adds bulk lesson status and average-grade service APIs and implementations.
- Loads metrics once per displayed lesson page.
- Removes migrated Reports Listing methods and updates tests.
File summaries
| File | Reviewed changes |
|---|---|
tests/unit-tests/test-class-sensei-analysis-course-list-table.php |
Tests bulk metric loading; coverage should assert distinct per-lesson values, including tables-backed behavior (Nit, 2 votes). |
tests/unit-tests/internal/services/test-class-tables-based-reports-listing-service.php |
Removes obsolete metric tests. |
tests/unit-tests/internal/services/test-class-tables-based-progress-aggregation-service.php |
Tests HPPS bulk status aggregation. |
tests/unit-tests/internal/services/test-class-tables-based-grading-stats-service.php |
Tests HPPS bulk grade aggregation. |
tests/unit-tests/internal/services/test-class-comments-based-reports-listing-service.php |
Removes obsolete metric tests. |
tests/unit-tests/internal/services/test-class-comments-based-progress-aggregation-service.php |
Tests comments-backed bulk status aggregation. |
tests/unit-tests/internal/services/test-class-comments-based-grading-stats-service.php |
Tests comments-backed bulk grade aggregation. |
includes/internal/services/class-tables-based-reports-listing-service.php |
Removes migrated metric methods while retaining row retrieval. |
includes/internal/services/class-tables-based-progress-aggregation-service.php |
Implements HPPS bulk status aggregation. |
includes/internal/services/class-tables-based-grading-stats-service.php |
Implements HPPS bulk grade aggregation. |
includes/internal/services/class-reports-listing-service-interface.php |
Removes migrated metric contracts. |
includes/internal/services/class-progress-aggregation-service-interface.php |
Adds bulk lesson status contract. |
includes/internal/services/class-grading-stats-service-interface.php |
Adds bulk lesson grade contract. |
includes/internal/services/class-comments-based-reports-listing-service.php |
Removes migrated metric methods while retaining row retrieval. |
includes/internal/services/class-comments-based-progress-aggregation-service.php |
Implements comments-backed bulk status aggregation. |
includes/internal/services/class-comments-based-grading-stats-service.php |
Implements comments-backed bulk grade aggregation. |
includes/class-sensei-analysis-course-list-table.php |
Integrates bulk metrics. Moderate findings: preserve WPML ID translation/filter behavior (3 votes), preserve grade filter status and meta_key semantics (3 votes), and preserve HPPS learner-filter semantics (1 vote). |
Review details
Suppressed comments (1)
includes/class-sensei-analysis-course-list-table.php:851
- This fallback changes the HPPS behavior of the legacy
sensei_analysis_lesson_learnersfilter. The removedTables_Based_Reports_Listing_Service::get_lesson_student_count()filtered directly on the lesson row'sp.status, whilecount_statuses()uses the quiz-effectiveCOALESCE(q.status, p.status). A filter requestingcompleteorin-progresscan therefore return a different count for lessons with quiz progress; preserve the backend-specific legacy semantics when handling filtered arguments.
private function get_filtered_lesson_status_count( array $args ): int {
- Files reviewed: 17/17 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
donnapep
force-pushed
the
update/hpps-report-rows-metrics
branch
from
September 11, 2026 17:21
6869c3c to
898e534
Compare
donnapep
force-pushed
the
update/hpps-report-rows-metrics
branch
from
September 14, 2026 14:40
bb5a580 to
4c24c96
Compare
donnapep
force-pushed
the
update/hpps-report-rows-metrics
branch
from
September 14, 2026 15:44
4c24c96 to
0c9618c
Compare
8 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Reports_Listing_Service_Interfacemixed two responsibilities: returning report rows and calculating lesson metrics. This change keeps report rows in Reports Listing while progress and grade metrics come from their dedicated services.Proposed Changes
Sensei_Utils::sensei_check_for_activity()count implementation and the HPPS backend's existing SQL implementation.Testing Instructions
git diff --check: clean.Changelog entry
Changelog Entry Details
Significance
Type
Message
Refactored course report lesson metrics into dedicated progress aggregation and grading statistics services.