VSCode-ShareCode icon indicating copy to clipboard operation
VSCode-ShareCode copied to clipboard

GitLab support

Open CBainx opened this issue 8 years ago • 6 comments

I was not able to get GitLab support working on the latest 9.1 release. First, in the project snippets api 'visibility_level' was changed to 'visibility' and was changed from numbers (0, 10, 20) to strings (private, internal, public). Also there is no indication as to what the base URL should be for private gitlab instances. 'base.level.domain' does not work, I had to use 'base.level.domain/api/v4'. I think this should be added to the readme. Also for some reason some files are pasted to gitlab just fine after these changes, but other (usually bigger files, can't figure out which symbols exactly cause the 404) will not paste and the plugin provides no indication of a failure or success. I noticed that the API was generated by swagger, so I think it would be easier to just regenerate the API rather than me fixing the generated code and providing a pull request.

If you do need help solving this issue let me know, I'd be willing to help. I would also be interested in taking advantage of the new User Snippets API instead of (or possibly in combination with) using project snippets.

CBainx avatar Apr 29 '17 20:04 CBainx

I did get it to work adding the /api/v4 to the base URL (thanks for the tip @CBainx). One thing that's missing now though, is that I am forced to select a project. However, in Gitlab I can create a snippet just under my profile, not connected to any specific project.

Sharing a snippet in this more generic way makes much more sense than having to make it part of a project.

batjko avatar Jul 12 '17 14:07 batjko

@CBainx What the base URL should be for? 'https://gitlab.com/api/v4'?

codeborui avatar Dec 12 '17 04:12 codeborui

@codeborui Yes, that is the URL you will want to use if you have a gitlab account and are not hosting your own server.

CBainx avatar Dec 12 '17 06:12 CBainx

Gitlab doesnt seem to work for me at all. I'd be willing to try and fix and PR to it i guess since the rest of the plugin is pretty great.

grahamannett avatar Jan 16 '18 02:01 grahamannett

+1, I'm interested in this issue too. Anyone have enough knowledge to know how to diagnose what's happening? @grahamannett or @batjko Appending API url to base url 'https://gitlab.com/api/v4 presents me with a list of public projects, but not my own. Sounds like the API key authorization didn't work.

fieldse avatar Mar 15 '18 03:03 fieldse

Still experiencing the same issue here.

nezorflame avatar Feb 20 '19 12:02 nezorflame