Skip to content

Update student ability and json response to handle remix project#886

Open
cocomarine wants to merge 2 commits into
mainfrom
1509-fix-get-request-for-student-scratch-remixes
Open

Update student ability and json response to handle remix project#886
cocomarine wants to merge 2 commits into
mainfrom
1509-fix-get-request-for-student-scratch-remixes

Conversation

@cocomarine

@cocomarine cocomarine commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Status

What's changed?

  • Allow school students to access show_context for their own remix projects.
  • Update the context response view to get lesson_id/class_id from the project’s lesson or the parent’s lesson for remixes.
  • Add test covering the remix context response for a student.

Steps to perform after deploying to production

If the production environment requires any extra work after this PR has been deployed detail it here. This could be running a Rake task, a migration, or upgrading a Gem. That kind of thing.

Copilot AI review requested due to automatic review settings June 19, 2026 15:02
@cla-bot cla-bot Bot added the cla-signed label Jun 19, 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.

Pull request overview

This PR updates the school-student authorization and the /api/projects/:identifier/context JSON payload so that student-owned remix projects can return the correct lesson/class context (derived from the original/parent lesson project).

Changes:

  • Allow school students to access show_context for their own remix projects (remixed from a student-visible lesson project).
  • Update the context Jbuilder view to derive lesson_id/class_id from the project’s lesson or (for remixes) the parent’s lesson.
  • Add a request spec covering the remix context response for a student.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
spec/requests/projects/show_context_spec.rb Adds request coverage for fetching context for a student-owned remix project.
app/views/api/projects/context.json.jbuilder Derives context lesson/class from @project.lesson or @project.parent.lesson to support remixes.
app/models/ability.rb Grants students show_context permission for eligible remix projects they own.

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

Comment thread app/views/api/projects/context.json.jbuilder
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

Test coverage

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

@cocomarine cocomarine temporarily deployed to editor-api-p-1509-fix-g-wbah2i June 19, 2026 15:10 Inactive
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