[Bugfix:Autograding] Fix regrade team detection#12737
Conversation
Fixes Submitty#12423 * Replaced the fragile '_' heuristic used to identify team submissions. * The script now checks for the 'team_history' key in user_assignment_settings.json. * Ensures users with underscores (e.g. jane_doe) are not wrongly queued as teams. * Safely defaults to treating missing files as individual submissions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12737 +/- ##
=========================================
Coverage 21.68% 21.68%
Complexity 9778 9778
=========================================
Files 268 268
Lines 36504 36504
Branches 487 487
=========================================
Hits 7915 7915
Misses 28106 28106
Partials 483 483
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
QuackHonk
left a comment
There was a problem hiding this comment.
The code looks good, but I'm having trouble testing it. Is there a dummy account already existing with a hyphen in it? Did you create your own account? If so, how?
You can test this entirely through the UI in your Vagrant:
Look at the output of the queue JSON. Before this PR, it wrongly flagged it as a team. After this PR, it correctly recognizes it as an individual. |
Eli-J-Schwartz
left a comment
There was a problem hiding this comment.
I just tested this, on both an individual and a team submission. On the individual regrade, it correctly detected that the submission was by an individual, even when I submitted with a username that included an underscore _. On a regrade of a team submission, it again correctly detected that the submission was by a team.
* main: (50 commits) [Bugfix:Developer] Fix Broken CI (#12851) [Bugfix:System] Restore TCLAPP (#12850) [Bugfix:Submission] Fix non-VCS repo error (#12608) [Feature:Submission] Jupyter warnings outside notebook (#12523) [Bugfix:InstructorUI] Removed feature flag for Bulk Late Days (#12826) [Bugfix:Forum] Fix stats header rendering (#12698) [Bugfix:Autograding] Fix negative number tolerance (#12569) [Bugfix:HelpQueue] Always use Abbreviated Names in OH (#12820) [Bugfix:Autograding] Fix regrade team detection (#12737) [Dependency] Bump Lichen from v23.09.00 to v26.04.01 (#12823) [Dependency] Bump RainbowGrades from v25.10.00 to v26.04.01 (#12824) [Feature:Developer] Remove misc Java utils and TCLAPP (#12819) [Bugfix:TAGrading] Fix 2-panel open-document select (#12577) [Dependency] Bump AnalysisToolsTS from v23.10.00 to v26.04.00 (#12822) [Bugfix:Developer] Fix bump_repo permissions (#12821) [Bugfix:InstructorUI] Change Colors to match in Docker UI table (#12739) [Bugfix:Forum] Reduce Page Caching (#12339) [Bugfix:System] File lost when running install clean fix (#12158) [Bugfix:Submission] No File Rubric submit all user groups (#12812) [Dependency] Bump twig/markdown-extra from 3.23.0 to 3.24.0 in /site (#12721) ...


Why is this Change Important & Necessary?
Fixes #12423
The
regrade.pyscript used an '_' heuristic to distinguish individual user submissions from team submissions:This incorrectly classifies usernames containing underscores (e.g.
jane_doe) as team submissions, causing them to be incorrectly queued for regrading.What is the New Behavior?
Instead of checking for '_', the fix reads
user_assignment_settings.jsoninside the submission directory and checks for the presence of a"team_history"key.This key is written exclusively by
TeamController.phpwhen a team directory is first created.Individual user directories never contain this key.
If the file is missing, the code safely defaults to treating the submitter as an individual user.
What steps should a reviewer take to reproduce or test the bug or new feature?
student_user)is_teamwill betrueanduserwill be""is_teamwill befalseanduserwill be"student_user"Automated Testing & Documentation
No automated tests currently exist for
regrade.py. A follow-up issue should be created to add unit tests for this script.Other information