Skip to content

Importing projects site projects from .sb3 files#855

Open
rammodhvadia wants to merge 42 commits into
mainfrom
sb3parser
Open

Importing projects site projects from .sb3 files#855
rammodhvadia wants to merge 42 commits into
mainfrom
sb3parser

Conversation

@rammodhvadia

@rammodhvadia rammodhvadia commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What's changed?

  • Added an sb3 parser to extract scratch component json and asset files from .sb3 file
  • Added new functions to import assets from sb3 files in ProjectImporter
  • Updated ProjectImporter to import scratch component and asset for code_editor_scratch projects
  • Updated UploadJob to process .sb3 files
  • Updated FileSystemProject to accept .sb3 files

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Test coverage

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

@cla-bot

cla-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

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.

@RaspberryPiFoundation RaspberryPiFoundation deleted a comment from cla-bot Bot Jun 12, 2026
@RaspberryPiFoundation RaspberryPiFoundation deleted a comment from cla-bot Bot Jun 12, 2026
@RaspberryPiFoundation RaspberryPiFoundation deleted a comment from cla-bot Bot Jun 12, 2026
@RaspberryPiFoundation RaspberryPiFoundation deleted a comment from cla-bot Bot Jun 12, 2026
@RaspberryPiFoundation RaspberryPiFoundation deleted a comment from cla-bot Bot Jun 12, 2026
@rammodhvadia rammodhvadia changed the title Sb3parser Importing projects site projects from .sb3 files Jun 12, 2026
@cla-bot

cla-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

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.

Comment thread app/jobs/upload_job.rb
Comment thread app/jobs/upload_job.rb Outdated
Comment thread app/jobs/upload_job.rb Outdated
Comment thread app/models/filesystem_project.rb Outdated
Comment thread lib/sb3_parser.rb Outdated
Comment on lines +38 to +41
io.rewind if io.respond_to?(:rewind)
result = nil
Zip::File.open_buffer(io.read) { |zip_file| result = yield zip_file }
result

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.

Is the rewind needed? Also you don't need to assign the result, but you can call return inside the block.

Suggested change
io.rewind if io.respond_to?(:rewind)
result = nil
Zip::File.open_buffer(io.read) { |zip_file| result = yield zip_file }
result
Zip::File.open_buffer(io.read) do
return yield it
end

@cla-bot

cla-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

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.

@cla-bot

cla-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

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.

@cla-bot

cla-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

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.

Comment thread lib/project_importer.rb Outdated
@cla-bot

cla-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7964582. Configure here.

Comment thread lib/project_importer.rb
@cla-bot

cla-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

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.

@mwtrew mwtrew assigned mwtrew and unassigned mwtrew Jun 25, 2026
@mwtrew mwtrew requested review from mwtrew and removed request for mwtrew June 25, 2026 12:16

@mwtrew mwtrew 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.

Changes since Chris' review look fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Sb3Parser Extend ProjectImporter for Scratch Handle .sb3 files in UploadJob

6 participants