-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Feature] Google Drive upload and download (includes a working demo) #1876
Comments
Thanks for working on this! Probably the most important question to answer first before spending a bunch of time on this is if we are going to be willing an able to support such a feature (technically, legally, enough manpower, etc.). Even it we can technically make it work, there are a lot of other things to be considered. And there are also a few technical things that we want to make sure we can overcome before continuing.
|
API keys is designed to be available to public. It's restricted to certain domain name and referer URLs, so it won't be abused. Oauth token is commonly stored in user's browser stroage.
Agreed, I will update and make it work. Suppose user should only download files that were uploaded by pybricks. |
Thanks for working on this. From a user experience point of view, would uploading and downloading individual files be the most practical? If we had this feature, I would imagine the following could be quite nice:
In this case, we would ideally avoid reinventing the wheel on file conflicts, but follow Dropbox/Google standards. In Dropbox for example the conflicts just show as a timestamped copy of the file, so we would not need any new UIs. Mistakes can be recovered from the Dropbox/Google interface. Conflicts can be deleted by the user. Kids working together on school projects will be used to this. * A real folder would be nice, but if we can achieve something similar with the APIs David mentioned that is just fine too. I'm just describing the use case here, not the technical implementation. |
This simplify the folder lookup progress, users don't need to worry about finding the destination folder in drive, also limit the permission scope. So, maybe we can by default create and upload to
I asked @dlech before about this question, he also lean on individual file rather than sync a whole folder.
Yes, they both have good history tracking. Google Drive API by default treat files uploaded with same file name as different files, so if a file is uploaded multiple times, there will be multiple with same name there (we could also change the behavior to overwrite). I'm think what will be easiest for kids. I actually considering if we can add a comment line for downloaded files, with their original remote location and a timestamp. Which will be easier for kids for handling conflictions when download a different version changed by their teammates. Like:
|
I'm not sure if manual, individual upload and download is viable in a team with kids. It would be very easy to forget one file, creating a mismatch for the other team member, with compounds when the original team member continues. (This is why we added the download zip option earlier). Google/Dropbox/Onedrive have years of experience dealing with shared folders. This seems like a pattern that people are familiar with at school and work. It's also really easy to explain. Since Pybricks Code also has a single folder with files, this seems like the perfect match.
Yes, this is what I meant. Then users can use Google/Dropbox UI to configure sharing that folder as they see fit.
I'm not sure this is easier since you have to open them up before you can see which it is, and manually compare dates. For conflicts, maybe we could follow the pattern that they see in their own local cloud drive folder. That is to say, let Google/Dropbox create the timestamp-named conflict files. Thanks again for working on this. It would be really amazing to have something like this available at some point. I do want to re-iterate what @dlech shared earlier:
That is to say, please don't be discouraged if we can't merge it for now or in the future. We really are quite short on people 🙂 |
I think what you proposed sounds like fulltime sync model. Ideally all typing operation will be synced to remote immediately, local storage will be only used as a cache. The experience will be like the file system on chromebooks, not even need a sync button, everything is behand the sense. I like that but there are also some question come to my mind:
|
I just implemented some Google Drive integration. Check out this demo here:
https://scatwang.github.io/pybricks-code/
video
Basically, it use Google Drive API to upload and download files. The react app get oauth token and talk to Google API directly ( hope this will be easier for GDPR).
A very basic version control just works, it should be good enough for small projects.
I will work on unit tests and documents if this looks good to you.
The text was updated successfully, but these errors were encountered: