Javalab: Disallow user file names that are the same as validation file names #45569
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 change has Javalab always send the validation file names if they exist so that we can prevent naming collisions. The logic in Javalab was already in place, but previously we were only sending validation in start mode.
Note: one thing here - levels_controller sets validation in the level view options, which seems to guarantee that the validation field in the level config has the actual validation code and not just the file names. However, I'm not 100% if this is always guaranteed. From my testing, it seemed to be consistent, but let me know if there's a safer way to ensure that we're not overwriting the validation code in start mode with just the file names.
JIRA: https://codedotorg.atlassian.net/browse/JAVA-507
Links
Testing story
Tested on Javalab All The Things 12 - ensured that in both standard mode and start mode I couldn't create or rename files to be the same as existing validation files.
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: