From 05e03d4e02f199e6f0ce2d5d5061a0e14ccc4889 Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Mon, 7 Sep 2026 16:14:16 +0100 Subject: [PATCH 1/3] Add blocks project seed for seeding --- lib/tasks/README.md | 38 +++++++++++++++++- .../hello_world_starter/project_config.yml | 2 +- .../neil-the-seal-starter.sb3 | Bin 0 -> 4341 bytes .../neil-the-seal-starter/project_config.yml | 3 ++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 lib/tasks/project_components/neil-the-seal-starter/neil-the-seal-starter.sb3 create mode 100644 lib/tasks/project_components/neil-the-seal-starter/project_config.yml diff --git a/lib/tasks/README.md b/lib/tasks/README.md index c24d751c0..48c9d97d7 100644 --- a/lib/tasks/README.md +++ b/lib/tasks/README.md @@ -15,7 +15,7 @@ Each directory for a `project` should contain copies of the `python` files and a Every directory representing a `project` must contain a `project_config.yml`. This should include the following information: - `NAME` - the name of the project to be displayed in the header bar on the editor site -- `IDENTIFIER` - a unique list of three words separated by dashes `-`. This will form the end of the URL for the `project` on the editor site. For example, a `project` with `IDENTIFIER` `python-emoji-example` will be available to view at `/projects/python-emoji-example` once the `project` has been entered into the database. +- `IDENTIFIER` - words separated by dashes `-`, conventionally three, though the format is not enforced and some existing `project`s use more (for example `editor-scratch-testing-starter`). It must be unique per locale. This will form the end of the URL for the `project` on the editor site. For example, a `project` with `IDENTIFIER` `python-emoji-example` will be available to view at `/projects/python-emoji-example` once the `project` has been entered into the database. Where a `project` also exists in production, use the same `IDENTIFIER` as production so the local and deployed data match. - `COMPONENTS` - a list of the non-image files associated with the project. There should be exactly one `main.py` per `project`. The entry corresponding to each file should include the following information: - `name` - name of the file without the extension - `extension` - file extension (without the `.`) @@ -26,6 +26,42 @@ Every directory representing a `project` must contain a `project_config.yml`. Th An example `project_config.yml` with all of the above properties can be seen [here](https://github.com/RaspberryPiFoundation/editor-api/blob/main/lib/tasks/project_components/persuasive_data_presentation_iss_starter/project_config.yml). +## Scratch (Blocks) projects + +Scratch `project`s work differently and need much less configuration. The directory should contain **exactly two files**: the `.sb3` and a `project_config.yml` with three keys. + +```yaml +NAME: "Neil the Seal starter" +IDENTIFIER: "neil-the-seal-starter" +TYPE: "code_editor_scratch" +``` + +Notes: + +- Omit `COMPONENTS` and `IMAGES`. The importer discovers the `.sb3` by file extension, and the `.sb3` already contains all of the project's costumes and sounds — they are extracted into shared Scratch assets automatically. +- `TYPE` must be exactly `code_editor_scratch`. Do not use `scratch`, which is reserved for Experience CS projects and is deliberately excluded from the Scratch API endpoints. +- The `.sb3` filename is not significant, but `main.sb3` matches the convention used elsewhere in this directory. +- Keep the directory to just those two files. Any extra file must still be a type the importer recognises, and a stray file such as `.DS_Store` will fail the whole import run rather than just this `project`. + +### ⚠️ Do not copy `project_config.yml` from a content repository + +Content repositories in `raspberrypilearning` also contain a `project_config.yml` next to their `.sb3`, but it is a **different format**, read by a different code path (the GitHub webhook and `UploadJob`). It uses **lowercase** keys and an extra `build` key: + +```yaml +name: "Neil the Seal starter" +identifier: "neil-the-seal-starter" +type: 'code_editor_scratch' +build: true +``` + +The seeding task in this directory reads **uppercase** keys only. Copying the content-repo version verbatim parses without error and silently produces a `python` `project` with no name, so retype it in the uppercase form above and drop `build`. + +The `.sb3` itself can be copied straight across. For Neil the Seal it came from [`raspberrypilearning/editor-neil-the-seal`](https://github.com/raspberrypilearning/editor-neil-the-seal) at `en/code/neil-the-seal-starter/neil-the-seal-starter.sb3`. + +### Making a Scratch project reachable from the Code Club Projects site + +projects-ui only opens the editor when the projects-admin record for a 'project' has `direct_to_editor` set and `editor_starter_project` pointing at the `IDENTIFIER` used here. For local development that link is seeded in projects-admin at `db/seeds/006_editor_blocks_projects.rb`. If you add a Scratch `project` here that needs to be reachable through the projects site, it needs a matching entry there. + ## Getting the projects created in the database Please commit the required changes to a branch in the [`editor-api` repository](https://github.com/RaspberryPiFoundation/editor-api/) and create a pull request to merge your branch into `main`. Once merged, we will run the task to create your `project`s in the database. diff --git a/lib/tasks/project_components/hello_world_starter/project_config.yml b/lib/tasks/project_components/hello_world_starter/project_config.yml index 606cbd5a1..bbc423e4a 100644 --- a/lib/tasks/project_components/hello_world_starter/project_config.yml +++ b/lib/tasks/project_components/hello_world_starter/project_config.yml @@ -1,5 +1,5 @@ NAME: "Hello 🌍🌎🌏" -IDENTIFIER: "hello-world-starter" +IDENTIFIER: "editor-hello-world-starter" COMPONENTS: - name: "main" extension: "py" diff --git a/lib/tasks/project_components/neil-the-seal-starter/neil-the-seal-starter.sb3 b/lib/tasks/project_components/neil-the-seal-starter/neil-the-seal-starter.sb3 new file mode 100644 index 0000000000000000000000000000000000000000..93cfbcc3a3bc0ece603ebcc5f2023cc3fe33927b GIT binary patch literal 4341 zcma)A2T)UMw~cfJse&|>t~5y_MNp6?5PC0)CL~m;QWS*CrT1P11Oo&vO`3p!0R#d_ z7b!{y0TpQ?O#}S#{qK!eX5NhF%$YOi%zSIUy=Jeq_x|)z)HJ67000AE2lw$-lGZ@I z1T_Fq#smN`Q~tVnxH{r&Jg+$3cXfH0hKiqrv30dXwW6$A$G!>~Cf#49lAwZ~VcQT= z8*bMqXjT;+7IYZT>I~RpIkeAyW!=PTel9UzQLg>KLH&_9JNZ?Il5NX1PX1+f?yx@m zolHhvbSvoHJ8|rp8RZfFx7S;=HC$DuSot@U>NmY+ns&DXrW(<}#d*!9uNUn0u5_6A zB6Wh+9-M2NSqlDPqZ%I@OD(PVc<#GNt&1oGCd4P)>=h6g@v71~k3|`{l|y>r@=%6< zI#u7Zj1VRl=Ka{G&|Wm#y|065JZ<-Z#**+L%)jO8kW( z4}l_)8E+OF;|kQW_UD#SHt)M~(YMO#K9WpkTeRcMy@$e|0sjKkwaE0|&9gf`O~8ab zH|f+d$W)dP5p(`br`jv^l<7(w+WO6tV2hz!2F<72Mq+!6?3YHRal%~Ew!8YO{7^g> zNSCwgZi~Q}!>UeGuWAnA0yon{#gvFV4LDw}N6UAl^Pl?YE)8oTGP@!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^d%Z}4EXWH{9Ap^Y@DA-?mdSzFshZ%;{f^W2Lf-br>w3NqiPizNg%5OWdHB-_2Tn z$grh2v)|dr&1}KoE1_~Bv>;KggjqAuH0Z);3#juruJF$10Ko73AX80emMPp+(f&6- zfKVU?VG9S@0$~_17KX-xacCr*(mX-r&>$Nu=4XEN8xK>ur?ZD#y{QD9S8mS0xw7^4 zCvbZVg!FHn-fKO;?a!#lzxwzW4F3N%~$_~)uiD;N(e~R4R4i79#F~UCEeV-(jvftIT z5#HtxT{Oe_+I?TH@qN3SGKKIPQUsOgjI;ZFtnD})Qgo2N3%x3@V82j0X7xOM|7dQ? zWOwrJqiAoEgWo{7i5>Yv7X6B6A<5LD^nw`i^%<{gj;v?8yVL^g;yw^Z{MEcw3gN|j zPfS*F)>54e#J0|<*F>a!Qhg1}dR=6+#WDNA^I^aUy~uazI`5o?4@jc{>*z>dLXc~u zA~0b~m`ZixdnNR;Et2icP=Pj=|PmKjk-;XmouPa>Xdihd!2=>UK~X^~DMo~$ar5LFoe ztj3%~Jn6i@5Zx)Hg8smVPa>Z5vVS2`juSwC;A|%mPpbbHVj|^q;!nIlA4N-H8~~uF O+~Smq{DS4@*M9&!(SFGQ literal 0 HcmV?d00001 diff --git a/lib/tasks/project_components/neil-the-seal-starter/project_config.yml b/lib/tasks/project_components/neil-the-seal-starter/project_config.yml new file mode 100644 index 000000000..b70eb4f9f --- /dev/null +++ b/lib/tasks/project_components/neil-the-seal-starter/project_config.yml @@ -0,0 +1,3 @@ +NAME: "Neil the Seal starter" +IDENTIFIER: "neil-the-seal-starter" +TYPE: "code_editor_scratch" From 4db7277fe6ae3397fce75a4097f55756b2f9f55d Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Mon, 7 Sep 2026 16:33:32 +0100 Subject: [PATCH 2/3] Update README with seeding task clarification Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- lib/tasks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/README.md b/lib/tasks/README.md index 48c9d97d7..b18414edb 100644 --- a/lib/tasks/README.md +++ b/lib/tasks/README.md @@ -54,7 +54,7 @@ type: 'code_editor_scratch' build: true ``` -The seeding task in this directory reads **uppercase** keys only. Copying the content-repo version verbatim parses without error and silently produces a `python` `project` with no name, so retype it in the uppercase form above and drop `build`. +The seeding task in this directory reads **uppercase** keys only. Copying the content-repo version verbatim parses without error, but leaves `NAME`/`IDENTIFIER` unset (and defaults `TYPE` to `python`), so the import will fail validation — retype it in the uppercase form above and drop `build`. The `.sb3` itself can be copied straight across. For Neil the Seal it came from [`raspberrypilearning/editor-neil-the-seal`](https://github.com/raspberrypilearning/editor-neil-the-seal) at `en/code/neil-the-seal-starter/neil-the-seal-starter.sb3`. From 0aaceead71d981e22c135816c53161f9af4292e4 Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Mon, 7 Sep 2026 16:34:04 +0100 Subject: [PATCH 3/3] Update README with clearer local development instructions Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- lib/tasks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/README.md b/lib/tasks/README.md index b18414edb..3ce0e24b6 100644 --- a/lib/tasks/README.md +++ b/lib/tasks/README.md @@ -60,7 +60,7 @@ The `.sb3` itself can be copied straight across. For Neil the Seal it came from ### Making a Scratch project reachable from the Code Club Projects site -projects-ui only opens the editor when the projects-admin record for a 'project' has `direct_to_editor` set and `editor_starter_project` pointing at the `IDENTIFIER` used here. For local development that link is seeded in projects-admin at `db/seeds/006_editor_blocks_projects.rb`. If you add a Scratch `project` here that needs to be reachable through the projects site, it needs a matching entry there. +projects-ui only opens the editor when the projects-admin record for a 'project' has `direct_to_editor` set and `editor_starter_project` pointing at the `IDENTIFIER` used here. For local development that link is seeded in the projects-admin repository at `db/seeds/006_editor_blocks_projects.rb`. If you add a Scratch `project` here that needs to be reachable through the projects site, it needs a matching entry there. ## Getting the projects created in the database Please commit the required changes to a branch in the [`editor-api` repository](https://github.com/RaspberryPiFoundation/editor-api/) and create a pull request to merge your branch into `main`. Once merged, we will run the task to create your `project`s in the database.