onlyutkarsh / gitlab-integration

This extension integrates GitLab with Azure Pipelines. With this extension, you will be able to download the sources from a GitLab repository (using clone command) and use downloaded sources in Azure Pipelines
https://marketplace.visualstudio.com/items?itemName=onlyutkarsh.gitlab-integration
GNU General Public License v3.0
20 stars 5 forks source link

self hosted URL assumptions #3

Closed mfkl closed 5 years ago

mfkl commented 5 years ago

Hello,

Thanks for this extension, I'm in the process of setting it up.

This line assumes things about the URL that is causing problems for me https://github.com/onlyutkarsh/gitlab-integration/blob/c4f68949e0c751ba83a56488dd2838c444b3e453/vss-extension.json#L96

As you can see in those screenshots:

This hack makes it work, but probably will be an issue for the next steps.

onlyutkarsh commented 5 years ago

Hey @mfkl If you are looking to configure the endpoint just to access one single project, that will not work. What happens if you configure Server URL as just https://code.videolan.org and username as just mfkl with the token? As you can see from the first error, the /api/v4 is always applied.

mfkl commented 5 years ago

What happens if you configure Server URL as just https://code.videolan.org and username as just mfkl with the token?

The final URL becomes https://code.videolan.org/api/v4/ which returns HTTP 404 because the project ID is not specified. The correct URL is https://code.videolan.org/api/v4/projects/187/

onlyutkarsh commented 5 years ago

What happens if you configure Server URL as just https://code.videolan.org and username as just mfkl with the token?

The final URL becomes https://code.videolan.org/api/v4/ which returns HTTP 404 because the project ID is not specified.

When you are creating the service connection I use https://code.videolan.org/api/v4/users?username=mfkl to see if I can get the user information. This is just to validate the token you have put in. I do not query for projects there. It should not return 404?

mfkl commented 5 years ago

Yes that seems to work, thanks!