SolidLabResearch / Challenges

24 stars 0 forks source link

Edit Pod files in vscode #80

Closed jeswr closed 1 year ago

jeswr commented 1 year ago

Pitch

The goal of this challenge is to create a vscode extension similar to remote ssh that allows you to edit files on a remote POD as if they were directly on your machine - thus removing the barrier of entry to enabling devs and admins to inspect Pods both for their own understanding of what is there for the own Pedagological gain - and also allowing them to edit data in Pods.

Desired solution

The desired solution would being able to follow the following workflow:

Acceptance criteria

See desired solution. The file tree visualisation is not required, instead you could implement the same functionality of searching paths as remote-ssh.

This should work when tested against at least one CSS and one ESS instance. I would suggest it should work against the following deployments:

Pointers

jeswr commented 1 year ago

Really wanted this, spent a few hrs on it yesterday. Almost done barring a critical bug around sessions. Happy to hand it over if someone else wants to take over and fix it.

RubenVerborgh commented 1 year ago
Dexagod commented 1 year ago

I might be able to make something like this work indeed with the bashlib code. Currently it already supports the editing of files bij moving it to a /temp folder. (Though this would need it to be a bit more robust, handle timeouts, re-logging in, etc...)

Although i feel like to make this optimal, supporting the mounting of a solid pod locally would be ideal? Or would that be overkill?

jeswr commented 1 year ago

Or would that be overkill?

In the case of VScode probably overkill. It has most of the functionality to handle virtual file systems built in and all we need to do is implement the vscode.FileSystemProvider interface (see https://github.com/microsoft/vscode-extension-samples/blob/main/fsprovider-sample/src/fileSystemProvider.ts).

I have this working - the primary bug that I was running into is that the authentication session was not persisted between extension activations so I just needed to make sure that the session information was stored in the vscode.ExtensionContext in a way that is recoverable. I have mostly implemented this.

Dexagod commented 1 year ago

You can store the session information and reuse it (i do this with bashlib) Though it's a bit hacky a.t.m.

If you work with Community Solid Server, you can work with Client credentials tokens, and then you don't need to worry about session management that much, as you don't need to do the interactive login step anymore (Inrupt also has some kind of support for this, but that's only for applications these tokens and not for users AFAIK)

jeswr commented 1 year ago

Draft version available https://marketplace.visualstudio.com/items?itemName=jeswr.solidfs

github-actions[bot] commented 1 year ago

Please provide a status update about this challenge. Every ongoing challenge needs at least one status update every 2 weeks. Thanks!

jeswr commented 1 year ago

@pheyvaer - I think this can be closed off since there is a drafter version available; and the offical version is just a matter of making code more production ready / adding other features.

pheyvaer commented 1 year ago

@jeswr Do you also have a link to the code of the draft version?

pheyvaer commented 1 year ago

You find the report for this challenge here.