[Feature:RainbowGrades] Warn on manual generation#12645
Conversation
Rkoester47
left a comment
There was a problem hiding this comment.
I tested the changes on this PR and can confirm that when following the steps provided, the warning banner does indeed appear.
One note I have is to make the text a higher contrast on both light and dark mode. Currently, the text color is too similar to the background color and should be darker.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12645 +/- ##
============================================
- Coverage 21.64% 21.46% -0.18%
+ Complexity 9861 9857 -4
============================================
Files 268 268
Lines 36920 36895 -25
Branches 495 495
============================================
- Hits 7990 7919 -71
- Misses 28439 28485 +46
Partials 491 491
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds server-side detection and a UI warning on the Rainbow Grades Customization page when Rainbow Grades output appears to have been generated manually (outside the server workflow), improving instructor troubleshooting (Fixes #11598).
Changes:
- Add server-side timestamp-based detection for likely manual Rainbow Grades generation and pass a boolean flag to the template.
- Render a warning banner (and expose a JS flag) on the customization page when manual generation is detected.
- Update Cypress coverage to assert the banner presence/absence based on the server-provided flag.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| site/app/controllers/admin/ReportController.php | Adds filesystem timestamp scanning and a boolean passed to Twig to detect likely manual generation. |
| site/app/templates/admin/RainbowCustomization.twig | Conditionally displays the warning banner and exposes window.rainbowGradesGeneratedManually. |
| site/public/css/rainbow-customization.css | Styles the manual-generation warning banner. |
| site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js | Adds Cypress assertions for the new banner based on the window flag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Done, you can see the updated image in the description. |
|
@GarvitKhandelwal31 |
|
Please resolve merge conflicts. |
dagemcn
left a comment
There was a problem hiding this comment.
This PR looks good. Functionality works well, the issue mentioned by bmcutler before no longer appears upon testing with a branch new course, this was tested with a fresh recreate sample courses and with a course I had never built or generated grade summaries on before. I was also able to verify the banner only show when the summaries were manually generated and it does not show up when automatically generated. Code also looks good to me.
Why is this Change Important & Necessary?
Fixes #11598.
Instructors currently have no clear indicator of whether Rainbow Grades output was generated automatically on the server or manually outside the server workflow. This makes troubleshooting difficult when output is copied in from a personal machine.
This change adds an explicit warning on the Rainbow Grades Customization page when generated output appears to be manual.
What is the New Behavior?
A warning banner is shown on the Rainbow Grades Customization page when Rainbow output appears manually generated.
Screenshots:
What steps should a reviewer take to reproduce or test the bug or new feature?
Test case A: Banner appears (manual-like output)
vagrant ssh -c "mkdir -p /var/local/submitty/courses/s26/sample/reports/summary_html; echo '<html><body>manual test</body></html>' > /var/local/submitty/courses/s26/sample/reports/summary_html/manual_test_summary.html; rm -f /var/local/submitty/courses/s26/sample/rainbow_grades/Build/course_meta.txt"Test case B: Banner does not appear (automatic-like output)
No warning banner should appear.
Automated Testing & Documentation
Automated testing added: Cypress test updated in Rainbow Grades spec to assert warning banner behavior based on server-provided flag.
Documentation:
Other information