Skip to content

[Feature:RainbowGrades] Warn on manual generation#12645

Merged
bmcutler merged 10 commits into
Submitty:mainfrom
GarvitKhandelwal31:rainbow-grades-clean
Jun 19, 2026
Merged

[Feature:RainbowGrades] Warn on manual generation#12645
bmcutler merged 10 commits into
Submitty:mainfrom
GarvitKhandelwal31:rainbow-grades-clean

Conversation

@GarvitKhandelwal31

@GarvitKhandelwal31 GarvitKhandelwal31 commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Banner hidden case: image
  2. Banner visible case: image

What steps should a reviewer take to reproduce or test the bug or new feature?

Test case A: Banner appears (manual-like output)

  1. Run in host terminal:
    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"
  2. Refresh the customization page.
  3. Expected:
    • Warning banner is visible.

Test case B: Banner does not appear (automatic-like output)

  1. Click generate grade summaries and wait for it to finish.
    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:

  1. No new submitty.org documentation PR included in this change.
  2. Existing automatic/manual Rainbow Grades docs are linked directly from the warning banner for immediate troubleshooting context.

Other information

  1. Breaking change: No.
  2. Migrations required: No.
  3. Security concerns: None identified.

@github-actions github-actions Bot added the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label Apr 11, 2026

@Rkoester47 Rkoester47 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Apr 30, 2026
Copilot AI review requested due to automatic review settings May 1, 2026 10:26
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development May 1, 2026
@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.22222% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.46%. Comparing base (719b0c7) to head (461a898).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             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              
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.01% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.49% <2.22%> (-0.22%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread site/app/templates/admin/RainbowCustomization.twig Outdated
Comment thread site/cypress/e2e/Cypress-Gradeable/rainbow_grading.spec.js
Comment thread site/app/controllers/admin/ReportController.php
Comment thread site/app/controllers/admin/ReportController.php
@GarvitKhandelwal31
GarvitKhandelwal31 marked this pull request as draft May 1, 2026 10:31
@automateprojectmangement automateprojectmangement Bot moved this from In Review to Work in Progress in Submitty Development May 1, 2026
@GarvitKhandelwal31
GarvitKhandelwal31 marked this pull request as ready for review May 1, 2026 11:39
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to Seeking Reviewer in Submitty Development May 1, 2026
@GarvitKhandelwal31

Copy link
Copy Markdown
Contributor Author

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.

Done, you can see the updated image in the description.

@GarvitKhandelwal31 GarvitKhandelwal31 removed the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label May 19, 2026
@bmcutler

bmcutler commented Jun 2, 2026

Copy link
Copy Markdown
Member

@GarvitKhandelwal31
I not very familiar with the use of the console and may have done something wrong. But I was seeing the message before RainbowGrades had even been run, which shouldn't happen. I'm going to start again from scratch after recreate sample courses and see if its a problem with a brand new course.

https://submitty.org/developer/development_instructions/index#re-creating-all-sample-course-data

@dagemcn

dagemcn commented Jun 18, 2026

Copy link
Copy Markdown
Member

Please resolve merge conflicts.

@dagemcn dagemcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bmcutler
bmcutler merged commit 1232437 into Submitty:main Jun 19, 2026
17 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add warning when Rainbow Grades generated externally

5 participants