-
Notifications
You must be signed in to change notification settings - Fork 7
[API] Add "import/export app" commands #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mirkoCrobu
wants to merge
22
commits into
main
Choose a base branch
from
issue_647_import_export
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,798
−2
Conversation
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
a9dd57c to
d636791
Compare
dido18
requested changes
Jan 8, 2026
Contributor
Author
test on board for import:
|
dido18
reviewed
Jan 12, 2026
dido18
reviewed
Jan 13, 2026
dido18
reviewed
Jan 13, 2026
lucarin91
reviewed
Jan 13, 2026
dido18
requested changes
Jan 14, 2026
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.
Motivation
Change description
We should add a command and API endpoint (to be used by the App Lab), to export and import Arduino Apps.
The exported format should be the app folder structure, zipped as a single file
When exporting, remove .cache, secrets and data (or provide an option to keep or exclude data)
When importing, the structure and contents of the app must be validated first
Export
GET /api/v1/apps/{appId}/export?include_data=trueparameters:
Include_data: boolean, optional, default: falseResponses
200 OK
Content-Type: application/zip
Content-Disposition: attachment; filename="my_app.zip"
400 Bad Request
{ "details": "The parameter 'include_data' must be a boolean.", }404 Not Found
{ "details": "App with ID '12345' not found.", }500 Internal Server Error
{ "details": "Failed to generate archive.", }Export rules
Always exclude:
Implementation Details & Trade-offs about zip handling
In-Memory Processing (Buffer)
Pro
Cons
Direct Stream Processing
Pro
Cons
more complex implementation
error during streaming may result in a partially corrupted ZIP
Content-Length cannot be easily known in advance
may be slower than in-memory buffer if using compression
Temporary Zip on Disk
Pro
Cons
Import
POST /api/v1/apps/importHeaders
Content-Type: multipart/form-data
Body Parameters
file: Binary (The .zip file to upload). Required.
Responses
201 Created Import successful. Returns the id(
same response as POST /v1/apps) of the newly created app.{ "id": "12345" }400 Bad Request (Validation Errors) The file is invalid, corrupt, or the directory structure is incorrect.
{ "details": "Missing required file 'app.yaml' ." }409 Conflict An app with the same name already exists.
{ "details": "App with ID '12345' already exists." }500 Internal Server Error
{ "details": "Failed to process the archive." }Validation Rules
The server must validate the archive before finalizing the import.
If any check fails, the process aborts, and no files are written to the final app destination.
Verify that the file is a valid ZIP archive and check that the archive must contain essential folders:
Reuse the existing code for validation (also check [this]
arduino-app-cli/internal/orchestrator/app/validator.go
Line 11 in 5deb69a
Sanitization(after validation): we just import everithing is a valid zip
Drop any file that is not one of the following:
Implementation Details
Point to discuss
TODO
Reviewer checklist
main.