Importing projects site projects from .sb3 files#855
Conversation
Test coverage91.85% line coverage reported by SimpleCov. |
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |
| @@ -0,0 +1,24 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| module Sb3ArchiveHelper | |||
There was a problem hiding this comment.
I like this helper, very useful for these tests!
jamdelion
left a comment
There was a problem hiding this comment.
Looks good to me, but may be worth waiting for a Ruby expert's eye just in case 👁️
zetter-rpf
left a comment
There was a problem hiding this comment.
Great work, for me the main thing that would be good to improve is the changes to lib/scratch_asset_importer.rb file the and error handling in it. Left a few other minor comments/questions.
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ea51c47. Configure here.
There was a problem hiding this comment.
Pull request overview
Adds support for importing Scratch “site projects” from .sb3 archives by parsing project.json, extracting referenced assets, and wiring .sb3 handling into both filesystem and GitHub webhook-based imports.
Changes:
- Introduces
Sb3Parserplus anScratchSb3AssetImporterfor extracting/importing Scratch component JSON + assets from.sb3archives. - Updates
ProjectImporter,UploadJob, andFilesystemProjectto accept.sb3as a Scratch component input. - Adds test coverage for the parser, asset importer, and end-to-end upload/import behavior.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/support/sb3_archive_helper.rb | Adds test helper for generating .sb3 (zip) archives used by new specs. |
| spec/lib/scratch_sb3_asset_importer_spec.rb | Covers importing global Scratch assets from .sb3 archive entries. |
| spec/lib/sb3_parser_spec.rb | Covers parsing project.json and referenced assets from .sb3. |
| spec/lib/project_importer_spec.rb | Adds Scratch-specific import tests for .sb3 components + assets. |
| spec/jobs/upload_job_spec.rb | Adds webhook upload coverage for .sb3 Scratch projects. |
| lib/tasks/project_components/scratch-integration-test-starter/project_config.yml | Adds a filesystem-importable Scratch project config for the integration starter. |
| lib/scratch_sb3_asset_importer.rb | New importer for creating global ScratchAsset records from .sb3 assets. |
| lib/scratch_asset_importer.rb | Makes create_scratch_asset private (encapsulation change). |
| lib/sb3_parser.rb | New .sb3 archive parser extracting component JSON and referenced assets. |
| lib/project_importer.rb | Adds Scratch .sb3 import flow for scratch component content + global assets. |
| app/models/filesystem_project.rb | Allows .sb3 components for filesystem project imports. |
| app/jobs/upload_job.rb | Treats .sb3 files as components and fetches them as IO for import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible. |

What's changed?
.sb3filescratch_sb3_asset_importer.rbcode_editor_scratchprojects.sb3files.sb3files