Support syncing ExperienceCS user projects - #979
Open
abcampo-iry wants to merge 4 commits into
Open
Conversation
abcampo-iry
force-pushed
the
issues/1709
branch
from
August 25, 2026 07:55
4f679d3 to
036934d
Compare
Test coverage93.46% line coverage reported by SimpleCov. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for migrating ExperienceCS user Scratch projects into their existing Code Classroom “stub” projects, using a service-authenticated endpoint and ensuring migrations (and related asset uploads) can be retried safely without granting broad access to other projects.
Changes:
- Adds
PUT /api/experience-cs/projects/:id/migrateto replace a locale-less legacy Scratch stub in place and mark it as migrated (experience_cs_migrated_at) for safe replays. - Introduces service-account abilities to allow migration + migration-asset upload while preventing general project access.
- Extends Scratch asset upload/view logic and test coverage to support migration assets and preserve project asset visibility rules.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/requests/experience_cs_project_migrations/update_spec.rb | Request specs for the new migration endpoint behavior (in-place replace, idempotency, auth/locale rules). |
| spec/models/project_spec.rb | Unit tests for Project#experience_cs_migration_target?. |
| spec/models/ability_spec.rb | Ability specs for the ExperienceCS service account migration permissions. |
| spec/features/scratch/creating_and_showing_a_scratch_asset_spec.rb | Feature specs for service-uploaded migration assets and migrated-asset visibility rules. |
| README.md | Documents the new migration endpoint and how project-scoped migration assets behave. |
| db/schema.rb | Schema version bump plus the new projects.experience_cs_migrated_at column. |
| db/migrate/20260824120000_add_experience_cs_migrated_at_to_projects.rb | Migration adding experience_cs_migrated_at to projects. |
| config/routes.rb | Adds the migration route under /api/experience-cs/projects/:id/migrate. |
| app/models/scratch_asset.rb | Allows Scratch assets to belong to ExperienceCS Scratch project types (legacy + code editor scratch). |
| app/models/project.rb | Adds experience_cs_migration_target? predicate used for authorization/eligibility. |
| app/models/ability.rb | Adds service-account abilities and expands school owner visibility for remixed lesson projects. |
| app/controllers/api/scratch/assets_controller.rb | Adds migration-asset upload support (service auth path, conflict checks, uploader attribution). |
| app/controllers/api/experience_cs_project_migrations_controller.rb | New controller implementing the migration update operation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
abcampo-iry
force-pushed
the
issues/1709
branch
from
August 25, 2026 15:32
903b6b3 to
e2d8d15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
What's changed?
Adds an endpoint for migrating an ExperienceCS project into its existing Code Classroom stub.
The migration: