Java Lab2: fix start images seeding bug#73448
Open
molly-moen wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Java Lab (Lab2) start-mode regression in dashboard/levelbuilder where legacy starter_assets could silently re-seed after a levelbuilder removed all assets, by clearing the legacy mapping when saving Lab2 Java Lab start code.
Changes:
- Add
Javalab#clear_lab2_starter_assetsto drop legacystarter_assetsforuses_lab2Java Lab levels. - Invoke that clearing during
LevelsController#update_start_code. - Add controller tests for Lab2 vs legacy Java Lab behavior; update the affected Theater Lab2 level file and Lab2 README to reflect the new behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dashboard/test/controllers/levels_controller_test.rb | Adds coverage ensuring Lab2 Java Lab start-code saves clear starter_assets, while legacy Java Lab preserves them. |
| dashboard/config/levels/custom/javalab/Allthethings Java Lab2 Theater.level | Removes legacy starter_assets mapping from this Lab2 Theater level and represents the starter asset via start_sources URL. |
| dashboard/app/models/levels/javalab.rb | Introduces clear_lab2_starter_assets to nil out the legacy mapping for Lab2 levels. |
| dashboard/app/controllers/levels_controller.rb | Calls the new Javalab helper during update_start_code to prevent legacy reseeding. |
| apps/src/javalab/lab2/README.md | Updates documentation to note that start-code saves drop the legacy starter_assets mapping in Lab2. |
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.
Previously, in start mode only, if a level was migrated from legacy to lab2, if a levelbuilder edited the start code
and deleted all the assets they would re-populate from the legacy starter_assets field, because we would always pull in those assets if there were no assets in the project. This updates the start code save logic to delete the starter_assets if we are saving lab2 Java Lab code, as that code will always put the starter assets in the code blob itself.
Testing story
Tested locally--you can see the results in the Theater level where the starter_assets are now gone from the separate field, and are only in the code (previously this level had not been edited from the legacy shape).