Skip to content
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

Add archive command to zip a sketch and its files #931

Merged
merged 3 commits into from
Sep 3, 2020

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?
    New CLI command and new gRPC interface.
  • What is the current behavior?
    User can't create an archive of a Sketch from the CLI.
    gRPC consumer doesn't have an interface to archive a Sketch.
  • What is the new behavior?
    User can create a zip file containing all files from a Sketch, build directory is only included if explicitly specified with the --include-build-dir flag.

Some possible examples on how to call the command from the CLI:

arduino-cli archive
arduino-cli archive .
arduino-cli archive . <some_folder>
arduino-cli archive . <some_folder>/MySketchArchive.zip
arduino-cli archive <path_to_sketch>
arduino-cli archive <path_to_sketch> <some_folder>
arduino-cli archive <path_to_sketch> <some_folder>/MySketchArchive.zip
  • Does this PR introduce a breaking change?
    No.
  • Other information:
    None.

See how to contribute

@silvanocerza silvanocerza self-assigned this Sep 1, 2020
@silvanocerza silvanocerza added the status: in progress Work is in progress on this label Sep 1, 2020
@silvanocerza silvanocerza force-pushed the scerza/archive-command branch from 4bfe576 to 19b2f98 Compare September 1, 2020 14:17
@silvanocerza silvanocerza removed the status: in progress Work is in progress on this label Sep 1, 2020
@silvanocerza silvanocerza force-pushed the scerza/archive-command branch 10 times, most recently from f6d0094 to 3fb2fab Compare September 2, 2020 16:03
@silvanocerza silvanocerza force-pushed the scerza/archive-command branch from 3fb2fab to 5dbeb05 Compare September 3, 2020 07:38
@silvanocerza
Copy link
Contributor Author

Links check is failing again because of https://codecov.io/gh/arduino/arduino-cli, it seems to work finely on the browser for me though.
The rest of the tests are finally working too. 🎉

commands/instances.go Outdated Show resolved Hide resolved
Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

I've made some suggestions to slightly simplify here and there.

I'm wondering if the case:

arduino-cli archive . /path/to/some/dir/name

should automatically infer that we mean /path/to/some/dir/name.zip when the name folder doesn't exists. Personally, if I don't specify explicitly .zip I would expect a /path/to/some/dir/name: directory does not exists, but I'll leave to @ubidefeo the last word on this.

commands/instances.go Outdated Show resolved Hide resolved
commands/instances.go Outdated Show resolved Hide resolved
rpc/commands/commands.proto Outdated Show resolved Hide resolved
test/conftest.py Show resolved Hide resolved
test/test_archive.py Outdated Show resolved Hide resolved
commands/instances.go Outdated Show resolved Hide resolved
@cmaglie
Copy link
Member

cmaglie commented Sep 3, 2020

Nice work BTW, especially on the tests!

Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

👍

@silvanocerza silvanocerza force-pushed the scerza/archive-command branch from d30501d to 222b454 Compare September 3, 2020 13:29
@silvanocerza silvanocerza force-pushed the scerza/archive-command branch from 222b454 to 7771404 Compare September 3, 2020 14:09
@silvanocerza silvanocerza merged commit b8cf32d into master Sep 3, 2020
@silvanocerza silvanocerza deleted the scerza/archive-command branch September 3, 2020 14:46
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.

3 participants