Skip to content

Enable rename and delete options for Cloud Sketch and/or any of its files #1825

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

Closed
3 tasks done
davegarthsimpson opened this issue Jan 20, 2023 · 10 comments · Fixed by #1833
Closed
3 tasks done

Enable rename and delete options for Cloud Sketch and/or any of its files #1825

davegarthsimpson opened this issue Jan 20, 2023 · 10 comments · Fixed by #1833
Assignees
Labels
conclusion: resolved Issue was resolved topic: cloud Related to Arduino Cloud and cloud sketches topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@davegarthsimpson
Copy link
Contributor

davegarthsimpson commented Jan 20, 2023

Describe the request

Allow the renaming and deletion of cloud sketches and individual additional files in cloud sketches via the Arduino IDE UI.

Describe the current behavior

It is not possible to rename or delete cloud (AKA "remote") sketches using Arduino IDE.

It is not possible to rename or delete individual additional files of cloud sketches using Arduino IDE:

image

Arduino IDE version

afb02da

Operating system

All

Operating system version

Any

Additional context

This will require investigation on allowed API calls and their repercussions

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@davegarthsimpson davegarthsimpson added topic: code Related to content of the project itself type: enhancement Proposed improvement labels Jan 20, 2023
@kittaakos
Copy link
Contributor

What does the deletion/rename intend to do here? Is it a brute force modification on the remote sketch when the user executes it or is this operation changes the local sketch only then the user has to push the changes to the remote to have the desired delete/rename effect?

Whenever a new file is created or file content changes, the changes are not automatically applied to the remote content but only to the local cache and users have to push the changes manually. Does IDE2 want to provide different behavior for rename/delete and new/update?

Can you please help define the expected behavior @91volt? Maybe you had the chance to discuss it with @ubidefeo when you designed the new feature. Thank you!

Screen Shot 2023-01-20 at 13 05 02

@kittaakos
Copy link
Contributor

Rename/Delete must be avail from the sketchbook view.

Screen Shot 2023-01-20 at 13 04 53

@kittaakos kittaakos added the status: in progress Work is in progress on this label Jan 20, 2023
@kittaakos

This comment was marked as duplicate.

@kittaakos

This comment was marked as duplicate.

@91volt
Copy link

91volt commented Jan 20, 2023

What does the deletion/rename intend to do here? Is it a brute force modification on the remote sketch when the user executes it or is this operation changes the local sketch only then the user has to push the changes to the remote to have the desired delete/rename effect?

We should trigger the API call when the user delete the sketch folder. This is because if we delete the local version only, the user wouldn't have any entry point to trigger the "push" of this deletion to Arduino servers.

Whenever a new file is created or file content changes, the changes are not automatically applied to the remote content but only to the local cache and users have to push the changes manually. Does IDE2 want to provide different behavior for rename/delete and new/update?

I don't see any issue with this behavior, is the same logic we have applied when a user create a new Cloud Sketch from the IDE 2: the API are called directly after the user create the Cloud sketch from IDE 2, he doesn't have to manually push it after creation.

@kittaakos Do you agree?

P.s. I didn't have any chance to discuss it with @ubidefeo yet.

kittaakos pushed a commit that referenced this issue Jan 25, 2023
Ref: #1825

Signed-off-by: Akos Kitta <[email protected]>

fix: local deletion

Signed-off-by: Akos Kitta <[email protected]>

s

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Jan 25, 2023
@91volt
Copy link

91volt commented Jan 25, 2023

Since the possibility of Renaming/Deleting sketches from IDE 2 Sketchbook poses some issues and cases that needs time to be addressed and implemented (e.g. the user rename or delete a sketch that is currently opened from another IDE 2 workspace instance), as initial phase we are going to implement the rename/delete actions only within the opened sketch, in tabs contextual menu (with main .ino tab selected).

See screenshots attached:
image

@kittaakos
Copy link
Contributor

The Create API should error 404 when deleting a non-existing folder (or sketch). Unfortunately, it fails with 500. Hence, IDE2 cannot use the DELETE /create/v2/files/d/{path} endpoint and must use the DELETE /create/v2/sketches/byPath/{path} which does not support $HOME variable substitution.

@kittaakos
Copy link
Contributor

Depends on #649

@kittaakos
Copy link
Contributor

Getting the sketches is not reliable. I use the GET /create/v2/sketches endpoint. The response is:

[
    {
        "board_fqbn": "",
        "board_name": "",
        "board_type": "",
        "created_at": "2023-01-30T14:32:25.218987Z",
        "href": "/create/v2/files/d/8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/rrrr2",
        "id": "aa6e1ab0-46d1-44ed-86f1-1e2407edb1ad",
        "is_public": false,
        "libraries": [],
        "modified_at": "2023-01-30T14:46:32.634Z",
        "name": "rrrr2",
        "path": "8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/rrrr2",
        "tutorials": null,
        "types": null,
        "user_id": "b036b0a3-ef0e-44b1-af37-3c756f20fdf0"
    },
    {
        "board_fqbn": "",
        "board_name": "",
        "board_type": "",
        "created_at": "2023-01-23T16:08:38.100336Z",
        "href": "/create/v2/files/d/8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/xxx/sketch_jan23bl",
        "id": "8946cc38-e832-4be6-a510-81351cf24506",
        "is_public": false,
        "libraries": [],
        "modified_at": "2023-01-23T16:08:40.547Z",
        "name": "sketch_jan23bl",
        "path": "8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/xxx/sketch_jan23bl",
        "tutorials": null,
        "types": null,
        "user_id": "b036b0a3-ef0e-44b1-af37-3c756f20fdf0"
    },
    {
        "board_fqbn": "arduino:avr:ethernet",
        "board_name": "Arduino Ethernet",
        "board_type": "serial",
        "created_at": "2022-10-25T14:02:12.360033Z",
        "href": "/create/v2/files/d/8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/alma",
        "id": "7258bf5a-e1ad-45ae-82bc-bfde42071cb7",
        "is_public": false,
        "libraries": [],
        "modified_at": "2023-01-16T14:51:12.480999Z",
        "name": "alma",
        "path": "8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/alma",
        "secrets": [
            {
                "name": "SECRET_PASSWORD",
                "value": "xxxx"
            }
        ],
        "tutorials": null,
        "types": null,
        "user_id": "b036b0a3-ef0e-44b1-af37-3c756f20fdf0"
    },
    {
        "board_fqbn": "",
        "board_name": "",
        "board_type": "",
        "created_at": "2023-01-16T10:57:24.474541Z",
        "href": "/create/v2/files/d/8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/korte",
        "id": "8d1c721b-dd40-4ad6-8a95-a725032905f9",
        "is_public": false,
        "libraries": [],
        "modified_at": "2023-01-16T13:46:54.140329Z",
        "name": "korte",
        "path": "8a694e4b83878cc53472bd75ee928053:kittaakos/sketches_v2/korte",
        "secrets": [
            {
                "name": "SECRET_PASSWORD",
                "value": "xxx"
            }
        ],
        "tutorials": null,
        "types": null,
        "user_id": "b036b0a3-ef0e-44b1-af37-3c756f20fdf0"
    }
]

But I have only three sketches online. Which is the truth; the server response or the online editor?

Screen Shot 2023-01-30 at 15 50 51

kittaakos pushed a commit that referenced this issue Jan 31, 2023
Closes #1599
Closes #1825
Closes #1826

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos
Copy link
Contributor

Here is another server bug

kittaakos pushed a commit that referenced this issue Feb 1, 2023
Closes #1599
Closes #1825
Closes #1826

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 1, 2023
Closes #1599
Closes #1825
Closes #1826

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 1, 2023
Closes #1599
Closes #1825
Closes #1826

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 2, 2023
Closes #1599
Closes #1825
Closes #1826

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 2, 2023
Closes #1599
Closes #1825
Closes #1826

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 2, 2023
Closes #1599
Closes #1825
Closes #1826

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 2, 2023
Closes #1599
Closes #1825
Closes #1826
Closes #1847

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 2, 2023
Closes #1599
Closes #1825
Closes #1826
Closes #1847

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 3, 2023
Closes #1599
Closes #1825
Closes #1826
Closes #1847

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos removed the status: in progress Work is in progress on this label Feb 6, 2023
kittaakos pushed a commit that referenced this issue Feb 8, 2023
Closes #1599
Closes #1825
Closes #1826
Closes #1847

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 13, 2023
Closes #1599
Closes #1825
Closes #1826
Closes #1847

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 13, 2023
Closes #1599
Closes #1825
Closes #649
Closes #1847
Closes #1882

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue Feb 15, 2023
Closes #1599
Closes #1825
Closes #649
Closes #1847
Closes #1882

Co-authored-by: Akos Kitta <[email protected]>
Co-authored-by: per1234 <[email protected]>

Signed-off-by: Akos Kitta <[email protected]>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Feb 15, 2023
@per1234 per1234 added the topic: cloud Related to Arduino Cloud and cloud sketches label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: cloud Related to Arduino Cloud and cloud sketches topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants