Skip to content

Scratch projects create action for remixing#728

Open
zetter-rpf wants to merge 1 commit intomainfrom
implement-create-project-for-remixing
Open

Scratch projects create action for remixing#728
zetter-rpf wants to merge 1 commit intomainfrom
implement-create-project-for-remixing

Conversation

@zetter-rpf
Copy link
Contributor

Related to: https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1189

This is based on the similar endpoint in Experience CS.

Having this will allowed me to test the behaviour of Scratch remixing locally and it will allow us to start work implementing remixing on the frontend before the API is fully implemented.

I considered re-using our existing endpoint for remixing, but this is not possible because Scratch does not support updating an unsaved project's id (see [1] for more).

[1] - https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1189#issuecomment-4047292796

This is based on the similar endpoint in Experience CS.

Having this will allowed me to test the behaviour of Scratch remixing locally and it will allow us to start work implementing remixing on the frontend before the API is fully implemented.

I considered re-using our existing endpoint for remixing, but this is not possible because Scratch does not support updating an unsaved project's id (see [1] for more).

[1] - RaspberryPiFoundation/digital-editor-issues#1189 (comment)
@cla-bot cla-bot bot added the cla-signed label Mar 12, 2026
@github-actions
Copy link

Test coverage

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

@zetter-rpf zetter-rpf marked this pull request as ready for review March 12, 2026 15:02
Copilot AI review requested due to automatic review settings March 12, 2026 15:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a minimal POST /api/scratch/projects endpoint to support local testing of Scratch “remix” project creation behind the existing cat_mode feature flag and cookie-based auth, aligning with the existing Scratch stub endpoints.

Changes:

  • Add create route for api/scratch/projects.
  • Implement ProjectsController#create with a remix-only guard (is_remix).
  • Add request specs covering auth, feature-flag gating, remix-only behavior, and success response shape.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
spec/features/scratch/creating_a_scratch_project_spec.rb Adds request coverage for the new Scratch project create/remix endpoint.
config/routes.rb Exposes POST /api/scratch/projects via resources :projects, only: ... create.
app/controllers/api/scratch/projects_controller.rb Implements create action and a before_action to forbid non-remix creates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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.

2 participants