Muesli: PR 10.2 - Performance services#1064
Open
fosterfarrell9 wants to merge 17 commits intomuesli/performance-foundationsfrom
Open
Muesli: PR 10.2 - Performance services#1064fosterfarrell9 wants to merge 17 commits intomuesli/performance-foundationsfrom
fosterfarrell9 wants to merge 17 commits intomuesli/performance-foundationsfrom
Conversation
…hema for performance records
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements backend services for student performance computation in the Muesli integration. It introduces a computation service to aggregate assessment points, an evaluator for rule-based performance checks, and background jobs to update records and identify stale certifications.
Changes:
- Adds
ComputationServiceto compute and materialize student performance metrics per user - Adds
Evaluatorto evaluate performance records against rules (percentage/absolute points, achievements) - Adds two background jobs:
PerformanceRecordUpdateJobfor computing records andCertificationStaleCheckJobfor detecting outdated certifications - Extends performance records with assessment count fields (total, reviewed, pending, exempt)
- Adds
.stalescope to Certification model to identify certifications older than their corresponding records
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| app/models/student_performance/computation_service.rb | Service to aggregate points and assessment counts, materialize performance records via upsert |
| app/models/student_performance/evaluator.rb | Evaluates performance records against rules, returns pass/fail proposals with details |
| app/workers/performance_record_update_job.rb | Sidekiq job to compute records for one user or all lecture members |
| app/workers/certification_stale_check_job.rb | Recomputes records and logs stale certifications |
| app/models/student_performance/certification.rb | Adds .stale scope using SQL join to find certifications older than records |
| db/migrate/20260226000001_add_assessment_counts_to_performance_records.rb | Adds four integer count fields to performance records table |
| db/schema.rb | Schema version update reflecting new columns |
| spec/factories/student_performance_records.rb | Updates factory with default values for new count fields |
| spec/models/student_performance/computation_service_spec.rb | Comprehensive tests for aggregation, upserts, counts, exempt/pending logic |
| spec/models/student_performance/evaluator_spec.rb | Tests for percentage/absolute/achievement rules, bulk evaluation |
| spec/workers/performance_record_update_job_spec.rb | Tests for single-user and full-lecture computation |
| spec/workers/certification_stale_check_job_spec.rb | Tests for staleness detection and logging |
| spec/models/student_performance/certification_spec.rb | Tests for .stale scope edge cases |
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.
This PR adds the Step 10.2 backend for Student Performance computation. It
ComputationServiceto aggregate assessment points and materialize per-user performance recordsEvaluatorfor rule-based performance checkstotal/reviewed/pending/exempt)