cozy / cozy-home-v2

This repository was part of CozyV2 which has been deprecated
https://blog.cozycloud.cc/post/2016/11/21/On-the-road-to-Cozy-version-3
GNU Affero General Public License v3.0
94 stars 53 forks source link

Support other gitlab providers #789

Open clochix opened 8 years ago

clochix commented 8 years ago

@bnjbvr is moving the source code a Kresus to Framagit, a Gitlab instance hosted by Framasoft. We should support this provider.

clochix commented 8 years ago

For the record, manually adding the URL of Framagit to the supported provider list and using the Gitlab connector just work, so we could hard-code this to be able to install Kresus in the future.

bnjbvr commented 8 years ago

Nice idea, although I think it'd be even better to just consider that an unknown provider is just a git provider; this should work with Github, all instances of Gitlab, etc.

Actually, the first question to raise is: what's the benefit of using github as a backend? Is there some github specific information that Cozy is fetching, when getting a package? I can think of the number of times the repository has been fav'd (aka stars), but that is arguably something that could be removed from the UI.

clochix commented 8 years ago

Before installing an application, we download its manifest, to get the permissions it needs and display it to the user. To fetch this file without cloning the whole repository (which could take a long time), we use URLs specifics to each provider. So we need to guess which Git frontend each provider use.

bleuse commented 8 years ago

What about a sparse checkout that would include only the manifest? By doing so, the remote only need to be supporting git > 1.7.0. See: https://schacon.github.io/git/git-read-tree.html#_sparse_checkout http://jasonkarns.com/blog/subdirectory-checkouts-with-git-sparse-checkout/

nicofrand commented 8 years ago

Git 1.7.9.5 has git archive : http://stackoverflow.com/a/18331440, that might be a simpler solution.

babolivier commented 8 years ago

git archive doesn't work with GitHub, but indeed Cozy could check the repo URL and use either git archive or the GitHub raw links depending on the case.

Regarding the apps which use NPM (I think some of the official apps are installed using NPM and not Git), a simpler solution could be to use this package to grab the JSON manifest.

bnjbvr commented 8 years ago

If this is just about the package.json file, maybe it could simply be a field in the cozy-registry json descriptor of the app, instead?

babolivier commented 8 years ago

If this is just about the package.json file, maybe it could simply be a field in the cozy-registry json descriptor of the app, instead?

What should we put in this field? The whole package.json file? Or a link? With the latest, that wouldn't resolve the issue, and with the first it would be painful for an app developer to have to send a PR at each version of the app to update the app's metadatas (version/description/permissions) imho.

bnjbvr commented 8 years ago

I thought we'd put the link to the manifest file in the descriptor field (which would actually solve the issue, unless the blocker of the issue isn't that the manifest needs to be recovered), but as stated on IRC, that would not be convenient at all for unofficial apps, so never mind me.

bnjbvr commented 8 years ago

Just a heads-up: the migration from Github to Framagit is done, so it's not possible to install a development version of Kresus at this time from the Cozy marketplace. That'd be nice to have for sure 😄

clochix commented 8 years ago

There are some quick and easy workaround:

Choosing one of this option would allow to quickly make our platform more open.

babolivier commented 8 years ago

Hi,

Not sure of the use of such a quick fix. After all the discussion here, I think that it would take less time to do this in a clean way (if not GitHub then any other server, and use the mentioned git command) than to add a quick fix and then roll out the clean procedure.

Brendan Abolivier < brendan@abolivier.fr [brendan@abolivier.fr] > - @BrenAbolivier [https://twitter.com/BrenAbolivier] Student @ ISEN Brest President @ Trancendances Contributor @ Cozy, RSF/RWB On Fri, Sep 02, 2016 at 12:50 PM, Clochix < notifications@github.com [notifications@github.com] > wrote: There are some quick and easy workaround:

Choosing one of this option would allow to quickly make our platform more open.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub [https://github.com/cozy/cozy-home/issues/789#issuecomment-244344365] , or mute the thread [https://github.com/notifications/unsubscribe-auth/AFSnB9m_L8xubxW3NLSfUqo65zmEl8aaks5ql_9LgaJpZM4JOb98] .

jsilvestre commented 8 years ago

I did a quickfix (https://github.com/cozy/cozy-home/pull/823) because it seems overkill to do more. Also, I'm not quite sure git archive is the way to go here, and I don't have time to think about it.

clochix commented 8 years ago

It may be worth having a look at https://github.com/guyzmo/git-repo that provide an unified interface to interact with Github, Gitlab and Bitbucket