Skip to content

Allow Scratch projects to be created by ExCS clients - #1009

Open
zetter-rpf wants to merge 1 commit into
mainfrom
dont-restrict-creation-of-scratch-projects
Open

Allow Scratch projects to be created by ExCS clients#1009
zetter-rpf wants to merge 1 commit into
mainfrom
dont-restrict-creation-of-scratch-projects

Conversation

@zetter-rpf

@zetter-rpf zetter-rpf commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Status

What's changed?

Currently if a school doesn't have the blocks editor enabled they are unable to add migrated ExCS projects.
This cuahge allows any client to create scratch projects, even if the School does not have Scratch enabled.

  • Schools without this enabled still won't see the button to add Scratch projects.
  • Even if we did restrict it to ExCS projects in some way, clients could add those projects and then edit them however they want making the restriction useless.
  • Since we plan on removing the beta flag soon anyway I think it's simpler to loosen the restriction.

Currently if a school doesn't have the blocks editor enabled they are unable to add migrated ExCS projects.

This allows any client to create scratch projects, even if the School does not have Scratch enabled. I think this is fine as schools without this enabled still won't see the button to add Scratch projects. Even if we did restrict it to ExCS projects in some way, clients could add those projects and then edit them however they want making the restriction useless.

Since we plan on removing the beta flag soon anyway I think it's simpler to loosen the restriction.
@cla-bot cla-bot Bot added the cla-signed label Sep 9, 2026
@zetter-rpf
zetter-rpf marked this pull request as ready for review September 9, 2026 16:13
Copilot AI lite review requested due to automatic review settings September 9, 2026 16:13
@zetter-rpf zetter-rpf changed the title Allow Scratch projects to be created by ExCS client Allow Scratch projects to be created by ExCS clients Sep 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes consistently remove the Scratch-enabled restriction across controllers and align the request specs with the updated intended behavior.

Pull request overview

This PR removes the server-side “Scratch enabled” gate for lesson creation so Experience CS (and any other) clients can create Scratch-backed lesson projects even when a school hasn’t enabled Scratch.

Changes:

  • Removed the scratch_enabled authorization check from lesson create/create_copy and lesson batch creation endpoints.
  • Deleted request specs that expected 403 Forbidden when scratch_enabled is false, and updated remaining specs to reflect the new behavior.
  • Removed now-unused helper methods from LessonCreation.
File summaries
File Description
spec/features/lesson/creating_a_lesson_spec.rb Updates lesson creation specs to allow Scratch lesson creation without requiring scratch_enabled.
spec/features/lesson/creating_a_batch_of_lessons_spec.rb Updates batch lesson creation specs to remove scratch_enabled setup and “forbidden” expectations.
app/controllers/concerns/lesson_creation.rb Removes Scratch gate helper methods that enforced the scratch_enabled restriction.
app/controllers/api/lessons/batch_controller.rb Removes the before_action that blocked Scratch lesson batch creation when Scratch wasn’t enabled.
app/controllers/api/lessons_controller.rb Removes the before_action that blocked Scratch lesson creation/copy when Scratch wasn’t enabled.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Test coverage

93.55% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/34375320721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants