Skip to content

Scratch projects create action for remixing - #728

Merged
zetter-rpf merged 1 commit into
mainfrom
implement-create-project-for-remixing
Mar 17, 2026
Merged

Scratch projects create action for remixing#728
zetter-rpf merged 1 commit into
mainfrom
implement-create-project-for-remixing

Conversation

@zetter-rpf

Copy link
Copy Markdown
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
Copy Markdown

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

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.

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.

Comment thread app/controllers/api/scratch/projects_controller.rb
Comment thread spec/features/scratch/creating_a_scratch_project_spec.rb
bertocode

This comment was marked as off-topic.

@abcampo-iry abcampo-iry 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.

This seems reasonable as a placeholder before enabling remix.

@abcampo-iry
abcampo-iry dismissed bertocode’s stale review March 17, 2026 08:28

Personal account

@zetter-rpf
zetter-rpf merged commit b6bc86d into main Mar 17, 2026
10 checks passed
@zetter-rpf
zetter-rpf deleted the implement-create-project-for-remixing branch March 17, 2026 08:36
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.

4 participants