Repository navigation
Conversation
Naragod
force-pushed
the
TICKET-658_safe_path_flag
branch
from
December 4, 2026 19:10
2bcd281 to
a1d10fc
Compare
Coverage Report for CI Build 47405455670Coverage decreased (-0.001%) to 99.295%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
donny-wong
approved these changes
Dec 4, 2026
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.
Description
Purpose
The autotester (the server that runs instructor tests on student work) guards itself from student files. A student file named like a Python module could take the place of that module. Since the last release, the guard also reaches scripts that instructor tests start. Those scripts fail to find files in their own folder, so the tests break. This change keeps the guard on the autotester and lifts it from those scripts.
Example
What happened
In production, the last autotester release broke tests that start their own scripts. The release reached all four production servers we update, between Nov 30 and Dec 3. On Dec 4, an instructor reported that nearly all of their test scripts failed. The release notes left the change out. Instructors learned of it from their broken tests.
Why it happens
Pull request #761 added the guard. The guard is a setting that a program hands down to every program it starts. The autotester hands it to the test. The test hands it to each script it starts. A script with the setting fails to look in its own folder for files.
The fix
Implementation
SAFE_PATH_ENV._run_test_specsstops addingPYTHONSAFEPATH=1to each tester's env.-Pto the tester command in_create_test_script_command.-Pto theai_feedbackcommand inAiTester.call_ai_feedback.Testing
test_script_run_by_a_test_imports_its_neighbourruns a script with each tester's env. The script imports a file from its own folder.No module named 'helper'.test_uploaded_file_cannot_shadow_stdlib_modulenow runs withPYTHONSAFEPATHremoved from the env. It checks that-Palone guards the tester.test_student_module_importable_only_by_python_testersruns the same way. It checks that thepyandjupytertesters still load student modules.test_ai_feedback_runs_with_safe_pathchecks thatai_feedbackstarts with-P.test_tmp_remove_other_user.test_tmp_remove_other_userrequires thefake_useraccount that CI creates. It fails onmasterlocally too.