Seed preview projects for local/preview work - #964
Open
DNR500 wants to merge 4 commits into
Open
Conversation
Add an unowned Blocks template to test seeds so local and preview work can load Scratch content without auth.
Add an fr-FR row for excs-preview-starter so locale-aware preview loads can return translated name and instructions instead of falling back to English.
Test coverage92.3% line coverage reported by SimpleCov. |
Move the public Scratch preview seed helpers out of SeedsHelper so RuboCop Metrics/ModuleLength stays under the limit.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a public (unowned) Scratch/Blocks “preview starter” template into the test seeding flow so classroom preview routes can load a stable project from editor-api without authentication, including a French locale variant to validate locale-aware loading.
Changes:
- Introduces
ProjectPreviewSeedsHelperto upsert/destroy an unownedcode_editor_scratchtemplate (excs-preview-starter) with seeded Scratch JSON and instruction steps (EN + FR). - Wires preview project create/destroy into
test_seeds:createandtest_seeds:destroy. - Extends
spec/lib/test_seeds_spec.rbto cover creation, destruction, and instruction updates, including thefr-FRrow.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/lib/test_seeds_spec.rb | Adds specs asserting the preview template is created (EN/FR), updated, and removed via test seed tasks. |
| lib/tasks/test_seeds.rake | Hooks preview template lifecycle into the test reseed rake tasks. |
| lib/tasks/seeds_helper.rb | Pulls preview seeding helpers/constants into the existing seeding helper module. |
| lib/tasks/project_preview_seeds_helper.rb | Implements upsert/destroy logic for the public Scratch preview template and reads seed JSON from disk. |
| lib/tasks/seed_data/excs_preview_starter.json | Adds seeded Scratch project JSON payload for the preview template. |
| lib/tasks/seed_data/excs_preview_starter_instructions.json | Adds English instruction steps for the preview template. |
| lib/tasks/seed_data/excs_preview_starter_instructions_fr.json | Adds French instruction steps for the preview template. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
DNR500
marked this pull request as ready for review
August 13, 2026 18:47
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.
Arises from issue: 1653
Summary
Adds unowned Blocks (
code_editor_scratch) templates to test seeds so Experience CS project previews can be loaded from editor-api without auth (and without waiting on ExCS content sync).Pairs with the classroom preview route work in editor-standalone - see this editor-standalone PR.
excs-preview-starteras a public Scratch template (user_id/school_idnil) with real Scratch JSON and instruction stepsfr-FRwith a French name and instructions, so locale-awareProjectLoaderrequests return translated project content instead of falling back to Englishtest_seeds:create/test_seeds:destroy(and thus/test/reseed)spec/lib/test_seeds_spec.rbWhy
#1653 needs a stable public Blocks project that classroom can open at a preview URL while logged out. Production templates will come from ExCS sync later; this seed unblocks local and PR testing.
How to try it
English and French project metadata should differ; Scratch content is shared.
Note: if the API process has been up a long time, restart it (or run
rake test_seeds:createin a freshdocker compose exec) so reseed picks up the new rake task code.